Message 1 of 8
iLogic dynamic Parameter update off?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Can anyone help me with this rule?
The rule iterates through an assembly looking for parameters. If it finds them it 'pushes' the value down from the top level Assembly into the sub-components.
It works well, but each component updates dynamically as the parameter value is changed. This looks a bit jerky and weird.
Is there any way to write the script so the the updates all happen at once at the end?
Thanks in advance for any help you can give,
Paul
' set a reference to the assembly component definintion. ' This assumes an assembly document is open. Dim oAsmCompDef As AssemblyComponentDefinition oAsmCompDef = ThisApplication.ActiveDocument.ComponentDefinition 'Iterate through all of the occurrences Dim oOccurrence As ComponentOccurrence For Each oOccurrence In oAsmCompDef.Occurrences 'check for and skip virtual components '(in case a virtual component trips things up) If Not TypeOf oOccurrence.Definition Is VirtualComponentDefinition Then Parameter.Quiet = True 'Match up the cabinet height If Parameter(oOccurrence.Name, "Cheight") Then Parameter(oOccurrence.Name, "Cheight") = Cheight End If 'Match up the cabinet width If Parameter(oOccurrence.Name, "Cwidth") Then Parameter(oOccurrence.Name, "Cwidth") = Cwidth End If 'match up the cabinet depth If Parameter(oOccurrence.Name, "Cdepth") Then Parameter(oOccurrence.Name, "Cdepth") = Cdepth End If 'Match up the Left panel thickness If Parameter(oOccurrence.Name, "CLthick") Then Parameter(oOccurrence.Name, "CLthick") = CLthick End If 'Match up the right panel thickness If Parameter(oOccurrence.Name, "CRthick") Then Parameter(oOccurrence.Name, "CRthick") = CRthick End If 'Match up the top panel thickness If Parameter(oOccurrence.Name, "CTthick") Then Parameter(oOccurrence.Name, "CTthick") = CTthick End If 'Match up the base panel thickness If Parameter(oOccurrence.Name, "CBthick") Then Parameter(oOccurrence.Name, "CBthick") = CBthick End If 'Match up the back panel thickness If Parameter(oOccurrence.Name, "CBKthick") Then Parameter(oOccurrence.Name, "CBKthick") = CBKthick End If 'Uodate the document to see the changes InventorVb.DocumentUpdate() Else End If Next
P.S.
Kudos to Curtis Waguespack for the code that got me started!
http://inventortrenches.blogspot.co.uk/2012/08/ilogic-virtual-components.html