Ilogic rules push and pull derived parts

Ilogic rules push and pull derived parts

Anonymous
Not applicable
734 Views
5 Replies
Message 1 of 6

Ilogic rules push and pull derived parts

Anonymous
Not applicable

Hi guys

 

Sorry if I describe this wrong. Im very new to ilogic but im pretty good with Inventor. 

 

Ive got 2 ipt files. The first has user parameters driving some sweeps and revolves. We’ll call it drill flute ipt. I have another ipt that is the drill body. The drill body derives in the drill flute ipts parameters and geometry to then subtract material. In my drill body ipt i have all the ilogic code and i can see the linked parameters showing up through the ilogic window. The problem is i want to write a rule that changes one of the parameters of the drill flute ipt. Basically i want my rule to do some math, update the drill flute ipt with the parameter updates, then update my drill body again so the geometry updates.

The problem im having is that none of my if then statements are updating the drill flute ipts parameters and obviously not updating the drill body thereafter. 

 

Any thought on how to push and pull parameters between two derives ipts files?

 

Rob

0 Likes
Accepted solutions (1)
735 Views
5 Replies
Replies (5)
Message 2 of 6

chandra.shekar.g
Autodesk Support
Autodesk Support

@Anonymous,

 

Can you please provide non confidential model data to test the feasibility?

 

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



0 Likes
Message 3 of 6

Anonymous
Not applicable

Hi Chandra,

 

I've attached a simplified example.  The rule in the drill body.ipt. I would like to have Linked Parameter l3Helix change based on a change in BodyLength.

 

Thanks,

Rob

 

 

If BodyLength <= 100 Then

l3Helix = BodyLength - 20

 

ElseIf BodyLength > 100 Then
 l3Helix = BodyLength - 10
 
End If

 

 

 

0 Likes
Message 4 of 6

chandra.shekar.g
Autodesk Support
Autodesk Support

@Anonymous,

 

Try below iLogic code to change parameter value of derived parameter.

Dim oDoc As PartDocument
oDoc = ThisApplication.ActiveDocument 

Dim oReferDoc As Document
oReferDoc = oDoc.ReferencedDocuments.Item(1)

Dim oReferDef As ComponentDefinition
oReferDef = oReferDoc.ComponentDefinition

Dim oReferParam As Parameter
oReferParam = oReferDef.Parameters.UserParameters.Item(7)

Dim oValue As Double

If BodyLength <= 100 Then
    oValue = BodyLength  - 20 
ElseIf BodyLength > 100 Then
    oValue = BodyLength - 10 
End If

oReferParam.Expression = oValue & " mm"
Call oReferDoc.Update
Call oDoc.Update

 

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



0 Likes
Message 5 of 6

Anonymous
Not applicable

Chandra,

 

It is working well now. Thank you very much for the help!

 

Best Regards,

Rob

0 Likes
Message 6 of 6

chandra.shekar.g
Autodesk Support
Autodesk Support
Accepted solution

@Anonymous & @Anonymous,

 

If the solution is working, click on "Accept solution" button.

 

Thanks and regards,


CHANDRA SHEKAR G
Developer Advocate
Autodesk Developer Network



0 Likes