<?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: Lisp excute inconsisted result in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-excute-inconsisted-result/m-p/12101480#M27029</link>
    <description>&lt;P&gt;Turn off running Object Snap.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Kent1Cooper_0-1689337134206.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1240521i4C32256DB160A103/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Kent1Cooper_0-1689337134206.png" alt="Kent1Cooper_0-1689337134206.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 14 Jul 2023 12:19:00 GMT</pubDate>
    <dc:creator>Kent1Cooper</dc:creator>
    <dc:date>2023-07-14T12:19:00Z</dc:date>
    <item>
      <title>Lisp excute inconsisted result</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-excute-inconsisted-result/m-p/12101396#M27028</link>
      <description>&lt;P&gt;I dont even know to describe this. I am trying to write a lisp for auto dim, in which i will pre define a variable for dimesion line location but the defined variable is not always be consider when the lisp is excuted&lt;BR /&gt;(defun c:D2 ()&lt;BR /&gt;(while (not (equal (setq ent (entsel)) nil))&lt;BR /&gt;(progn&lt;BR /&gt;(setq dxf (entget (car ent)))&lt;BR /&gt;(setq start (cdr (assoc 10 dxf)))&lt;BR /&gt;(setq end (cdr (assoc 11 dxf)))&lt;BR /&gt;(command "dimaligned" start end)&lt;BR /&gt;(princ)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;--------------------------------------------&lt;BR /&gt;(defun c:d11 ()&lt;BR /&gt;(setq d11 (getreal "nhap khoang cach"))&lt;BR /&gt;)&lt;BR /&gt;--------------------------------------------&lt;BR /&gt;(defun c:d1 ()&lt;BR /&gt;(setq ss (ssget)&lt;BR /&gt;len (sslength ss)&lt;BR /&gt;i 0&lt;BR /&gt;)&lt;BR /&gt;(if (not (boundp 'd11))&lt;BR /&gt;(setq D11 40)&lt;BR /&gt;)&lt;BR /&gt;(repeat len&lt;BR /&gt;(progn&lt;BR /&gt;(setq ent (ssname ss i)&lt;BR /&gt;entd (entget ent)&lt;BR /&gt;i (+ 1 i)&lt;BR /&gt;)&lt;BR /&gt;(if (eq (cdr (assoc 0 entd)) ' "LINE")&lt;BR /&gt;(progn&lt;BR /&gt;(setq start (cdr (assoc 10 entd))&lt;BR /&gt;end (cdr (assoc 11 entd))&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;(command "dimaligned"&lt;BR /&gt;start&lt;BR /&gt;end&lt;BR /&gt;(trans (polar start (+ (angle start end) (/ pi 2)) d11) 0 1)&lt;BR /&gt;""&lt;BR /&gt;))&lt;BR /&gt;)&lt;BR /&gt;(command "mirror" ent "" (cdr (assoc 13 entd)) (cdr (assoc 14 entd)) "Y")&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jul 2023 09:05:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-excute-inconsisted-result/m-p/12101396#M27028</guid>
      <dc:creator>nam.lethai1995</dc:creator>
      <dc:date>2023-07-14T09:05:01Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp excute inconsisted result</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-excute-inconsisted-result/m-p/12101480#M27029</link>
      <description>&lt;P&gt;Turn off running Object Snap.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Kent1Cooper_0-1689337134206.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1240521i4C32256DB160A103/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Kent1Cooper_0-1689337134206.png" alt="Kent1Cooper_0-1689337134206.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jul 2023 12:19:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-excute-inconsisted-result/m-p/12101480#M27029</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2023-07-14T12:19:00Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp excute inconsisted result</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-excute-inconsisted-result/m-p/12102121#M27030</link>
      <description>&lt;P&gt;Wow, thanks you Kent, i had seen some one mentioned about turning off object snap when running lisp before but i never actually belive that it will be affective until now.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jul 2023 15:01:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-excute-inconsisted-result/m-p/12102121#M27030</guid>
      <dc:creator>nam.lethai1995</dc:creator>
      <dc:date>2023-07-14T15:01:15Z</dc:date>
    </item>
    <item>
      <title>Re: Lisp excute inconsisted result</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-excute-inconsisted-result/m-p/12102135#M27031</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/13188823"&gt;@nam.lethai1995&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Wow, thanks you Kent, i had seen some one mentioned about turning off object snap when running lisp before but i never actually belive that it will be affective until now.&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;It matters only when the code includes drawing or editing commands in (command) functions that involve specifying locations -- they will be subject to Osnap settings.&amp;nbsp; This is nearly always the cause of the trouble when things are drawn but end up in different locations than expected, somehow.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For a lot of things, making them with (entmake) instead of with (command) functions gets around the issue, because it is not subject to Osnap settings.&amp;nbsp; But making Dimensions that way is very complex.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You will find &lt;EM&gt;many&lt;/EM&gt; routines in the Forums with that &lt;EM&gt;built in&lt;/EM&gt;, to do the same in yours, including saving the current setting first and restoring it afterwards.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jul 2023 15:08:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-excute-inconsisted-result/m-p/12102135#M27031</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2023-07-14T15:08:54Z</dc:date>
    </item>
  </channel>
</rss>

