Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Export 3D PDF with multiple/all design views?

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
claudio.ibarra
781 Views, 3 Replies

Export 3D PDF with multiple/all design views?

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

 

3 REPLIES 3
Message 2 of 4

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

Thank you very much! That worked perfectly.

Message 4 of 4

You're welcome! Have a nice day!

Signature

website
emailskypelinkedinyoutubeemail

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators


Autodesk Design & Make Report