
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have a code that creates a Point and Plane Distance constraint. It also creates a user parameter. I'm looking for a way to assign that parameter to the dimension I just created.
SyntaxEditor Code Snippet
oParameter = oMyParameter.AddByValue("X1H_1", 10, UnitsTypeEnum.kMillimeterLengthUnits) pointArray = points.Add(tg.CreatePoint(Parameter("X1H_1"), 20, 30)) DimCon = sketch1.DimensionConstraints3D.AddPointAndPlaneDistance(pointArray, oCompdef.WorkPlanes.Item(1))
The above code will create the parameter, create the point based off that parameter, and create the constraint, but in the model when you click on the dimension it is controlled by a model parameter, not the user parameter. If I update the user parameter in another code the model will not be updated because of this.
Is there a way to assign a user parameter to a dimension like you can through the UI by typing the user parameter name into the edit dimension text box?
I'm currently attempting to set the model parameter's equation to the user parameter since that's what happens when you do it manually but I'm not having any luck.
modelparameter.Equation = userparameter doesn't work and
modelparameter.Value = userparameter only changes the value.
modelparameter.Expression = userparameter does the same thing as .Value
Thanks for any help.
Solved! Go to Solution.