<?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: vla-intersectWith in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/vla-intersectwith/m-p/5965353#M135601</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/52747"&gt;@Moshe-A&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;hi guys,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;it looks like (vla-intersectWith) funcrion does not work well&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i have attached a small test i made (test.lsp + test.dwg)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;when a request is made for an intersection between&amp;nbsp;obj1 and&amp;nbsp;obj2, instead it returns one&amp;nbsp;endpoint of obj2&lt;/P&gt;
&lt;P&gt;the same&amp;nbsp;is&amp;nbsp;for obj3 and obj2 ... it returns the other endpoint of obj2&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;how can i fix this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thanks in advance&lt;/P&gt;
&lt;P&gt;Moshe&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;There is nothing to fix. Your test routine is working fine and the result is correct (ACAD 2015). See the screenshot.&lt;/P&gt;
&lt;P&gt;Maybe try to close both Autocad and Vlide and run it again.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 26 Dec 2015 19:51:56 GMT</pubDate>
    <dc:creator>ВeekeeCZ</dc:creator>
    <dc:date>2015-12-26T19:51:56Z</dc:date>
    <item>
      <title>vla-intersectWith</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/vla-intersectwith/m-p/5965343#M135600</link>
      <description>&lt;P&gt;hi guys,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;it looks like (vla-intersectWith) funcrion does not work well&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i have attached a small test i made (test.lsp + test.dwg)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;when a request is made for an intersection between&amp;nbsp;obj1 and&amp;nbsp;obj2, instead it returns one&amp;nbsp;endpoint of obj2&lt;/P&gt;
&lt;P&gt;the same&amp;nbsp;is&amp;nbsp;for obj3 and obj2 ... it returns the other endpoint of obj2&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;how can i fix this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thanks in advance&lt;/P&gt;
&lt;P&gt;Moshe&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 26 Dec 2015 19:03:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/vla-intersectwith/m-p/5965343#M135600</guid>
      <dc:creator>Moshe-A</dc:creator>
      <dc:date>2015-12-26T19:03:55Z</dc:date>
    </item>
    <item>
      <title>Re: vla-intersectWith</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/vla-intersectwith/m-p/5965353#M135601</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/52747"&gt;@Moshe-A&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;hi guys,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;it looks like (vla-intersectWith) funcrion does not work well&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;i have attached a small test i made (test.lsp + test.dwg)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;when a request is made for an intersection between&amp;nbsp;obj1 and&amp;nbsp;obj2, instead it returns one&amp;nbsp;endpoint of obj2&lt;/P&gt;
&lt;P&gt;the same&amp;nbsp;is&amp;nbsp;for obj3 and obj2 ... it returns the other endpoint of obj2&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;how can i fix this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thanks in advance&lt;/P&gt;
&lt;P&gt;Moshe&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;There is nothing to fix. Your test routine is working fine and the result is correct (ACAD 2015). See the screenshot.&lt;/P&gt;
&lt;P&gt;Maybe try to close both Autocad and Vlide and run it again.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 26 Dec 2015 19:51:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/vla-intersectwith/m-p/5965353#M135601</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2015-12-26T19:51:56Z</dc:date>
    </item>
    <item>
      <title>Re: vla-intersectWith</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/vla-intersectwith/m-p/5967360#M135602</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm not sure but looks like an OSNAP problem, try setting "OSMODE" variable to 0 before the intersect calculation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Gaston Nunez&lt;/P&gt;</description>
      <pubDate>Tue, 29 Dec 2015 16:11:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/vla-intersectwith/m-p/5967360#M135602</guid>
      <dc:creator>hgasty1001</dc:creator>
      <dc:date>2015-12-29T16:11:07Z</dc:date>
    </item>
    <item>
      <title>Re: vla-intersectWith</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/vla-intersectwith/m-p/5969880#M135603</link>
      <description>&lt;P&gt;Hi Guys,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sorry my respond is late, don't know why but i stopped getting an email when you replied.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;After playing alot with (vla-intersectWith) i came out with this conclusion:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if the two lines are apart but one extends beyond the intersection point, the option&amp;nbsp;'acExtendBoth' is not suitable&lt;/P&gt;
