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: 

How can I place a LOD assembly using iLogic?

3 REPLIES 3
Reply
Message 1 of 4
duke
403 Views, 3 Replies

How can I place a LOD assembly using iLogic?

I'd like to be able to indicate what LOD should be used when I place a component using iLogic. I have no troubles placing the component using iLogic, but I haven't figured out how to indicate the LOD in the placing process. I know this should be possible because when placing the component using the "Place Component" button one can use the "Options..." button to indicate what LOD should be used. How do I replicate this with iLogic? Is there an option that can be set or should the file name be altered in some way?

Labels (1)
3 REPLIES 3
Message 2 of 4
j.haggenjos
in reply to: duke

Hello,

 


When specifying the file path, add "<LODName>" at the end of the path. And use it as input when placing the component.

 

 

Dim filePath As String = /path/to/file.iam<LODName>

 

 

Alternatively, you can place the component in master LOD and change to the desired LOD. It is less optimal as this will load the whole assembly in the memory while selecting LOD first will load only the active component.

 

 

Occurrence.SetLevelOfDetailRepresentation(LODName)

 

 

Message 3 of 4
duke
in reply to: j.haggenjos

What you've written makes sense, but still doesn't seem to work for me and throws an error. The LOD I'm trying to initialize is called "Standard" but when I attempt to execute the code using a file path of the form "path\myComponent.iam<Standard>" it states that an illegal character (the < and >) is being used. Have I set this up incorrectly? 

Message 4 of 4
WCrihfield
in reply to: duke

Hi @duke .

Here is a link to the online help page or adding a component into an assembly, while specifying 'options'.

ComponentOccurrences.AddWithOptions Method 

Basically you would have to create a new NameValueMap object ahead of that Add line, then set the needed name/value pairs within it, then supply that NameValueMap to the end of the Add line as specified in this link.  Have you ever created or worked with a NameValueMap before?

 

If this solved your problem, or answered your question, please click ACCEPT SOLUTION.
Or, if this helped you, please click (LIKE or KUDOS) 👍.

If you have time, please... Vote For My IDEAS :light_bulb:or you can Explore My CONTRIBUTIONS

Inventor 2021 Help | Inventor Forum | Inventor Customization Forum | Inventor Ideas Forum

 

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

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

Post to forums  

Autodesk Design & Make Report