<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: how to find the length of curve in vba? in VBA Forum</title>
    <link>https://forums.autodesk.com/t5/vba-forum/how-to-find-the-length-of-curve-in-vba/m-p/4365818#M11039</link>
    <description>&lt;P&gt;Try this solution, load lisp code to your acaddoc.lsp,&lt;/P&gt;&lt;P&gt;then try attached .bas file, see for more how to add&lt;/P&gt;&lt;P&gt;lisp routine to your acaddoc.lsp&lt;/P&gt;</description>
    <pubDate>Wed, 14 Aug 2013 09:27:23 GMT</pubDate>
    <dc:creator>Hallex</dc:creator>
    <dc:date>2013-08-14T09:27:23Z</dc:date>
    <item>
      <title>how to find the length of curve in vba?</title>
      <link>https://forums.autodesk.com/t5/vba-forum/how-to-find-the-length-of-curve-in-vba/m-p/4358091#M11037</link>
      <description>&lt;P&gt;&lt;IMG border="0" align="center" alt="Capture.PNG" title="Capture.PNG" src="https://forums.autodesk.com/t5/image/serverpage/image-id/57757i9131E2245DA5E1B9/image-size/original?v=mpbl-1&amp;amp;px=-1" /&gt;Hi , I am try to create a function that compute the length of a line such as the picture shows on top.&lt;/P&gt;&lt;P&gt;The code I have now only getting&amp;nbsp;the straight line distance. It's there a way to compute the curve distance?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2013 21:01:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/how-to-find-the-length-of-curve-in-vba/m-p/4358091#M11037</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-08-07T21:01:22Z</dc:date>
    </item>
    <item>
      <title>Re: how to find the length of curve in vba?</title>
      <link>https://forums.autodesk.com/t5/vba-forum/how-to-find-the-length-of-curve-in-vba/m-p/4365818#M11039</link>
      <description>&lt;P&gt;Try this solution, load lisp code to your acaddoc.lsp,&lt;/P&gt;&lt;P&gt;then try attached .bas file, see for more how to add&lt;/P&gt;&lt;P&gt;lisp routine to your acaddoc.lsp&lt;/P&gt;</description>
      <pubDate>Wed, 14 Aug 2013 09:27:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/how-to-find-the-length-of-curve-in-vba/m-p/4365818#M11039</guid>
      <dc:creator>Hallex</dc:creator>
      <dc:date>2013-08-14T09:27:23Z</dc:date>
    </item>
    <item>
      <title>Re: how to find the length of curve in vba?</title>
      <link>https://forums.autodesk.com/t5/vba-forum/how-to-find-the-length-of-curve-in-vba/m-p/4430643#M11040</link>
      <description>thanks for reply, I will try see if it work.&lt;BR /&gt;</description>
      <pubDate>Mon, 16 Sep 2013 21:32:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/how-to-find-the-length-of-curve-in-vba/m-p/4430643#M11040</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-09-16T21:32:02Z</dc:date>
    </item>
    <item>
      <title>Re : how to find the length of curve in vba?</title>
      <link>https://forums.autodesk.com/t5/vba-forum/how-to-find-the-length-of-curve-in-vba/m-p/4468583#M11041</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Sub LengthCurves()
Dim oEntity As AcadEntity
Dim P1 As Variant
Dim strMessage As String

On Error GoTo Err_LengthCurves

    ThisDrawing.Utility.GetEntity oEntity, P1, vbCrLf &amp;amp; "Select a line, an arc, a circle or a polyline (2D or 3D)"
    
    Select Case oEntity.ObjectName
        Case "AcDbCircle"
            strMessage = "Circle : " &amp;amp; oEntity.Circumference
            
        Case "AcDbArc"
            strMessage = "Arc : " &amp;amp; oEntity.ArcLength
            
        Case "AcDbLine"
            strMessage = "Line : " &amp;amp; oEntity.Length
        
        Case "AcDbPolyline"
            strMessage = "Polyline : " &amp;amp; oEntity.Length
            
        Case "AcDb3dPolyline"
            strMessage = "Polyline 3D : " &amp;amp; oEntity.Length
        
        Case Else
            strMessage = "Error ! The selected entity is not a line, an arc, a circle or a polyline."
    End Select
    

