- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am on the process of creating the assembly for a re-tractable belt feeder. One of functionality I need is to use an iLogic to switch view representations.
'PART 1: for Assembly view representations
'define current document
Dim openDoc As Document
openDoc = ThisDoc.Document
Dim oAsmCompDef As AssemblyComponentDefinition
'oAsmCompDef = openDoc.ComponentDefinition
oAsmCompDef = ThisApplication.ActiveDocument.ComponentDefinition
Dim oViewRep As DesignViewRepresentation
Dim oOccurrence As ComponentOccurrence
oViewRep = "Default"
oAsmCompDef.RepresentationsManager.DesignViewRepresentations.Item("oViewRep").activate
'PART 2: for View representations in the sub-assemblies
'Iterate through all Of the occurrences
For Each oOccurrence In oAsmCompDef.Occurrences
oAsmCompDef.RepresentationsManager.DesignViewRepresentations.Item("oViewRep").activate
Next
I spent a lot of time including got some help from Web. The idea was running once. Later I started to make it better (timmed down) - suddenly, everything messed up. Even, I lost the iLogic that I had doing well.
Main assembly and sub assemblies all have:
Default
Sketches_On
For_Constraining
view representations mostly. I need to switch as I need them.
Request providing code for achieving the similar results forLODs too. Will seek help if necessary.
Note: This is one of my home projects. I aim at getting iLogic skills by working from home after work. At work, I don.t use iLogic at all.
Autodesk Inventor 2015
Vault Basic 2015
Solved! Go to Solution.