Hi I'm pretty new to the whole PDM API.
I have a SQL database that lists all of the parts that are in production and all of the dxf files that we have on hand. Often, even though we have automated dxf creation with the PDM task addin, there is a missing dxf file, so I thought I'd write a script to retrieve all the parts that need DXFs and create DXFs for them.
This is part of a script that tries to call a task using VB and it's throwing this error:
Error processing file: The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))
I cannot for the life of me figure out why this is occurring. All the parameters appear to match the desired type
From this code snippet:
Private Sub RunDxf(filepath As String)
Dim TaskMgr As IEdmTaskMgr = vault.createUtility(EdmUtility.EdmUtil_TaskMgr)
Dim Tasks As Array = TaskMgr.GetTasks()
Dim DXFConvert As EdmTaskInfo = Tasks(0)
Dim selectedFile(0) As EdmSelItem2
Dim parentFolder As IEdmFolder5
Dim CurrentFile As IEdmFile5 = vault.GetFileFromPath(filepath, parentFolder)
selectedFile(0).mlID = CurrentFile.ID
selectedFile(0).mlParentID = parentFolder.ID
selectedFile(0).mlVersion = CurrentFile.CurrentVersion
selectedFile(0).meType = EdmObjectType.EdmObject_File
MessageBox.Show(\$"parent folder name {parentFolder.Name}")
MessageBox.Show(\$"task to run is: {DXFConvert.mbsTaskName}")
TaskMgr.RunTask(DXFConvert, selectedFile, Me.Handle.ToInt32())
End Sub