PDF Save not the drawing and instead is something else that is open alongside document

PDF Save not the drawing and instead is something else that is open alongside document

PumaBH
Contributor Contributor
508 Views
3 Replies
Message 1 of 4

PDF Save not the drawing and instead is something else that is open alongside document

PumaBH
Contributor
Contributor

Hello All, 

 

When i create manufacturing drawings i have it so the .idw drawing is auto saved as a .pdf as well. 

i do this for all my drawings and on occasions the drawing that was auto saved would sometimes be incorrect.

 

For example the drawing will save as a .pdf under the correct file name but the contents of this file will be something else that was open at the time of the save. often another drawing or part model in a random view orientation. 

 

i believe this is some type of bug or a PC issue as it is not a regular occurrence and would happen once in every 20 or so drawings. probably when i have more than 10 different file types open in inventor it will confuse itself during operation. 

 

i have windows 10, 16GB RAM, 1TB SSD, intel i5 processor. Nvidia 2GB graphics card(not the best but i have no issues running the software apart from the PDF issue above).

 

Cheers, 

 

Ben 

0 Likes
Accepted solutions (1)
509 Views
3 Replies
Replies (3)
Message 2 of 4

James_Willo
Alumni
Alumni

Automatically saving to PDF sounds like iLogic automation (unless this is Vault?)

Please post your code in the iLogic forum and someone can have a look. It is probably an issue with the code that tells Inventor which document reference to create the pdf from. 

 

 



James W
Inventor UX Designer
0 Likes
Message 3 of 4

PumaBH
Contributor
Contributor

There is an iLogic rule to publish a PDF on my drawing templates as follows: 

 

oPath = ThisDoc.Path
oFileName = ThisDoc.FileName(False) 'without extension
oRevNum = iProperties.Value("project", "revision number")
oPDFAddIn = ThisApplication.ApplicationAddIns.ItemById _
("{0AC6FD96-2F4D-42CE-8BE0-8AEA580399E4}")
oDocument = ThisApplication.ActiveDocument
oContext = ThisApplication.TransientObjects.CreateTranslationContext
oContext.Type = IOMechanismEnum.kFileBrowseIOMechanism
oOptions = ThisApplication.TransientObjects.CreateNameValueMap
oDataMedium = ThisApplication.TransientObjects.CreateDataMedium 


If oPDFAddIn.HasSaveCopyAsOptions(oDocument, oContext, oOptions) Then
oOptions.Value("All_Color_AS_Black") = 0
oOptions.Value("Remove_Line_Weights") = 1
oOptions.Value("Vector_Resolution") = 400
oOptions.Value("Sheet_Range") = Inventor.PrintRangeEnum.kPrintAllSheets
'oOptions.Value("Custom_Begin_Sheet") = 2'oOptions.Value("Custom_End_Sheet") = 4
End If 


'get PDF target folder path
oFolder = ThisDoc.Path & "\pdf" 'instead of "k:\dwg\pdf\"

'Check for the PDF folder and create it if it does not exist
If Not System.IO.Directory.Exists(oFolder) Then
    System.IO.Directory.CreateDirectory(oFolder)
End If


 'Set the PDF target file name
oDataMedium.FileName = oFolder & "\" & oFileName & ".pdf" 
'_" rev" & oRevNum & ".pdf" 


'Publish document
oPDFAddIn.SaveCopyAs(oDocument, oContext, oOptions, oDataMedium) 
'------end of iLogic-------

Cheers, 

 

Ben  

0 Likes
Message 4 of 4

James_Willo
Alumni
Alumni
Accepted solution

Thanks, you'll get better responses in the iLogic forum. 

https://forums.autodesk.com/t5/inventor-programming-ilogic/bd-p/120

 

 



James W
Inventor UX Designer
0 Likes