Message 1 of 10
Creating PDF, Defered Updates drawing, Remove Line Weights option doesn't stick

Not applicable
12-13-2017
06:48 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello all,
I am creating a PDF from an Inventor .dwg with an iLogic code frankensteined from various sources.
I have some options, one of them being:
oOptions.Value("Remove_Line_Weights") = 1
This works when the dwg has Defered Updates OFF, but when the Defered Updates are ON, the line weight option doesn't do anything.
This is important because when printed, they look very different!
I'm sure it's because I have very little clue as to what I am doing, beyond my extreme Copy Jockey skills. Any ideas?
My full code below:
'check if file type is a drawing file If ThisDoc.Document.DocumentType <> kDrawingDocumentObject Then MessageBox.Show("This file is not a drawing file.", "iLogic") Else If ThisDoc.Document.DocumentType = kDrawingDocumentObject Then 'If there is a problem creating the PDF, it's probably because one is already open with the same name On Error Goto handlePDFLock 'sets the Approved Date in iProperties to NOW iProperties.Value("Status", "Eng. Approved Date" ) = Now 'sets the current time as a custom value iProperties.Value("Custom", "Time Saved") = Now.ToString("HH:mm:ss") 'sets the current date and time for filename saving Dim NowDateTime = Now.ToString("yyMMdd") & Now.ToString("HHmm") 'saves the current doc ThisDoc.Save 'get path of current file strPATH = ThisDoc.Path 'get file name strFNAME = ThisDoc.FileName(False) 'set Project and Description strProject = iProperties.Value("Custom", "Job") 'Save PDF with options PDFAddIn = 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 Dim oDrawing as DrawingDocument oDrawing = ThisDrawing.Document oOptions.Value("All_Color_AS_Black") = 1 oOptions.Value("Remove_Line_Weights") = 1 ' a 1 removes the line weights oOptions.Value("Vector_Resolution") = 4800 'If there Is an AutoCad Model Space included, then don't print it If oDrawing.Sheets.Item(1).Name = "Model (AutoCAD)" Then iBeginSheet = 2 Else iBeginSheet = 1 End If oOptions.Value("Sheet_Range") = Inventor.PrintRangeEnum.kPrintAllSheets oOptions.Value("Custom_Begin_Sheet") = iBeginSheet oOptions.Value("Custom_End_Sheet") = 999 'Set the destination file name oDataMedium.FileName = strPATH & "\" & strFNAME & " " & strProject & " " & NowDateTime &".pdf" 'Publish document. Call PDFAddIn.SaveCopyAs(oDocument, oContext, oOptions, oDataMedium) 'Open the PDF file that was just created. ThisDoc.Launch(oDataMedium.FileName) End If Exit Sub handlePDFLock: MessageBox.Show("PDF WAS NOT SAVED. Please close any open PDFs.", "No PDF for you")