Exit_LengthCurves:
    ThisDrawing.Utility.Prompt strMessage
    Set oEntity = Nothing
    Exit Sub
    
Err_LengthCurves:
    If Err.Number &amp;lt;&amp;gt; -2147352567 Then
        strMessage = "Error : " &amp;amp; Err.Description
    End If
    GoTo Exit_LengthCurves
End Sub&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 29 Sep 2013 08:19:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/how-to-find-the-length-of-curve-in-vba/m-p/4468583#M11041</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2013-09-29T08:19:21Z</dc:date>
    </item>
    <item>
      <title>Re: Re : how to find the length of curve in vba?</title>
      <link>https://forums.autodesk.com/t5/vba-forum/how-to-find-the-length-of-curve-in-vba/m-p/8642683#M11042</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How can I find only curve or arc lenght in polyline that have lines and arcs?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I try to find lenght with polyline.coordinates. but polyline incluce arc, I can not find arc lenght.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;For i = 0 To Sinir - 2 Step 2
            
                xyKoor(0) = PCizgi.Coordinates(i)       'X1
                xyKoor(1) = PCizgi.Coordinates(i + 1)   'Y1
                xyKoor(2) = PCizgi.Coordinates(i + 2)   'X2
                xyKoor(3) = PCizgi.Coordinates(i + 3)   'Y2
                If xyKoor(2) - xyKoor(0) = 0 Then       ' açı hesaplanırken xyKoor(2) - xyKoor(0)=0 ise açı 90 derecesir kodlaması
                    PCizgiAci = PI / 2
                Else
                    PCizgiAci = Atn((xyKoor(3) - xyKoor(1)) / (xyKoor(2) - xyKoor(0))) '* 180 / PI
                End If
                oYaziMesafeY = oYaziMesafe * Cos(PCizgiAci)
                oYaziMesafeX = oYaziMesafe * Sin(PCizgiAci)
                xyKoorMid(0) = (xyKoor(0) + xyKoor(2)) / 2 - oYaziMesafeX
                xyKoorMid(1) = (xyKoor(1) + xyKoor(3)) / 2 + oYaziMesafeY
                
                
                PCizgiUzunluk = 100 * ((xyKoor(0) - xyKoor(2)) ^ 2 + (xyKoor(1) - xyKoor(3)) ^ 2) ^ 0.5
                                
                Set oYazi = ThisDrawing.ModelSpace.AddText("" &amp;amp; Round(PCizgiUzunluk, 0), xyKoorMid, oYaziYuksekligi)
                oYazi.Rotation = PCizgiAci '* PI / 180
                oYazi.Layer = "N-makro-Boy-Parca"
            Next i&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2019-03-07_154928.jpg" style="width: 622px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/611060iC99E8CB220A65297/image-size/large?v=v2&amp;amp;px=999" role="button" title="2019-03-07_154928.jpg" alt="2019-03-07_154928.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Mar 2019 12:56:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/how-to-find-the-length-of-curve-in-vba/m-p/8642683#M11042</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-03-07T12:56:38Z</dc:date>
    </item>
    <item>
      <title>Re: Re : how to find the length of curve in vba?</title>
      <link>https://forums.autodesk.com/t5/vba-forum/how-to-find-the-length-of-curve-in-vba/m-p/8643083#M11043</link>
      <description>&lt;P&gt;The easiest way to know the length of each segment between 2 vertices in a polyline is to call Explode() method, which would break down the polyline/LWPolyline at its vertices and return a set entities of either AcadLine, or AcadArc. Then you can get the length of each of them. Do not forget to erase them after calling Explode(), when necessary.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Mar 2019 15:20:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/how-to-find-the-length-of-curve-in-vba/m-p/8643083#M11043</guid>
      <dc:creator>Norman_Yuan</dc:creator>
      <dc:date>2019-03-07T15:20:52Z</dc:date>
    </item>
  </channel>
</rss>

