Both of the example 3D PDF ilogic rules I can find have a similar bit of code where they only use one design view.
' Export Current design view Dim sDesignViews(0) As String sDesignViews(0) = oDocument.ComponentDefinition.RepresentationsManager.ActiveDesignViewRepresentation.Name oOptions.Value("ExportDesignViewRepresentations") = sDesignViews
and
' Set the design view(s) to export - note here I am exporting only the active design view (view representation) Dim sDesignViews(0) As String sDesignViews(0) = oDocument.ComponentDefinition.RepresentationsManager.ActiveDesignViewRepresentation.Name oOptions.Value("ExportDesignViewRepresentations") = sDesignViews
What would the code look like if I want the 3D PDF to show all the design views and not just the current one?
Is it possible to show the user a list and have them check off the ones they want to include?
The sample code in the API help gives me an answer if I already know how many views there are and what the views are called, but is it possible to do this in a generic way that captures all the views regardless of how many there are or their names?
' Set the design views to export
Dim sDesignViews(1) As String
sDesignViews(0) = "Master"
sDesignViews(1) = "View1"
oOptions.Value("ExportDesignViewRepresentations") = sDesignViews
Solved! Go to Solution.
Solved by KKizildemir. Go to Solution.
Please change this piece of code with that:
' the design views to export Dim oCompDef As Inventor.ComponentDefinition = oDocument.ComponentDefinition Dim p, q, r As Integer q = oCompDef.RepresentationsManager.DesignViewRepresentations.Count Dim sDesignViews(q) As String For p = 1 To q r = p-1 sDesignViews(r) = oCompDef.RepresentationsManager.DesignViewRepresentations.Item(p).Name Next oOptions.Value("ExportDesignViewRepresentations") = sDesignViews
I hope this will help you.
Regards,
Can't find what you're looking for? Ask the community or share your knowledge.