<?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 get length of spline in vba? in VBA Forum</title>
    <link>https://forums.autodesk.com/t5/vba-forum/how-to-get-length-of-spline-in-vba/m-p/2156249#M21672</link>
    <description>Thanks...I get it now...need to utilize the help more.&lt;BR /&gt;
&lt;BR /&gt;
Thanks again,&lt;BR /&gt;
Proctor</description>
    <pubDate>Wed, 16 Jan 2008 19:07:49 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2008-01-16T19:07:49Z</dc:date>
    <item>
      <title>How to get length of spline in vba?</title>
      <link>https://forums.autodesk.com/t5/vba-forum/how-to-get-length-of-spline-in-vba/m-p/2156244#M21667</link>
      <description>I'm writing a small script in vba and need to get the length of a spline for some calculations. I see that length is not a property of AcadSpline linetype. Does anyone know how I can go about doing this in my script? &lt;BR /&gt;
&lt;BR /&gt;
Dim MyLine As AcadLine&lt;BR /&gt;
MyLineLength = MyLine.Length(intellisense has length listed for line)&lt;BR /&gt;
&lt;BR /&gt;
but when I go to do this for my spline:&lt;BR /&gt;
Dim MySpline As AcadSpline&lt;BR /&gt;
MyLineLength = MySpline. (intellisense doesn't have length listed for spline)</description>
      <pubDate>Tue, 15 Jan 2008 22:24:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/how-to-get-length-of-spline-in-vba/m-p/2156244#M21667</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-01-15T22:24:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to get length of spline in vba?</title>
      <link>https://forums.autodesk.com/t5/vba-forum/how-to-get-length-of-spline-in-vba/m-p/2156245#M21668</link>
      <description>i also searched the same, with no success.&lt;BR /&gt;
for the last, i used vba-calling-lisp, since there is lisp function "vlax-curve-dist-at-param", which returns distance-over-curve-up-to-given-param, so, if you supply end-param-value, you get the curve length. in fact, you need to check start-param as well, bnecause one of them will report you distance=0&lt;BR /&gt;
just check the topic "calling lisp from vba", it is quite descriptive</description>
      <pubDate>Tue, 15 Jan 2008 22:52:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/how-to-get-length-of-spline-in-vba/m-p/2156245#M21668</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-01-15T22:52:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to get length of spline in vba?</title>
      <link>https://forums.autodesk.com/t5/vba-forum/how-to-get-length-of-spline-in-vba/m-p/2156246#M21669</link>
      <description>Thanks for giving me some dirrection to go in....I've been racking my brains trying to find a solution.&lt;BR /&gt;
&lt;BR /&gt;
I've never created a lisp routine. Can you please tell me where I can find the barebone basics I need ...just to get the length value? &lt;BR /&gt;
&lt;BR /&gt;
Thanks again,&lt;BR /&gt;
Proctor</description>
      <pubDate>Tue, 15 Jan 2008 23:43:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/how-to-get-length-of-spline-in-vba/m-p/2156246#M21669</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-01-15T23:43:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to get length of spline in vba?</title>
      <link>https://forums.autodesk.com/t5/vba-forum/how-to-get-length-of-spline-in-vba/m-p/2156247#M21670</link>
      <description>When calling vlax-curve-dist-at-param, you said I need to pass in a start and end param....do you mean the start and end tangent? &lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
Proctor</description>
      <pubDate>Wed, 16 Jan 2008 18:49:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/how-to-get-length-of-spline-in-vba/m-p/2156247#M21670</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-01-16T18:49:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to get length of spline in vba?</title>
      <link>https://forums.autodesk.com/t5/vba-forum/how-to-get-length-of-spline-in-vba/m-p/2156248#M21671</link>
      <description>no, they're params as he said&lt;BR /&gt;
look at the vlax-curve- functions in vlisp help&lt;BR /&gt;
&lt;BR /&gt;
&lt;PROCTOR&gt; wrote in message news:5822238@discussion.autodesk.com...&lt;BR /&gt;
When calling vlax-curve-dist-at-param, you said I need to pass in a start &lt;BR /&gt;
and end param....do you mean the start and end tangent?&lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
Proctor&lt;/PROCTOR&gt;</description>
      <pubDate>Wed, 16 Jan 2008 18:59:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/how-to-get-length-of-spline-in-vba/m-p/2156248#M21671</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-01-16T18:59:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to get length of spline in vba?</title>
      <link>https://forums.autodesk.com/t5/vba-forum/how-to-get-length-of-spline-in-vba/m-p/2156249#M21672</link>
      <description>Thanks...I get it now...need to utilize the help more.&lt;BR /&gt;
&lt;BR /&gt;
Thanks again,&lt;BR /&gt;
Proctor</description>
      <pubDate>Wed, 16 Jan 2008 19:07:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/how-to-get-length-of-spline-in-vba/m-p/2156249#M21672</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-01-16T19:07:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to get length of spline in vba?</title>
      <link>https://forums.autodesk.com/t5/vba-forum/how-to-get-length-of-spline-in-vba/m-p/2156250#M21673</link>
      <description>as illustartion, here is a part of my vba-lisp sub. this works for me, maybe there is better way, somebody correct me?&lt;BR /&gt;
(hope there is no missing brackets)&lt;BR /&gt;
-----------8&amp;lt;------------------------&lt;BR /&gt;
'acad 2008, written with vbscript, all vars are variants&lt;BR /&gt;
option explicit&lt;BR /&gt;
dim acad,draw,model&lt;BR /&gt;
set acad=getobject(,"autocad.application.17")&lt;BR /&gt;
set draw=acad.activedocument&lt;BR /&gt;
set model=draw.modelspace&lt;BR /&gt;
dim vl,vlf&lt;BR /&gt;
'need to have loaded (vl-load-com) by cmd line or acad.lsp&lt;BR /&gt;
set vl = acad.getinterfaceobject("vl.application.16")&lt;BR /&gt;
set vlf = vl.activedocument.functions&lt;BR /&gt;
dim lispobj,length,curve&lt;BR /&gt;
'curve is your curve object, &lt;BR /&gt;
'set curve=something ...&lt;BR /&gt;
set lispobj=vlf.item("read").funcall("hspline")&lt;BR /&gt;
vlf.item("set").funcall lispobj,curve.handle&lt;BR /&gt;
set lispobj=vlf.item("read").funcall( _&lt;BR /&gt;
"(progn " &amp;amp; _&lt;BR /&gt;
"(setq vlhspline (vlax-variant-value hspline)) " &amp;amp; _&lt;BR /&gt;
"(setq spl (handent vlhspline)) " &amp;amp; _&lt;BR /&gt;
"(setq lng (vlax-curve-getdistatparam spl (vlax-curve-getendparam spl))) " &amp;amp; _&lt;BR /&gt;
")" _&lt;BR /&gt;
) &lt;BR /&gt;
length=vlf.item("eval").funcall(lispobj)</description>
      <pubDate>Wed, 16 Jan 2008 21:52:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/how-to-get-length-of-spline-in-vba/m-p/2156250#M21673</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-01-16T21:52:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to get length of spline in vba?</title>
      <link>https://forums.autodesk.com/t5/vba-forum/how-to-get-length-of-spline-in-vba/m-p/2156251#M21674</link>
      <description>FYI: These kind of functions (like GetDistAtParam) are only available in LISP or ObjectARX, so you will not find them available in the AutoCAD COM libraries (VBA).</description>
      <pubDate>Wed, 16 Jan 2008 22:44:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/how-to-get-length-of-spline-in-vba/m-p/2156251#M21674</guid>
      <dc:creator>jbooth</dc:creator>
      <dc:date>2008-01-16T22:44:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to get length of spline in vba?</title>
      <link>https://forums.autodesk.com/t5/vba-forum/how-to-get-length-of-spline-in-vba/m-p/2156252#M21675</link>
      <description>Type (vl-load-com) in the command line before&lt;BR /&gt;
or pass the same in .SendCommand&lt;BR /&gt;
&lt;BR /&gt;
~'J'~</description>
      <pubDate>Thu, 17 Jan 2008 22:22:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/how-to-get-length-of-spline-in-vba/m-p/2156252#M21675</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-01-17T22:22:44Z</dc:date>
    </item>
    <item>
      <title>Re: How to get length of spline in vba?</title>
      <link>https://forums.autodesk.com/t5/vba-forum/how-to-get-length-of-spline-in-vba/m-p/2156253#M21676</link>
      <description>Thanks for all your help. Here's my final code that works perfectly to get the length of a spline:&lt;BR /&gt;
&lt;BR /&gt;
        If TypeOf ssobject Is AcadSpline Then&lt;BR /&gt;
            Set MySpline = ssobject&lt;BR /&gt;
            MyLineType = MySpline.Linetype&lt;BR /&gt;
            'THIS SCRIPT SENDS IN PARAMS and calls A LISP FUNCTION TO CALCULATE THE LENGTH OF A SPLINE&lt;BR /&gt;
            'WASNT ABLE TO FIND LENGTH W/ VBA SO HAD TO MAKE CALL LISP FUNCTION vlax-curve-getdistatparam to get it.&lt;BR /&gt;
            With ThisDrawing&lt;BR /&gt;
                ThisDrawing.SetVariable "USERR1", sVar&lt;BR /&gt;
                'load lisp&lt;BR /&gt;
                .SendCommand "(vl-load-com)" &amp;amp; vbCr&lt;BR /&gt;
                'call lisp function and pass in params. return length of spline&lt;BR /&gt;
                strCom = "(setvar " &amp;amp; Chr(34) &amp;amp; "USERR1" &amp;amp; Chr(34) &amp;amp; Chr(32) &amp;amp; "(vlax-curve-getdistatparam (vlax-ename-&amp;gt;vla-object (handent " &amp;amp; Chr(34) &amp;amp; ssobject.Handle &amp;amp; Chr(34) &amp;amp; ")) (vlax-curve-getendparam (vlax-ename-&amp;gt;vla-object (handent " &amp;amp; Chr(34) &amp;amp; ssobject.Handle &amp;amp; Chr(34) &amp;amp; ")))))" &amp;amp; vbCr&lt;BR /&gt;
                .SendCommand strCom&lt;BR /&gt;
                 MyLineLength = .GetVariable("USERR1")&lt;BR /&gt;
            End With&lt;BR /&gt;
End if</description>
      <pubDate>Thu, 17 Jan 2008 23:01:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/how-to-get-length-of-spline-in-vba/m-p/2156253#M21676</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-01-17T23:01:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to get length of spline in vba?</title>
      <link>https://forums.autodesk.com/t5/vba-forum/how-to-get-length-of-spline-in-vba/m-p/2156254#M21677</link>
      <description>Happy computing &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;
&lt;BR /&gt;
~'J'~</description>
      <pubDate>Fri, 18 Jan 2008 06:59:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/how-to-get-length-of-spline-in-vba/m-p/2156254#M21677</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2008-01-18T06:59:44Z</dc:date>
    </item>
  </channel>
</rss>