&lt;P&gt;(better autodesk may fix this to return the intersection point or atleast nil or error)&amp;nbsp;instead 'acExtendthisEntity' or 'acExtendOtherExntity' should be used.&lt;/P&gt;
&lt;P&gt;the only time&amp;nbsp;&lt;SPAN&gt;'acExtendBoth' will work is when the two objects does not cross the intersection point (both objects need to be extend)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;so i developed this function:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(defun get_intersection_point (obj0 obj1 / option)
   (vl-some
    '(lambda (option)
      (vla-intersectwith obj0 obj1 option)
     )
     (list acExtendNone acExtendThisEntity acExtendOtherEntity acExtendBoth)
   )
)
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Happy New Year to all &amp;nbsp;&amp;nbsp;&lt;img id="smileyvery-happy" class="emoticon emoticon-smileyvery-happy" src="https://forums.autodesk.com/i/smilies/16x16_smiley-very-happy.png" alt="Smiley Very Happy" title="Smiley Very Happy" /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Moshe&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jan 2016 14:43:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/vla-intersectwith/m-p/5969880#M135603</guid>
      <dc:creator>Moshe-A</dc:creator>
      <dc:date>2016-01-01T14:43:33Z</dc:date>
    </item>
    <item>
      <title>Re: vla-intersectWith</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/vla-intersectwith/m-p/5970456#M135604</link>
      <description>&lt;P&gt;Moshe,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Vla-intersectwith seems to work correctly with your test.dwg. &amp;nbsp;The results are consistent with the help file descriptions when using any of the options acextendboth, acextendthisentity, acextendotherentity, or acextendnone with any pair of lines. &amp;nbsp;You should avoid using vlax-safearray-&amp;gt;list, however, unless you are certain that an intersection exists. &amp;nbsp;If not certain, then you should use (safearray-value(variant-value(vla-intersectwith a b &amp;lt;whateverextendoption&amp;gt;))). &amp;nbsp;It will return nil if an intersection&amp;nbsp;does not exist whereas vlax-safearray-&amp;gt;list will return an error unless the intersection exists. &amp;nbsp;For the most probability of an intersection, the acextendboth should be used but it depends on the program goals.&lt;/P&gt;</description>
      <pubDate>Sat, 02 Jan 2016 19:08:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/vla-intersectwith/m-p/5970456#M135604</guid>
      <dc:creator>dbroad</dc:creator>
      <dc:date>2016-01-02T19:08:13Z</dc:date>
    </item>
    <item>
      <title>Re: vla-intersectWith</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/vla-intersectwith/m-p/5970872#M135605</link>
      <description>&lt;P&gt;dboard,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;didn't&amp;nbsp;knew&amp;nbsp;of&amp;nbsp;(safearray-value) and it doesn't appear&amp;nbsp;in help file. neither&amp;nbsp;(variant-value) but seen it here long time ago.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;thank you very much for your help&lt;/P&gt;
&lt;P&gt;Moshe&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 03 Jan 2016 17:29:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/vla-intersectwith/m-p/5970872#M135605</guid>
      <dc:creator>Moshe-A</dc:creator>
      <dc:date>2016-01-03T17:29:31Z</dc:date>
    </item>
    <item>
      <title>Re: vla-intersectWith</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/vla-intersectwith/m-p/5970899#M135606</link>
      <description>&lt;P&gt;You're welcome. &amp;nbsp;Since you usually have to use both functions together, I usually define this function:&lt;/P&gt;
