0 Replies Latest reply on Jun 14, 2016 3:53 PM by Edwin Chung

    edmFile.RenameEx causes eDrawings "<file> was not found" prompt

    Edwin Chung

      Does anyone have a suggestion how to resolve this issue?

       

      I've written (copied, mostly) an add-on for EPDM which generates a serial number and renames a file; however, whenever this is executed the user sees a prompt from eDrawings: "C:\<filename> was not found". Is there a better way to do this?

       

      (Code abbreviated. This is written in C#)

                                      //rename the file

                                      edmFile.RenameEx(poCmd.mlParentWnd, generatedSerialNumberValue + "." + fileExt, 0);

       

                                      //Update part number in the data card

                                      IEdmFolder5 edmCurrentFolder;

                                      var currentFile = _currentVault.GetFileFromPath(edmFile.GetLocalPath(edmFolder5.ID), out edmCurrentFolder);

                                      currentFile.LockFile(edmFolder5.ID, poCmd.mlParentWnd);

                                      IEdmEnumeratorVariable5 enumVariable = currentFile.GetEnumeratorVariable();

                                      enumVariable.SetVar("Part Number", "@", generatedSerialNumberValue);

                                      enumVariable.SetVar("Part Number", "Default", generatedSerialNumberValue);

                                      IEdmEnumeratorVariable8 enumVariable8 = (IEdmEnumeratorVariable8)enumVariable;

                                      enumVariable8.CloseFile(true);

                                      currentFile.UnlockFile(poCmd.mlParentWnd, "Auto-Update Part Number");