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: 

Problem in Activating Level of Detail

1 REPLY 1
Reply
Message 1 of 2
Anonymous
299 Views, 1 Reply

Problem in Activating Level of Detail

Please abserve below 2 line of code. It runs very fine when document is visible. But if I make assembly document in invisible mode or inventor in invisible mode, I am getting an exception. See attached image. Any reason? It is very important for me to run program in invisible mode.
1)AsmCompDef.RepresentationsManager.LevelOfDetailRepresentations[2] .Activate(false); //Activates LOD "All Components Suppressed" At this point inventor gives exception

2) oLevelDetailRep = oAsmCompDef.RepresentationsManager.LevelOfDetailRepresentations.Add(newLodName);
1 REPLY 1
Message 2 of 2
Anonymous
in reply to: Anonymous

Yes, there does seem to be a problem with activating LODs in a hidden
document. Thanks for reporting this - I'll file it in our database.

As a workaround, you can open a new document with the desired LOD:

Sub OpenLOD()

Dim oDocOpenOptions As NameValueMap
Set oDocOpenOptions =
ThisApplication.TransientObjects.CreateNameValueMap

' Set the representations to use when opening the document.
Call oDocOpenOptions.Add("LevelOfDetailRepresentation", "All Components
Suppressed")

Dim oDoc As AssemblyDocument
Set oDoc =
ThisApplication.Documents.OpenWithOptions("C:\temp\Assembly1.iam",
oDocOpenOptions, False)

End Sub

Sanjay-

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

Post to forums  

Autodesk Design & Make Report