Message 1 of 4

Not applicable
10-11-2016
04:16 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello All,
I have an iLogic program that saves part drawings as a PDF in a specific location. I needed to edit the program to save the PDF documents without object line weights, rather than having to manually export as a pdf and select that from the options menu. I was reading through the iLogic API and found the recommend code, but I can't seem to get it to work (regardless of whether I assign the number "0" or "1" to the "oOptions.Value("Remove_Line_Weights")" line of code).
Does anyone know how to make this work?
I've included the code here:
Thanks!
SyntaxEditor Code Snippet
' Get the PDF translator Add-In. Dim PDFAddIn As TranslatorAddIn PDFAddIn = ThisApplication.ApplicationAddIns.ItemById("{0AC6FD96-2F4D-42CE-8BE0-8AEA580399E4}") 'Set a reference to the active document (the document to be published). Dim oDocument As Document oDocument = ThisApplication.ActiveDocument Dim oContext As TranslationContext oContext = ThisApplication.TransientObjects.CreateTranslationContext oContext.Type = kFileBrowseIOMechanism ' Create a NameValueMap object Dim oOptions As NameValueMap oOptions = ThisApplication.TransientObjects.CreateNameValueMap ' Create a DataMedium object Dim oDataMedium As DataMedium oDataMedium = ThisApplication.TransientObjects.CreateDataMedium ' Check whether the translator has 'SaveCopyAs' options If PDFAddIn.HasSaveCopyAsOptions(oDocument, oContext, oOptions) Then ' Options for drawings... oOptions.Value("Remove_Line_Weights") = 0 oOptions.Value("Vector_Resolution") = 400 'oOptions.Value("Sheet_Range") = kPrintAllSheets 'oOptions.Value("Custom_Begin_Sheet") = 2 'oOptions.Value("Custom_End_Sheet") = 4 End If EPN = iProperties.Value("Project", "Part Number") If(Not System.IO.Directory.Exists("G:\PUBLIC\EPNFOLDERS\" & EPN)) Then System.IO.Directory.CreateDirectory("G:\PUBLIC\EPNFOLDERS\" & EPN) End If 'Saves the PDF in the desired location ThisDoc.Document.SaveAs("G:\PUBLIC\EPNFOLDERS\" & EPN & "\" & EPN & " PRINT.pdf" , True)
Solved! Go to Solution.