I have an assembly with sub assemblies and subassemblies below that. I use an .ipt with a bunch of custom user paramaters to drive all sorts of things. I'm trying to right an ilogic rule to place in the upper assembly that will pull a user paramater and map it to a custom iproperty of all the files in the assembly, including all lower assemblies and ipt's.
I found some code on here that works to change the assemblies but not any of the sub assemblies or ipts below.
' 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 occurrencesDim 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 'set part number for each componentiProperties.Value(oOccurrence.Name, "Custom", "TRUCK") = Parameter("MEDSKETCH:1", "TRUCK") & "" Else End If Next
I'm fairly new to ilogic and VBA and would appreciate any help!
Thanks.
Anthony
Have you considered using Design Assistant to help you change the value of an iProperty (or many) all at once?
-cwhetten
Please click "Accept as Solution" if this response answers your question.