Yeah I came to a similar result yesterday after making this post. I was able to leave to dimension as a generic DimensionConstraint and just treat it differently depending on the type, after I checked it. The longest part was compiling my Case Lists in the Functions, here was my result:
Sub Main
Dim selectThis As HighlightSet = ThisApplication.ActiveDocument.CreateHighlightSet : selectThis.Color = ThisApplication.TransientObjects.CreateColor(255, 100, 100)
10 :
Dim dimension As DimensionConstraint = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kSketchDimConstraintFilter, "Select a sketch dimension")
If IsNothing(dimension) Then Exit Sub ' If nothing gets selected then we're done
Dim readableType As String = SelectCase(dimension.Type)
selectThis.AddMultipleItems(SelectObjects(readableType, dimension))
If MessageBox.Show("Type: " & readableType & vbCrLf & vbCrLf & _
"Parameter Name: " & dimension.Parameter.Name & " Is driven? " & dimension.Driven & vbCrLf & vbCrLf & _
"Exists in Sketch: " & dimension.Parent.Name & vbCrLf & vbCrLf & _
"Entities used to define are now highlighted on screen." & vbCrLf & vbCrLf & _
"Would you like to check information of another Dimension Constraint?", "Dimension Constraint Info:", MessageBoxButtons.YesNo) = vbYes Then selectThis.Clear : GoTo 10 Else selectThis.Clear
End Sub
Function SelectObjects(DimType As String, DimConstraint As DimensionConstraint) As ObjectCollection
Dim Result As ObjectCollection = ThisApplication.TransientObjects.CreateObjectCollection
Select Case DimType
Case "kArcLengthDimConstraintObject", "kArcLengthDimConstraintProxyObject", "kDiameterDimConstraintObject", "kDiameterDimConstraintProxyObject", _
"kEllipseRadiusDimConstraintObject", "kEllipseRadiusDimConstraintProxyObject", "kRadiusDimConstraintObject", "kRadiusDimConstraintProxyObject"
Result.Add(DimConstraint.Entity)
Case "kOffsetDimConstraintObject", "kOffsetDimConstraintProxyObject"
Result.Add(DimConstraint.Entity)
Result.Add(DimConstraint.Line)
Case "kOffsetSplineDimConstraintObject", "kOffsetSplineDimConstraintProxyObject"
Result.Add(DimConstraint.OffsetSpline)
Result.Add(DimConstraint.Spline)
Case "kTangentDistanceDimConstraintObject", "kTangentDistanceDimConstraintProxyObject"
Result.Add(DimConstraint.EntityOne)
Result.Add(DimConstraint.EntityTwo)
Case "kThreePointAngleDimConstraintObject", "kThreePointAngleDimConstraintProxyObject"
Result.Add(DimConstraint.PointOne)
Result.Add(DimConstraint.PointTwo)
Result.Add(DimConstraint.PointThree)
Case "kTwoLineAngleDimConstraintObject", "kTwoLineAngleDimConstraintProxyObject"
Result.Add(DimConstraint.LineOne)
Result.Add(DimConstraint.LineTwo)
Case "kTwoPointDistanceDimConstraintObject", "kTwoPointDistanceDimConstraintProxyObject"
Result.Add(DimConstraint.PointOne)
Result.Add(DimConstraint.PointTwo)
End Select
Return Result
End Function
Function SelectCase(check As Double) As String
'NOTES:
'Dimension Constraint Types: ArcLengthDimConstraint, DiameterDimConstraint, EllipseRadiusDimConstraint, OffsetDimConstraint, OffsetSplineDimConstraint, RadiusDimConstraint, TangentDistanceDimConstraint, ThreePointAngleDimConstraint, TwoLineAngleDimConstraint, TwoPointDistanceDimConstraint
'Dimension Constraint Types: 84014336 [84014448] , 83906560 [83906672] , 83924224 [83924336] , 83905536 [83905648], 83972608 [83972720] , 83906816 [83906928], 83907072 [83907184] , 83906304 [83906416] , 83906048 [83906160] , 83905792 [83905904]
' Actual [Proxy]
Result = "Type Not Found..."
Select Case check
Case 84014336
Result = "kArcLengthDimConstraintObject"
Case 84014448
Result = "kArcLengthDimConstraintProxyObject"
Case 83906560
Result = "kDiameterDimConstraintObject"
Case 83906672
Result = "kDiameterDimConstraintProxyObject"
Case 83924224
Result = "kEllipseRadiusDimConstraintObject"
Case 84014448
Result = "kEllipseRadiusDimConstraintProxyObject"
Case 83905536
Result = "kOffsetDimConstraintObject"
Case 83905648
Result = "kOffsetDimConstraintProxyObject"
Case 83972608
Result = "kOffsetSplineDimConstraintObject"
Case 83972720
Result = "kOffsetSplineDimConstraintProxyObject"
Case 83906816
Result = "kRadiusDimConstraintObject"
Case 83906928
Result = "kRadiusDimConstraintProxyObject"
Case 83907072
Result = "kTangentDistanceDimConstraintObject"
Case 83907184
Result = "kTangentDistanceDimConstraintProxyObject"
Case 83906304
Result = "kThreePointAngleDimConstraintObject"
Case 83906416
Result = "kThreePointAngleDimConstraintProxyObject"
Case 83906048
Result = "kTwoLineAngleDimConstraintObject"
Case 83906160
Result = "kTwoLineAngleDimConstraintProxyObject"
Case 83905792
Result = "kTwoPointDistanceDimConstraintObject"
Case 83905904
Result = "kTwoPointDistanceDimConstraintProxyObject"
End Select
Return Result
End Function
I think it's a useful troubleshooting tool especially for digging into old sketches or sketches done by someone else.