1 Reply Latest reply on Jun 24, 2014 7:12 PM by Artem Taturevych

    API no return for the actual Save() method

    John Laslavic

      API do not return for the actual Save() method



      This is using the SWDocManager API and unfortunately there is no return for the actual Save() method, so you can’t tell if it was successful or not.   No exceptions are thrown if failed.


      The only way I could do it was deleting the original file and doing a swDoc.SaveAs() instead.  I could not reproduce the failed Save() on new PLMWorx files.  Not sure if this helps….



      File.SetAttributes(sDocFileName, FileAttributes.Normal);


      swDoc = (SwDMDocument15)swDocMgr.GetDocument(sDocFileName, nDocType, true, out nRetVal);


      retValTemp = swDoc.AddCustomProperty("PLM_ItemNumber", SwDmCustomInfoType.swDmCustomInfoText, PLM_ItemNumber);

      retValTemp = swDoc.AddCustomProperty("PLM_ItemMajorRevision", SwDmCustomInfoType.swDmCustomInfoText, PLM_ItemMajorRevision);

      retValTemp = swDoc.AddCustomProperty("PLM_ItemMinorRevision", SwDmCustomInfoType.swDmCustomInfoText, PLM_ItemMinorRevision);