- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Community,
I have searched Help, Forums, and have asked Gemini to write ilogic code, but have been unsuccessful in creating an assembly constraint that uses an expression for the offset.
Here is the code I have tried:
Dim offsetExpression As String = "Return_Rail_Liner_Thickness * -1.0 ul"
oConstraintSub = oAsmCompDef.Constraints.AddFlushConstraint(oAsmCompDef.WorkPlanes("XY Plane"), oproxyPlaneAFLXY, Offset:=offsetExpression)
The error message is, "The parameter is incorrect."
I know the rest of the line is good because I was originally using an offset value of 0 and the constraint was created.
Within the iLogic Editor, I used the relationship capture tool. This was the result:
I thought it was bad practice to use parameters as shown in gold above.
I tried this - after creating the constraint with an offset of 0 (zero), I tried to edit the constraint:
oConstraintSub.Offset = offsetExpressionbut Inventor reports that the Offset is Read-Only.
Your assistance would be appreciated to create an assembly constraint using an expression for the offset.
If there is a reference or an example for this, I would welcome the link.
Thank you for your time and attention. I look forward to your replies.
Regards,
Jerry
CAD Administrator
Using Inventor 2022
Autodesk Certified Instructor
Autodesk Inventor 2020 Certified Professional
Autodesk AutoCAD 2017 Certified Professional
Solved! Go to Solution.