Hello there!
Thi part of my program is not working. dwgFile is showing a value but I get the error that says “File could not be found”. I am trying to update mandatory data card variables of a draftsight file and check it in to the vault.
If File.Exists(dwgFilePath) Then
Try
dwgFile = vault.GetFileFromPath(dwgFilePath)
If Not dwgFile Is Nothing Then
vars = dwgFile.GetEnumeratorVariable()
obj = FileName
vars.SetVar("DrawingNo", "", obj)
'vars.SetVar("DrawingNo", "Model", obj)
obj = "Nameplate"
vars.SetVar("DrgDescription", "", obj)
vars.CloseFile(True)
dwgFile.UnlockFile(0, "Nameplate DWG")
End If
Catch ex As Exception
MsgBox("DWG checkin failed, please checkin manually!" & ex.ToString)
End Try
End If
This is the exception: system.runtime.interopservices.comexception (0x80040213): the file could not be found, at epdm.interop.epdm.iedmfile5.unlockfile(int32 iparentwnd, string bscomment, int32 iedmunlockflags, object poedmrefcallback)
I am using 2023 SP5.0 PDM, MS VS 2022, Draftsight 2020. Any suggestions would be very helpful.
Thank you,
Hima.