Is it possible with iLogic code to set a parameter in a bunch of parts equal to another paramter?
I want some iLogic code that will go into my pipe parts and make the PL param = D2.
You can try below code to your assembly file, it will check occurrences in your assembly and modify the value of PL and make it equal to D2.
I saw your previous post on Pipe Length, please notice some type of Pipe, like thread pipe, its default length parameter refer to D3 other than D2.
' 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 Parameter.Quiet = True Parameter(oOccurrence.Name, "PL") = Parameter(oOccurrence.Name, "d2") InventorVb.DocumentUpdate() Else End If Next
Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register