AnsweredAssumed Answered

Save as PDF but don't change the drawing

Question asked by Ben Nemec on Feb 28, 2020
Latest reply on Mar 6, 2020 by Ben Nemec

I'm a bit reluctant and sorry for posting yet another 'how to save pdf from drawing in API' question. 


First I'll try to concisely state what I'm trying to do.

  • using PDM Pro (EPDM), task is to run on an unattended machine.  
  • not checking out the slddrw
  • not getting all referenced file(s)
  • not changing slddrw
  • print slddrw exactly as it was last saved/checked in.
  • we're running 2019 SP4.0


What I'm doing:

//not using edm api calls to get any files other than the drawing.  Calling the GetFileCopy in the block that calls my pdf function:


file.GetFileCopy(poCmd.mlParentWnd, "");

OpenDoc6(sourcePath, (int)swDocumentTypes_e.swDocDRAWING,
openOptions, "", ref errors, ref warnings);

swModExt = (ModelDocExtension)swModel.Extension;

status = swModExt.SaveAs(destPath, (int)swSaveAsVersion_e.swSaveAsCurrentVersion, (int)swSaveAsOptions_e.swSaveAsOptions_Silent, null, ref errors, ref warnings);

That was working fine except fairly often it would produce pdf with where the views were empty except for crossed line through it, some annotations and the background sheet were there.  


That was solved by adding swOpenDocOptions_e.swOpenDocOptions_RapidDraft to my openOptions.

With that I lost balloons for the BOM Table and one of the $PRPSHEET texts in the title block (sheet format), but other variables were fine.


I've been searching for how to just save a pdf of a drawing without updating it or changing it in any way.  My thought is that at task that produces a pdf should not change the document.  If the document is changing that's a different operation.  The pdf should look the same as the drawing did the last time it was checked in.


However, since all the questions I'm finding about it are how to get the drawing to update before saving a pdf I'm starting to question myself.  Am I wrong it wanting a "save as pdf" task to do just that and nothing more?


Our other CAD system that coexists in the Vault does fine in all the cases.  Example if the print is of an assembly and the task machine doesn't have a local copy of some subparts, no problem pdf is good.  If the task machine has a local copy but it's older than what was in the assembly when the print was saved, no problem, the pdf is still matches the print. 



I'm new to PDM and SW to still trying to get some of these things clear in my head.


Thank you.


Edited: I learned how post code in the "syntax highlighter"  seeing code inline is like nails on chalkboard for me.