- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I'm having issues with changing the Design view representation of a part within a sub assembly of a sub assembly.
Basically i want to mimic the behaviour of right click browser node -> "Representation...".
The code below runs with no error, yet the representation doesn't change.
Dim oDoc As AssemblyDocument = ThisDoc.Document Dim oCompDef As AssemblyComponentDefinition = oDoc.ComponentDefinition Dim oViewReps As DesignViewRepresentations = oCompDef.RepresentationsManager.DesignViewRepresentations Dim viewExists As Boolean = False For Each oRep As DesignViewRepresentation In oViewReps If oRep.Name = "NoGD" Then viewExists = True Exit For End If Next If viewExists = False Then Dim NoGDRep As DesignViewRepresentation = oViewReps.Add("NoGD") NoGDRep.Activate Dim oOcc As ComponentOccurrence For i = 1 To QtyRuns For j = 1 To Parameter("Run_" & i, "StepQty") Try oOcc = oCompDef.Occurrences.ItemByName("Run_" & i).Definition.Occurrences.ItemByName("StairStep_" & j).Definition.Occurrences.ItemByName("StepPlate") oOcc.SetDesignViewRepresentation("NoGD") MsgBox("Run_" & i & ".StairStep_" & j & " Works) Catch MsgBox("Run_" & i & ".StairStep_" & j & " Doesn't work") End Try Next Next NoGDRep.Locked = True oViewReps.Item("Default").Activate iLogicVb.UpdateWhenDone = True End If
From what i've read there seems to be a problem with this functionallity through API/iLogic for components on levels below first level.
There is a workaround presented in this thread:
https://forums.autodesk.com/t5/inventor-customization/design-view-representation-issue/td-p/7502910
But unfortunately this is not an option for me.
Does anybody here have a solution for the problem?
Thanks in advance,
Jhoel
Jhoel Forshav Download my free Inventor Addin - Hole Projector
LinkedIn | Ideas | Contributions | Blog posts | Website
Solved! Go to Solution.