- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
First let me say that I am a complete novice when it comes to iLogic coding or coding in general. I have been extremely lucky to be able to find code snippets on the web that I have been able to edit to suite my needs. However; I have a piece of code that I don’t understand how to modify and I was hoping someone could lead me in the right direction.
I would like to be able to define the following export to PDF options defined by Curtis Waguespack in the code by Luke Davenport on Cadline Community:
PDF Options:
Format:HTML Format Version:1.0 StartHTML: 165 EndHTML: 3731 StartFragment: 314 EndFragment: 3699 StartSelection: 314 EndSelection: 314SyntaxEditor Code Snippet
oOptions.Value("All_Color_AS_Black") = 1 oOptions.Value("Remove_Line_Weights") = 1 oOptions.Value("Vector_Resolution") = 400 oOptions.Value("Sheet_Range") = Inventor.PrintRangeEnum.kPrintAllSheets oOptions.Value("Sheet_Range") = Inventor.PrintRangeEnum.kPrintAllSheets
Export Code:
Format:HTML Format Version:1.0 StartHTML: 165 EndHTML: 15604 StartFragment: 314 EndFragment: 15572 StartSelection: 314 EndSelection: 314SyntaxEditor Code Snippet
' This is an example iLogic rule by Luke Davenport on Cadline Community' It creates a 'folder browser dialog' to allow user to pick a directory location' This selected directory location is then used for a generic PDF export operation' Please modify to suit your requirements.... Imports System.Windows.Forms ' Get current location of this file Dim ExportPath As String = ThisDoc.Path ' Check that this file has been saved and actually exists on disk If String.IsNullOrEmpty(ExportPath) Then MsgBox("This file has not yet been saved and doesn't exist on disk! - please save it first",64, "Formsprag iLogic") Return End If ' Define folder browse dialog Dim Dialog = New FolderBrowserDialog() ' Set options for folder browser dialog Dialog.SelectedPath = ExportPath Dialog.ShowNewFolderButton = True Dialog.Description = "Choose Folder for Export..." ' Show dialog box If DialogResult.OK = Dialog.ShowDialog() Then ' User clicked 'ok' on dialog box - capture the export path ExportPath = Dialog.SelectedPath & "\" Else ' User clicked 'cancel' on dialog box - exit Return End If oFileName = iProperties.Value("Custom", "Sales Order Number") ' Define the filename of the file to be exported - in this case it is a PDF file extension ExportFilename = oFileName & ".pdf" ' Do export operation (using save as) Try ThisDoc.Document.SaveAs(ExportPath & ExportFilename, True) Catch MsgBox("File export failed...", 64, "Formsprag iLogic") End Try ' Ask user if they want to open (launch) the file we just exported... If MsgBox("File exported: " & _ ExportPath & ExportFilename & vbLf & vbLf & _ "Do you want to open the PDF Now?", 36, "Formsprag iLogic - File Exported") = 6 Then ' User says yes...launch exported file ThisDoc.Launch(ExportPath & ExportFilename) End If
Thanks in advance
Solved! Go to Solution.