How can I place a LOD assembly using iLogic?

duke
Enthusiast

How can I place a LOD assembly using iLogic?

duke
Enthusiast
Enthusiast

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?

0 Likes
Reply
417 Views
3 Replies
Replies (3)

j.haggenjos
Advocate
Advocate

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)

 

 

0 Likes

duke
Enthusiast
Enthusiast

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? 

0 Likes

WCrihfield
Mentor
Mentor

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 💡or you can Explore My CONTRIBUTIONS

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

 

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes