Monday, March 28, 2022

iLogic: Select and Set Sketch Dimension Tolerances

 

Issue:
You want to to quickly select and set standard tolerances for your sketch dimensions.


Solution:
Here is a quick routine written for iLogic using the API to do this. This employs the CommandManager's Pick function to allow you to select individual dimensions and set the tolerance.

Thank you! to Ron Moore, for the question/post idea.


oMsg = "Select sketch dimensions to apply default tolerance (Press Esc to continue)"

While True

        Dim oDimension As DimensionConstraint

        oDimension = ThisApplication.CommandManager.Pick(

        SelectionFilterEnum.kSketchDimConstraintFilter, oMsg) 

        ' If nothing gets selected then we're done   

        If IsNothing(oDimension) Then Exit While 

        oDimension.Parameter.Tolerance.SetToSymmetric(0.05)

End While