Cancel
Showing results for 
Search instead for 
Did you mean: 

Find the expression associated with a dimension

Creator
Creator

How do I get the expression that is associated with a sketch dimension? I can get a SketchConstraint array using getAllConstraintsOfType(...), and I can get all of the Expressions with getAllExpressions(), but I cant find a way to map the expressions to their associated dimensions.

2 REPLIES 2

Re: Find the expression associated with a dimension

Gears Esteemed Contributor Gears Esteemed Contributor
Gears Esteemed Contributor

Once you have a reference to a SketchDimensionalConstraint object, you can use its properties to get the .AssociatedDimension and .AssociatedExpression.

Re: Find the expression associated with a dimension

Creator
Creator

That worked!  The trick was to cast it as a SketchDimensionalConstraint, because as a SketchConstraint, I didn't have those options.  Thanks.