&lt;PRE&gt;(defun safelist (v) (safearray-value (variant-value v)))&lt;/PRE&gt;</description>
      <pubDate>Sun, 03 Jan 2016 18:28:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/vla-intersectwith/m-p/5970899#M135606</guid>
      <dc:creator>dbroad</dc:creator>
      <dc:date>2016-01-03T18:28:30Z</dc:date>
    </item>
    <item>
      <title>Re: vla-intersectWith</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/vla-intersectwith/m-p/5971444#M135607</link>
      <description>&lt;P&gt;Hi Moshe,&lt;BR /&gt;in addition to dboard's great advices, what I usually use to skip safearray and variant conversion functions, is:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(setq A (vlax-invoke obj1 'IntersectWith obj2 acExtendBoth))&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;will return a REAL numbers list or nil if no intersection found.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps, &lt;BR /&gt;Henrique&lt;/P&gt;</description>
      <pubDate>Mon, 04 Jan 2016 10:05:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/vla-intersectwith/m-p/5971444#M135607</guid>
      <dc:creator>hmsilva</dc:creator>
      <dc:date>2016-01-04T10:05:20Z</dc:date>
    </item>
    <item>
      <title>Re: vla-intersectWith</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/vla-intersectwith/m-p/5972164#M135608</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/75977"&gt;@hmsilva﻿&lt;/a&gt;&amp;nbsp;. &amp;nbsp;I thought I had tried the shorter vlax-invoke &amp;nbsp;approach before I posted but I must have used vlax-invoke-method instead. &amp;nbsp;Thanks for the additional info.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Jan 2016 17:12:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/vla-intersectwith/m-p/5972164#M135608</guid>
      <dc:creator>dbroad</dc:creator>
      <dc:date>2016-01-04T17:12:30Z</dc:date>
    </item>
    <item>
      <title>Re: vla-intersectWith</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/vla-intersectwith/m-p/5972300#M135609</link>
      <description>&lt;P&gt;Henrique,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;wow, thanks for this tip&amp;nbsp; &lt;img id="smileyvery-happy" class="emoticon emoticon-smileyvery-happy" src="https://forums.autodesk.com/i/smilies/16x16_smiley-very-happy.png" alt="Smiley Very Happy" title="Smiley Very Happy" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Moshe&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Jan 2016 18:19:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/vla-intersectwith/m-p/5972300#M135609</guid>
      <dc:creator>Moshe-A</dc:creator>
      <dc:date>2016-01-04T18:19:57Z</dc:date>
    </item>
    <item>
      <title>Re: vla-intersectWith</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/vla-intersectwith/m-p/5972370#M135610</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous wrote:&lt;BR /&gt;
&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/75977"&gt;@hmsilva&lt;/a&gt;&amp;nbsp;. &amp;nbsp;I thought I had tried the shorter vlax-invoke &amp;nbsp;approach before I posted but I must have used vlax-invoke-method instead. &amp;nbsp;Thanks for the additional info.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/411413"&gt;@dbroad&lt;/a&gt;&lt;/P&gt;
&lt;P&gt;You're welcome, dbroad!&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/52747"&gt;@Moshe-A&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Henrique,&lt;/P&gt;
&lt;P&gt;wow, thanks for this tip&amp;nbsp; &lt;img id="smileyvery-happy" class="emoticon emoticon-smileyvery-happy" src="https://forums.autodesk.com/i/smilies/16x16_smiley-very-happy.png" alt="Smiley Very Happy" title="Smiley Very Happy" /&gt;&lt;/P&gt;
&lt;P&gt;Moshe&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You're welcome, Moshe&lt;BR /&gt;Glad I could help! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;BR /&gt;&lt;BR /&gt;Henrique&lt;/P&gt;</description>
      <pubDate>Mon, 04 Jan 2016 18:48:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/vla-intersectwith/m-p/5972370#M135610</guid>
      <dc:creator>hmsilva</dc:creator>
      <dc:date>2016-01-04T18:48:51Z</dc:date>
    </item>
    <item>
      <title>Re: vla-intersectWith</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/vla-intersectwith/m-p/5972388#M135611</link>
      <description>&lt;P&gt;You can also use Lee Mac's sub&amp;nbsp;&lt;A href="http://www.lee-mac.com/intersectionfunctions.html" target="_self"&gt;here&lt;/A&gt;&amp;nbsp;which uses the same approach as Henrique mentioned. In addition it makes a list of all possible points.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Jan 2016 18:55:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/vla-intersectwith/m-p/5972388#M135611</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2016-01-04T18:55:13Z</dc:date>
    </item>
  </channel>
</rss>

