Inventor General Discussion

Inventor General Discussion

Reply
New Member
ageezee
Posts: 1
Registered: ‎08-11-2008
Message 1 of 2 (232 Views)

iLogic help with changing iproperties in all open files and assemblies

232 Views, 1 Replies
01-15-2013 11:33 AM

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

 

 

 

 
*Expert Elite*
cwhetten
Posts: 1,090
Registered: ‎09-03-2008
Message 2 of 2 (211 Views)

Re: iLogic help with changing iproperties in all open files and assemblies

01-15-2013 03:06 PM in reply to: ageezee

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.

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.