<?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: vlax-curve-getpointatparam failing in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/vlax-curve-getpointatparam-failing/m-p/8368845#M97568</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3930636"&gt;@john.uhden&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;Anyway, this works better to get to the actual test.&amp;nbsp; Many thanks.And, no, I haven't run into any failures here at work.&amp;nbsp; Maybe my laptop at home is possessed&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I doubt it, that would only happen tomorrow. &lt;img id="robottongue" class="emoticon emoticon-robottongue" src="https://forums.autodesk.com/i/smilies/16x16_robot-tongue.png" alt="Robot tongue" title="Robot tongue" /&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 30 Oct 2018 15:22:20 GMT</pubDate>
    <dc:creator>dlanorh</dc:creator>
    <dc:date>2018-10-30T15:22:20Z</dc:date>
    <item>
      <title>vlax-curve-getpointatparam failing</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/vlax-curve-getpointatparam-failing/m-p/8367111#M97562</link>
      <description>&lt;P&gt;As you may know, I have been trying to create&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/291579"&gt;@braudpat&lt;/a&gt;'s function for adding vertices at every midpoint of a polyline's segments.&lt;/P&gt;
&lt;P&gt;It is failing occasionally when trying to get the midpoint of the last segment.&lt;/P&gt;
&lt;P&gt;Does anyone know why?&amp;nbsp; This is not a quiz.&amp;nbsp; I haven't a clue.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try this test on any, in fact many, poylines (LW, heavy, 3D, closed, open) and see what you get.&lt;/P&gt;
&lt;P&gt;In some situations, the midpoint of the last segment is returned as nil.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(defun c:test ()
  (and
    (setq e (car (entsel)))
    (setq obj (vlax-ename-&amp;gt;vla-object e))
    (setq objname (vlax-get obj 'ObjectName))
    (or
      (wcmatch objname "*olyline")
      (alert "Object selected is not a polyline.")
    )
    (princ "\nClosed: ")(princ (vlax-get obj 'Closed))
    (setq end (vlax-curve-getendparam obj))
    (princ "    Midpoint of last segment: ")
    (princ (setq p (vlax-curve-getpointatparam obj (- end 0.5))))
  )
  (princ)
)&lt;/PRE&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Oct 2018 23:21:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/vlax-curve-getpointatparam-failing/m-p/8367111#M97562</guid>
      <dc:creator>john.uhden</dc:creator>
      <dc:date>2018-10-29T23:21:46Z</dc:date>
    </item>
    <item>
      <title>Re: vlax-curve-getpointatparam failing</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/vlax-curve-getpointatparam-failing/m-p/8367253#M97563</link>
      <description>I can't see anything out of place with the code. Limited testing couldn't reproduce the error in 2012.&lt;BR /&gt;&lt;BR /&gt;Things to consider (ramblings) :&lt;BR /&gt;&lt;BR /&gt;You can't remove the last segment on a closed polyline unless you have drawn the polyline back to the start point before closing it (using pedit)&lt;BR /&gt;&lt;BR /&gt;Can you get the correct point via (vlax-curve-getpointatdist obj (vlax-curve-getdistatparam obj)) ?&lt;BR /&gt;&lt;BR /&gt;Does (vlax-curve-isclosed obj) return the same as (vlax-get obj 'closed)?&lt;BR /&gt;&lt;BR /&gt;(vlax-curve-isperiodic obj)</description>
      <pubDate>Tue, 30 Oct 2018 00:56:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/vlax-curve-getpointatparam-failing/m-p/8367253#M97563</guid>
      <dc:creator>dlanorh</dc:creator>
      <dc:date>2018-10-30T00:56:24Z</dc:date>
    </item>
    <item>
      <title>Re: vlax-curve-getpointatparam failing</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/vlax-curve-getpointatparam-failing/m-p/8368415#M97564</link>
      <description>No, there's nothing wrong with my code.  It's the results that are&lt;BR /&gt;bothersome.  I'll have to try one of your ramblings.&lt;BR /&gt;&lt;BR /&gt;The only thing I can think of is if the last vertex were drawn to the first&lt;BR /&gt;vertex and then closed, which I think would leave the endpoint and the (1-&lt;BR /&gt;endpoint) at the same point, leaving zero distance between them.  But I am&lt;BR /&gt;pretty sure I had not created such a test condition.</description>
      <pubDate>Tue, 30 Oct 2018 12:55:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/vlax-curve-getpointatparam-failing/m-p/8368415#M97564</guid>
      <dc:creator>john.uhden</dc:creator>
      <dc:date>2018-10-30T12:55:02Z</dc:date>
    </item>
    <item>
      <title>Re: vlax-curve-getpointatparam failing</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/vlax-curve-getpointatparam-failing/m-p/8368743#M97565</link>
      <description>&lt;P&gt;Well, appaently you can't use (vlax-get obj 'Closed) on a spline curve polyline...&lt;/P&gt;
&lt;P&gt;(vlax-get object 'closed) ; error: AutoCAD.Application: Invalid class.&lt;/P&gt;
&lt;P&gt;It's not that I really need to know if the polyline is closed; it's just that I have been suspecting that the pointatparam failure may be related to the closure.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Anyway, this works better to get to the actual test.&amp;nbsp; Many thanks.&lt;/P&gt;
&lt;PRE&gt;(defun c:test ()
  (and
    (setq e (car (entsel)))
    (setq obj (vlax-ename-&amp;gt;vla-object e))
    (setq objname (vlax-get obj 'ObjectName))
    (or
      (wcmatch objname "*olyline")
      (alert "Object selected is not a polyline.")
    )
    (princ "\nClosed: ")(or (princ (vlax-curve-isclosed obj)) 1)
    (setq end (vlax-curve-getendparam obj))
    (princ "    Midpoint of last segment: ")
    (princ (setq p (vlax-curve-getpointatparam obj (- end 0.5))))
  )
  (princ)
)&lt;/PRE&gt;
&lt;P&gt;And, no, I haven't run into any failures here at work.&amp;nbsp; Maybe my laptop at home is possessed.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Oct 2018 14:51:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/vlax-curve-getpointatparam-failing/m-p/8368743#M97565</guid>
      <dc:creator>john.uhden</dc:creator>
      <dc:date>2018-10-30T14:51:45Z</dc:date>
    </item>
    <item>
      <title>Re: vlax-curve-getpointatparam failing</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/vlax-curve-getpointatparam-failing/m-p/8368769#M97566</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3930636"&gt;@john.uhden&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Well, appaently you can't use (vlax-get obj 'Closed) on ....&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As for that particular issue, if it's of any help, you can find that out without resorting to the content of the&amp;nbsp;'Closed &lt;EM&gt;VLA Property&lt;/EM&gt;, but more directly:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#000000"&gt;&lt;STRONG&gt;(vlax-curve-isClosed obj)&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;which returns T if it's closed, nil if not.&amp;nbsp; It also works with an entity name rather than a VLA object.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Oct 2018 14:59:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/vlax-curve-getpointatparam-failing/m-p/8368769#M97566</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2018-10-30T14:59:48Z</dc:date>
    </item>
    <item>
      <title>Re: vlax-curve-getpointatparam failing</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/vlax-curve-getpointatparam-failing/m-p/8368812#M97567</link>
      <description>&lt;P&gt;Thanks, Kent.&amp;nbsp; I think that's what&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5644077"&gt;@dlanorh&lt;/a&gt;&amp;nbsp;was suggesting.&lt;/P&gt;</description>
      <pubDate>Tue, 30 Oct 2018 15:14:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/vlax-curve-getpointatparam-failing/m-p/8368812#M97567</guid>
      <dc:creator>john.uhden</dc:creator>
      <dc:date>2018-10-30T15:14:31Z</dc:date>
    </item>
    <item>
      <title>Re: vlax-curve-getpointatparam failing</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/vlax-curve-getpointatparam-failing/m-p/8368845#M97568</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3930636"&gt;@john.uhden&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;Anyway, this works better to get to the actual test.&amp;nbsp; Many thanks.And, no, I haven't run into any failures here at work.&amp;nbsp; Maybe my laptop at home is possessed&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;I doubt it, that would only happen tomorrow. &lt;img id="robottongue" class="emoticon emoticon-robottongue" src="https://forums.autodesk.com/i/smilies/16x16_robot-tongue.png" alt="Robot tongue" title="Robot tongue" /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Oct 2018 15:22:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/vlax-curve-getpointatparam-failing/m-p/8368845#M97568</guid>
      <dc:creator>dlanorh</dc:creator>
      <dc:date>2018-10-30T15:22:20Z</dc:date>
    </item>
    <item>
      <title>Re: vlax-curve-getpointatparam failing</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/vlax-curve-getpointatparam-failing/m-p/8368967#M97569</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3930636"&gt;@john.uhden&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thanks, Kent.&amp;nbsp; I think that's what&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5644077"&gt;@dlanorh&lt;/a&gt;&amp;nbsp;was suggesting.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I hadn't noticed their mention of that.&amp;nbsp; The difference is that (vlax-curve-isClosed) returns either T or nil, whereas the VLA Property is either 0 or -1.&amp;nbsp; So with 'e' as the entity name, there's a savings in having only to test for:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(if (vlax-curve-isClosed e) ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;rather than to make it a VLA Object and then&amp;nbsp;check a Property of that:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(setq obj (vlax-ename-&amp;gt;vla-object e))&lt;/P&gt;
&lt;P&gt;(if (=&amp;nbsp;(vlax-get obj 'closed) -1) ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;[If you need to convert it to a VLA Object for other purposes anyway, the "savings" is reduced to only a few characters.&amp;nbsp; But you don't need to make that conversion if it's only for getting parameters and/or points with (vlax-curve...) functions, since they can work with entity names as well as with VLA Objects.]&lt;/P&gt;</description>
      <pubDate>Tue, 30 Oct 2018 16:02:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/vlax-curve-getpointatparam-failing/m-p/8368967#M97569</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2018-10-30T16:02:29Z</dc:date>
    </item>
    <item>
      <title>Re: vlax-curve-getpointatparam failing</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/vlax-curve-getpointatparam-failing/m-p/8370034#M97570</link>
      <description>Thank you for reminding me of that again.  My code later uses (vlax-put obj&lt;BR /&gt;'Coordinates) and (vla-setbulge obj), so the vla-object thingy is not a&lt;BR /&gt;waste,&lt;BR /&gt;Saving code really doesn't bother me.  You should see some of my&lt;BR /&gt;paleolithic creations that still work.&lt;BR /&gt;Now I've been thinking that the phenomenon happens only after adding&lt;BR /&gt;vertices per &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/291579"&gt;@braudpat&lt;/a&gt;'s request.  I will try adding a vla-update to see if&lt;BR /&gt;that relieves the symptoms.</description>
      <pubDate>Tue, 30 Oct 2018 23:38:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/vlax-curve-getpointatparam-failing/m-p/8370034#M97570</guid>
      <dc:creator>john.uhden</dc:creator>
      <dc:date>2018-10-30T23:38:02Z</dc:date>
    </item>
    <item>
      <title>Re: vlax-curve-getpointatparam failing</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/vlax-curve-getpointatparam-failing/m-p/8370189#M97571</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3930636"&gt;@john.uhden&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;…. I've been thinking that the phenomenon happens only after adding&lt;BR /&gt;vertices per &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/291579"&gt;@braudpat&lt;/a&gt;'s request. …..&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;… which makes me wonder -- could it make any difference if you add the vertex in the middle of the &lt;EM&gt;last segment first&lt;/EM&gt;, and work your way from there toward the beginning?&amp;nbsp; I haven't studied your code to consider whether that's likely, but it may be worth an experiment.&lt;/P&gt;</description>
      <pubDate>Wed, 31 Oct 2018 02:29:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/vlax-curve-getpointatparam-failing/m-p/8370189#M97571</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2018-10-31T02:29:30Z</dc:date>
    </item>
    <item>
      <title>Re: vlax-curve-getpointatparam failing</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/vlax-curve-getpointatparam-failing/m-p/8371584#M97572</link>
      <description>&lt;P&gt;I'm sure that everyone participating on this thread is aware of the potential problems of assuming what curve parameters mean (per TT and OW).&amp;nbsp; For the benefit of others, I post a link to Owen's blog on the matter.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A title="Owen Wengerd explains the danger of making assumptions" href="http://otb.manusoft.com/2013/01/quirkypolyline-exposing-foolish-programmers.htm" target="_blank"&gt;QuirkyPolyline: exposing foolish programmers&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Oct 2018 16:26:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/vlax-curve-getpointatparam-failing/m-p/8371584#M97572</guid>
      <dc:creator>dbroad</dc:creator>
      <dc:date>2018-10-31T16:26:40Z</dc:date>
    </item>
    <item>
      <title>Re: vlax-curve-getpointatparam failing</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/vlax-curve-getpointatparam-failing/m-p/8371725#M97573</link>
      <description>&lt;P&gt;Hi, Doug.&lt;/P&gt;
&lt;P&gt;Since I would probably trust Owen with my life (even severely depreciated), I must try the distance approach instead of the parameter approach.&amp;nbsp; Maybe tonight.&lt;/P&gt;</description>
      <pubDate>Wed, 31 Oct 2018 17:15:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/vlax-curve-getpointatparam-failing/m-p/8371725#M97573</guid>
      <dc:creator>john.uhden</dc:creator>
      <dc:date>2018-10-31T17:15:44Z</dc:date>
    </item>
  </channel>
</rss>

