Presentation is loading. Please wait.

Presentation is loading. Please wait.

Exploring the Power of EPDM Tasks Working with and Developing Tasks in SolidWorks Enterprise PDM (EPDM) By: Marc Young xLM Solutions www.xlmsolutions.com.

Similar presentations


Presentation on theme: "Exploring the Power of EPDM Tasks Working with and Developing Tasks in SolidWorks Enterprise PDM (EPDM) By: Marc Young xLM Solutions www.xlmsolutions.com."— Presentation transcript:

1 Exploring the Power of EPDM Tasks Working with and Developing Tasks in SolidWorks Enterprise PDM (EPDM) By: Marc Young xLM Solutions

2 What is an EPDM Task Tasks are customizations that can be queued up and run on a separate computer / batch server Printing / PDF Generation Updating Files Checking file integrity The running of a task off loads the work to a server/computer so it does not take up time / resources of the individual’s computer Out of the Box EPDM Tasks (involving SolidWorks files) Convert Print Check Customized tasks can be created to handle very specific requirements

3 Sample Customized Tasks (1 / 2)
Watermarking Files Writing to a variable on the Drawing Creating a temporary note on the drawing Using third party software i.e. Adobe Writer Batch Printing Other Files Types – AutoCAD, Office, Inventor, SolidEdge …. Publishing Data Upon Release of a file / converted files gets moved to a secure location SharePoint Windows Share Another EPDM Vault

4 Sample Customized Task (2 / 2)
Merging files Generating one large PDF of all drawings / documentation in a project Engineering Change information that combines EC meta data and the file(s) effected Generating Reports Adding Custom Headers and Footers to Documents

5 Out of the Box EPDM Tasks
There are out of the box tasks for EPDM Print Convert Check These tasks can be configured and customized

6 Configuring Out of the Box Task
Assign the task name What Add-in to use Who will execute it as Should an input card be used Number of retries Minutes before failing

7 Execution Method Determine where the task will run
A computer needs to be designated via the Task Host Configuration If multiple task hosts can be picked Right click on blueberry to set a machine up as the task host

8 Menu Command Display the menu command to execute the task
The task could also be executed via a state transition

9 Task Specific Info (1/2) Specific info for the task Print Task
Always use one specific printer Provide a list of Printers for the user to pick Based on the printer on the sheet size of the drawing Convert Task Convert Format Conversion Options Configuration Options

10 Task Specific Info (2/2) Print Convert Page Size Orientation Margins
Header Info Footer Info Convert Map Variables Output paths Reference links

11 Print Task - Files Determine what files to print
Just the select file The select file and all of its references i.e. children Determine to use as built or latest Where the log info will be written to Advanced Configurations (Macro that performs this operation)

12 Advanced Scripting Options
This is the SolidWorks Macro that does the work

13 Notification Who should notify when the task is successful
Who should notify when the task fails What he message should say….

14 Adding Variable to Convert Task Output
Open up the script via Advance Scripting Options Declare a Vault Object Variable Add Functions LogIntoVault GetVariableValue Call Functions from main function Associated Variable Value to File Name

15 Declare Vault Object Dim vault As Object

