Retrieve 3d pdf current export settings.

Retrieve 3d pdf current export settings.

jmacapagal2CD9H
Contributor Contributor
262 Views
3 Replies
Message 1 of 4

Retrieve 3d pdf current export settings.

jmacapagal2CD9H
Contributor
Contributor

Is there a way to retrieve the values from each setting 3d pdf export dialog using an API(VB/C#)?

jmacapagal2CD9H_0-1697532180833.png

 

0 Likes
263 Views
3 Replies
Replies (3)
Message 2 of 4

Andrii_Humeniuk
Advisor
Advisor

Hi @jmacapagal2CD9H . The link shows an example of exporting 3D PDF and configuring it.

An example of properties in VB.net:

    ' Create a NameValueMap object as Options
    Dim oOptions As NameValueMap
    Set oOptions = ThisApplication.TransientObjects.CreateNameValueMap
  
    ' Options
    oOptions.Value("FileOutputLocation") = "c:\temp\test.pdf"
    oOptions.Value("ExportAnnotations") = 1
    oOptions.Value("ExportWokFeatures") = 1
    oOptions.Value("GenerateAndAttachSTEPFile") = True
    oOptions.Value("VisualizationQuality") = kHigh
    
    ' Set the properties to export
    Dim sProps(0) As String
    sProps(0) = "{F29F85E0-4FF9-1068-AB91-08002B27B3D9}:Title"  ' Title
    
    oOptions.Value("ExportAllProperties") = False
    oOptions.Value("ExportProperties") = sProps
 
    ' Set the design views to export
    Dim sDesignViews(1) As String
    sDesignViews(0) = "Master"
    sDesignViews(1) = "View1"
    
    oOptions.Value("ExportDesignViewRepresentations") = sDesignViews

 

Andrii Humeniuk - CAD Coordinator, Autodesk Certified Instructor

LinkedIn | My free Inventor Addin | My Repositories

Did you find this reply helpful ? If so please use the Accept as Solution/Like.

EESignature

Message 3 of 4

WCrihfield
Mentor
Mentor

Hi guys.  In this situation we are actually using a regular ApplicationAddIn type object, instead of the usual TranslatorAddIn type object (derived from the ApplicationAddIn type), so the usual tactics for obtaining the available options from the normal methods will not work this time.  However, one thing we can do in this case to not only find out what all options are available, but also get their current values before making any changes, is the following process.  When we open the Add-ins dialog (Tools tab, Options panel, AddIns button), and select the "Applications" tab, then select the "Anark 3D PDF Publishing" add-in in the list, we can see the available information about it in the lower area of that dialog.  The important details here are that it is loaded automatically, so we will not need to 'activate' it by code, and the other important detail is the full file path of its DLL file. (C:\Program Files\Autodesk\Inventor 2024\Bin\AnarkCoreInventorAddIn.dll)  We can actually add a reference to that DLL file in our rule (using 'AddReference' & Imports lines in its Header) which will allow us direct access into the available API of that add-in.  Once we have that, then we access its Automation property (internally an AutomationInterface type object), we can see what all options are available, and what their current values are.  However, we still have to use the NameValueMap route (like in the sample/examples) to 'set' values to those options, because those properties of the add-in's Automation object are Constants (ReadOnly), instead of normal Read/Write properties.  Then, you could also use its Publish method (also similar to the sample) to make the output action happen.  However, when I created a quick iLogic rule to explore the current settings as mentioned above, the results it wrote out to the iLogic Log window seemed basically useless.  I did export a 3D PDF of an assembly manually just before that, instead of my code, so maybe it will only pick-up those settings if they have been done by code before.  I am not sure.  I may either be missing a step in the process, or the values of these Constants may be set to another seemingly identically named internal property directly.  Anyways, as you can see, there are a few more options available than what is shown in the Autodesk provided API sample code.

AddReference "C:\Program Files\Autodesk\Inventor 2024\Bin\AnarkCoreInventorAddIn.dll"
Imports oSource = AnarkCoreInventorAddIn
Sub Main
	Dim oDoc As Inventor.Document = ThisDoc.Document
	Dim o3D_PDF_AddIn As Inventor.ApplicationAddIn
	For Each oAppAddin As Inventor.ApplicationAddIn In ThisApplication.ApplicationAddIns
		'If oAppAddin.DisplayName = "Anark 3D PDF Publishing" Then
		If oAppAddin.ClassIdString = "{3EE52B28-D6E0-4EA4-8AA6-C2A266DEBB88}" Then
			o3D_PDF_AddIn = oAppAddin
			Exit For
		End If
	Next 'oAppAddin
	If o3D_PDF_AddIn Is Nothing Then Exit Sub
	Dim o3D_PDF_Converter As oSource.AutomationInterface = o3D_PDF_AddIn.Automation
'	Dim oOptions As NameValueMap = ThisApplication.TransientObjects.CreateNameValueMap
'	oOptions.Add("FileOutputLocation", "C:\Temp\Exported 3D PDF (from iLogic).pdf")
	Logger.Info(vbCrLf & _
	"AttachedFiles = " & oSource.AutomationInterface.AttachedFiles & vbCrLf & _
	"ExportAllProperties = " & oSource.AutomationInterface.ExportAllProperties & vbCrLf & _
	"ExportProperties = " & oSource.AutomationInterface.ExportProperties & vbCrLf & _
	"ExportDesignViewRepresentations = " & oSource.AutomationInterface.ExportDesignViewRepresentations & vbCrLf & _
	"LimitToEntitiesInDVRs = " & oSource.AutomationInterface.LimitToEntitiesInDVRs & vbCrLf & _
	"ExportTemplate = " & oSource.AutomationInterface.ExportTemplate & vbCrLf & _
	"FileOutputLocation = " & oSource.AutomationInterface.FileOutputLocation & vbCrLf & _
	"GenerateAndAttachSTEPFile = " & oSource.AutomationInterface.GenerateAndAttachSTEPFile & vbCrLf & _
	"StepApplicationProtocolType = " & oSource.AutomationInterface.StepApplicationProtocolType & vbCrLf & _
	"StepAuthor = " & oSource.AutomationInterface.StepAuthor & vbCrLf & _
	"StepAuthorization = " & oSource.AutomationInterface.StepAuthorization & vbCrLf & _
	"StepDescription = " & oSource.AutomationInterface.StepDescription & vbCrLf & _
	"StepExportFitTolerance = " & oSource.AutomationInterface.StepExportFitTolerance & vbCrLf & _
	"STEPFileOptions = " & oSource.AutomationInterface.STEPFileOptions & vbCrLf & _
	"StepIncludeSketches = " & oSource.AutomationInterface.StepIncludeSketches & vbCrLf & _
	"StepOrganization = " & oSource.AutomationInterface.StepOrganization & vbCrLf & _
	"ViewPDFWhenFinished = " & oSource.AutomationInterface.ViewPDFWhenFinished & vbCrLf & _
	"VisualizationQuality = " & oSource.AutomationInterface.VisualizationQuality)
	'o3D_PDF_Converter.Publish(oDoc, oOptions)
End Sub

 

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 4 of 4

jmacapagal2CD9H
Contributor
Contributor
Thank for the reply @WCrihfield. Sorry about my question, but what I would like to know is the current values for each settings. For example, I want to retrieve the current value of VisualizationQuality set on the 3d export dialog.
0 Likes