DimAngle, length instead of angle?


#1

Hi,

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?

Thanks,
-C-H-A-R-L-E-S-


#2

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


#3

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

sub DimArcLen()

Dim arrObjects, strObject, dblLength, oDim, strLength

SetLocale(“en-us”)

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