
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all, I am new to iLogic having an issue getting my pdf creator to work. So far I have two, one that creates all drawing sheets in one pdf. This works great.
The other single drawing pdf creator works, but doesn't keep the correct part number.
Say I have an assembly drawing, A570abcd, and 11 more sheet drawings that are the parts, A510EFGH, A510IJKL etc. that make up the the entire assembly.
What I want to do with my code is create only A510EFGH and have the pdf named correctly. Currently it only names it A570abcd.
I want to know how to get my code to read the part number of the model on the active sheet.
Below is one of the many code iterations I've tried:
'------start of iLogic------- 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(oDataMedium, 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.kPrintCurrentsheet 'oOptions.Value("Custom_Begin_Sheet") = 2 'oOptions.Value("Custom_End_Sheet") = 4 End If 'get PDF target folder path oFolder = opath '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" 'Publish document oPDFAddIn.SaveCopyAs(oDocument, oContext, oOptions, oDataMedium) '------end of iLogic-------
I know the line - oDataMedium.FileName = oFolder & "\" & oFileName & ".pdf" - is the issue. I just can't figure out how to read the iProperties part number of the part on the drawing.
Thanks,
Van
Solved! Go to Solution.