- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I am relatively new to iLogic and am struggling with controlling view reps at assembly and at component level using iLogic rules in the assembly level document. I have searched the forum and API help and haven't quite found what I'm looking for. Hoping someone can shed some light on this for me...
Design intent:
Configure various view reps at assembly level to show a group of components in a steel crane girder that have specific component level view reps that are setup to show different states of fabrication. In this case one of the groups is a line of steel plates spliced together that forms the bottom flange of the girder. There are other rules that set the length, suppression and constraints of the plates. In the assembly level view rep, all of the individual bottom flange components must be in their default (fabricated) view rep, except the last component which needs to be in its "MATERIAL ORDER" view rep that shows the other side of a split used to hide/show the trim length allowed for in the component.
I have tried a simple piece of code to trial the view rep based on one configuration only, but it kicks out the error: Object variable or With block variable not set.
Below is the code I tried. Anyone able to see why I'm getting the error above?
' ********************
Dim oAsmCompDef As AssemblyComponentDefinition oAsmCompDef = ThisApplication.ActiveDocument.ComponentDefinition Dim oOcc As ComponentOccurrence 'Activate a writeable View Rep (master view rep is not writeable) oAsmCompDef.RepresentationsManager.DesignViewRepresentations.Item("BOTTOM FLANGE").Activate ' Set component View Rep oOcc.ItemByName("FLANGE_BOTTOM_#3:1").SetDesignViewRepresentation("Default",,) oOcc.ItemByName("FLANGE_BOTTOM_#4:1").SetDesignViewRepresentation("Default", , ) oOcc.ItemByName("FLANGE_BOTTOM_#5:1").SetDesignViewRepresentation("MATERIAL ORDER",,) ' ********************
Solved! Go to Solution.