DimAngle, length instead of angle?


I remember someone had a script which replaced the angle with the arc’s length.
Can’t find it anymore…

Mitch, wasn’t it you who has this script?
If so, could you post it please?


I recall something like this floating around, but no, it’s not me that has this script, sorry…

Now we have a script, based on a similar one from Pascal:

sub DimArcLen()

Dim arrObjects, strObject, dblLength, oDim, strLength


Rhino.Command "_DimAngle"
If rhino.LastCommandResult <> 0 Then Exit Sub

arrObjects = Rhino.PrevSelectedObjects
Rhino.UnselectObjects arrObjects
strObject = arrObjects(0)

If Rhino.IsCurve(strObject) Then
dblLength = Rhino.CurveLength(strObject)
End If

oDim = Rhino.LastCreatedObjects()(0)
If Not Rhino.IsAngularDimension(oDim) Then Exit Sub

strLength = "L="
strLength = strLength & formatnumber(dblLength, 2)
strLength = strLength & “mm”

Rhino.DimensionUserText oDim, strLength

end sub