Export 3D PDF with multiple/all design views?

Export 3D PDF with multiple/all design views?

claudio.ibarra
Advocate Advocate
1,002 Views
3 Replies
Message 1 of 4

Export 3D PDF with multiple/all design views?

claudio.ibarra
Advocate
Advocate

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

 

0 Likes
Accepted solutions (1)
1,003 Views
3 Replies
Replies (3)
Message 2 of 4

KKizildemir
Collaborator
Collaborator
Accepted solution

Hi @claudio.ibarra 

 

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,

 

Signature

website
emailskypelinkedinyoutubeemail
Message 3 of 4

claudio.ibarra
Advocate
Advocate

Thank you very much! That worked perfectly.

0 Likes
Message 4 of 4

KKizildemir
Collaborator
Collaborator

You're welcome! Have a nice day!

Signature

website
emailskypelinkedinyoutubeemail