Macro for Curve length

Looking for a macro that will show the curves length. Including multiples, combined/grouped.

Normally you would go to Properties docker and click the 5th button, Curve and that would
display the curves length. Too many extra steps.

I managed to get the Edit Scale & Nudge dropdown in my right-click routine for
on the fly action and works like a charm

Thinking of doing the same where I right-click and within the list it will display it. See above.

Any takers?
Thx

Parents
No Data
Reply
  • You could try this.

    The curve length is displayed as a text on the page, just above the curve you select.

    Sub Curve_Length()
    Dim sh As Shape, s As Shape
    Dim mX#, mY#, crvLen#

    If ActiveShape Is Nothing Then Exit Sub

    Set s = ActiveShape

    If s.Type <> cdrCurveShape Then s.ConvertToCurves

    crvLen = s.Curve.Length
    crvLen = Round(ActiveDocument.FromUnits(crvLen, ActiveDocument.Rulers.HUnits), 2)

    'Display Curve length on the page
    mX = s.PositionX
    mY = s.PositionY
    Set sh = ActiveLayer.CreateArtisticText(mX + 0.25, mY + 0.25, crvLen, Size:=12) ' Size is Fontsize


    End Sub

Children