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: 

Control PositionalRepresentations and LevelOfDetail

1 REPLY 1
Reply
Message 1 of 2
GeorgK
247 Views, 1 Reply

Control PositionalRepresentations and LevelOfDetail

Hello together,

 

I am looking for a possibility to control the PositionalRepresentations and LevelOfDetail. If I choose number one (01_ text varies ) of the PositionalRepresentations the LevelOfDetail should switch to 01_XXXX.

 

I found a peace of could that switches but the names must be equal.

 

http://forums.autodesk.com/t5/Inventor-Customization/Control-Positional-Reps-With-ILogic/td-p/476918...

 

Is it possible to modify the code to do that?

 

Thank you very much

 

Georg

1 REPLY 1
Message 2 of 2
philippe.leefsma
in reply to: GeorgK

Hi Georg,

 

You could use the "RepresentationEvents.OnActivatePositionalRepresentation" to get notified when a positional rep is activated, based on that you could change the LOD from API:

 

LevelOfDetailRepresentation.Activate

 

Sub LoD()

    Dim doc As AssemblyDocument
    Set doc = ThisApplication.ActiveDocument
    
    Dim mng As RepresentationsManager
    Set mng = doc.ComponentDefinition.RepresentationsManager
    
    Dim LoDs As LevelOfDetailRepresentations
    Set LoDs = mng.LevelOfDetailRepresentations
    
    LoDs.item("MyLoD").activate
    
    doc.Rebuild
    
    ' Create a new level of detail.
    Dim oLODRep As LevelOfDetailRepresentation
    Set oLODRep = LoDs.Add("My LOD")
    
    ' Suppress an occurrence.
    doc.ComponentDefinition.Occurrences.item(1).Suppress
        
    ' Save the document, which is really saving the LOD.
    ThisApplication.ActiveDocument.Save

    ' Activate the master LOD.
    mng.LevelOfDetailRepresentations.item("Master").activate
    
End Sub

 Philippe.



Philippe Leefsma
Developer Technical Services
Autodesk Developer Network

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

Post to forums  

Autodesk Design & Make Report