16 Add Function - LoginToVault
Private Sub LoginToVault() On Error GoTo ErrHand Dim strTempVaultName As String Dim strVaultName As String strTempVaultName = "<VaultPath>" i = Len(strTempVaultName) j = InStrRev(strTempVaultName, "\") strVaultName = Right(strTempVaultName, i - j) Set vault = CreateObject("ConisioLib.EdmVault") vault.LoginAuto strVaultName, 0 Exit Sub ErrHand: If Not vault Is Nothing Then Dim errname As String Dim errdesc As String vault.GetErrorString Err.Number, errname, errdesc Log ("LoginToVault error" & vbCrLf & errname & vbCrLf & errdesc ) Else Log "Error creating file vault interface." End If End Sub

17 Add Function - GetVariableValue
Private Function GetVariableValue(FilePath, VariableName, Configuration) On Error GoTo ErrHand Dim File As Object 'Get the interface of the file (and its parent folder) Dim Folder As Object Set File = vault.GetFileFromPath(FilePath, Folder) 'Obtain the variable interface Dim pEnumVar As Object Set pEnumVar = File.GetEnumeratorVariable Dim Value As Variant If pEnumVar.GetVar(VariableName, Configuration, Value) Then GetVariableValue = Value Else GetVariableValue = "" End If Exit Function ErrHand: Dim ename As String Dim edesc As String vault.GetErrorString Err.Number, ename, edesc Log "GetvariableValue End Function

18 Add Function – Call Functions
Find Function Convert(docFileName) Add code below Specify the Variable Name and Configuration 'Get the vault interface Call LoginToVault 'Get Variable Value Dim VarValue VarValue = GetVariableValue(docFileName, "Number",

19 Add Function – Associate Variable Value To Name
Find Build destination filenames section Add code below where the filename is being configured convFileName = Replace(convFileName, "<VariableValue>", VarValue) Updated Code

20 All aspects of the Task can be configured:
Customization of EPDM Tasks Setup Configuration GUI Properties On close of the configuration window of the Task Initialization RMB Menu / bring up a GUI On close of the Task Initiates Execution The performing of the task Task Details The Details GUI of a the task

21 Setting up your Environment
Reference in the EPDM Library Set the import (simplify declarations) - Imports EdmLib Add the implements line - Imports EdmLib Write code for the two main add-In functions GetAddInfo – Information about the add-in OnCmd – Information about executing the Add-In Functions

22 OnTaskSetup This controls the setup behavior of the custom task
Add a Control to your project Create a sub for the OnTaskSetup Set where the control can run (menu / change state) Menu command for the control Associate GUI setup to task Design the control Set the Load Data and Store Data functions (you will need to create these functions)

23 OnTaskSetupButton This controls what happens then user hits okay or cancel at the end of the setup Per the entered values, save them to EPDM The task Properties object is used to store this information: IEdmTaskProperties

24 OnTaskLaunch This code executes on the client when the client initiates the task For instance, prompt the user to change the PDF Location This functions code will: Get selected files Store them in the task instance object Populate GUI based on info in Task Setup Show GUI If Cancel exit task

25 OnTaskLaunchButton Controls what happens if a Data Card is presented and the user hits okay / cancel Not used in this example

26 OnTaskRun The actual execution of the task
The code will perform the following actions: Get selected files Retrieve from the Task Instance Object Do something with them (purpose of the task) Create PDF for Excel Documents Store info regarding the execution of the task The Task Instance object can be used Set the task status

27 OnTaskDetails Allows the addition information / behavior present in the Detail information of the Task Add a Control to your project Create a sub for the OnTaskDetails Design the control Set the Load Data and Store Data functions You will need to create these functions If can be read from the task instance object

28 Best Practices for Running a Task
Have a dedicated Task Host machine to run the task It should be powerful enough to run SolidWorks or any CAD that be used The EPDM (blueberry) must started and use must be logged into the task host When the task runs a license of EPDM and SolidWorks will be taken Need to insure licenses will be available for the task host For Convert task it is recommend to set SolidWorks Visible to true swApp.Visible = True Clean up stuck (Cancelling) tasks via SQL UPDATE TaskInstances SET TaskStatus = 8 WHERE TaskStatus = 6 Make sure to control what files the task runs on when executed from a transition

29 Conclusion Task can be a powerfully way to off load time / processor consuming tasks Many of common requests can be done with the out of the box task If the out of the box task, cannot handle it, the task can be programed to handle almost any customer requirement

30 Script example shown is available at: http://www.xlmsolutions.com
Thank You! Marc Young xLM Solutions, LLC. Questions? Script example shown is available at:

31


Download ppt "Exploring the Power of EPDM Tasks Working with and Developing Tasks in SolidWorks Enterprise PDM (EPDM) By: Marc Young xLM Solutions www.xlmsolutions.com."

Similar presentations


Ads by Google