Inventor General

Reply
Distinguished Contributor
Posts: 109
Registered: ‎10-03-2008
Message 1 of 2 (126 Views)

ILOGIC edit part parameter

126 Views, 1 Replies
06-25-2013 02:22 PM

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.

 

Doable?

 

 

Employee
Posts: 106
Registered: ‎08-28-2007
Message 2 of 2 (106 Views)

Re: ILOGIC edit part parameter

06-26-2013 12:20 AM in reply to: cstringer80

Hi 

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
Inventor Professional 2014

Jingyi Liu
Quality Assurance Team
Autodesk

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Welcome to the new Autodesk Community!
If this is your first visit, click here to get started and make the most of the Community. Let us know what you think of the new experience in the Community Feedback Forum.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community


Inventor Exchange Apps

Created by the community for the community, Autodesk Exchange Apps for Autodesk Inventor helps you achieve greater speed, accuracy, and automation from concept to manufacturing.

Connect with Inventor

Twitter

Facebook

Blogs

Pinterest

Youtube