Ref parameter from ipt to iam

Ref parameter from ipt to iam

SpokenEarth
Advocate Advocate
122 Views
1 Reply
Message 1 of 2

Ref parameter from ipt to iam

SpokenEarth
Advocate
Advocate

Hi forum, I have a part with a ref parameter and a code which allow me to toggle between int and ext diameter and I want to access it / make editable from iam.
Can someone help me?
I have enclosed files and the code, ver 2024

 

Dim oPDoc As PartDocument = ThisDoc.Document
Dim oPDef As PartComponentDefinition = oPDoc.ComponentDefinition
Dim oSketch As PlanarSketch = oPDef.Sketches.Item("STORAGE TANK BODY")
Dim oDims As DimensionConstraints = oSketch.DimensionConstraints
Dim oHeightDim As DimensionConstraint
Dim oAngleDim As DimensionConstraint
For Each oDim As DimensionConstraint In oDims
If oDim.Parameter.Name = "STORAGE_TANK_EXTERNAL_DIA" Then
oHeightDim = oDim
ElseIf oDim.Parameter.Name = "STORAGE_TANK_INTERNAL_DIA" Then
oAngleDim = oDim
End If
Next
If oHeightDim.Driven Then
	oAngleDim.Driven = True
	oHeightDim.Driven = False
Else
	oHeightDim.Driven = True
	oAngleDim.Driven = False
End If
0 Likes
123 Views
1 Reply
Reply (1)
Message 2 of 2

Ralf_Krieg
Advisor
Advisor

Hello

 

You can use a rule in your assembly which will run your rule in context of the skeleton part if executed. One line is enough to do the work, but it lacks of any kind of checks. If part name or rule name changes, it will fail.

iLogicVb.RunRule("SKELETON.ipt", "STORAGE TANK BODY TOGGLE DIA")

 


R. Krieg
RKW Solutions
www.rkw-solutions.com
0 Likes