<?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 needed for closed areas in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-needed-for-closed-areas/m-p/5720750#M140065</link>
    <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This little script you gave me is truly awesome Henrique! Thanks alot!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was wondering how we could simply modify this script so that the routine could stay in the command after I clicked in the first closed area, ready for another click. With this modification I would be able to "click-mouse pan-click [...]" without having to press enter each time before clicking.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks alot for your help it is really appreciate!&lt;/P&gt;</description>
    <pubDate>Wed, 15 Jul 2015 14:36:59 GMT</pubDate>
    <dc:creator>JB-T</dc:creator>
    <dc:date>2015-07-15T14:36:59Z</dc:date>
    <item>
      <title>LISP needed for closed areas</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-needed-for-closed-areas/m-p/5719911#M140063</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is my first post here but I come on the site weekly since the last 7 years to gather some tips or lisp files.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As part of my job, I often have to make the same manipulations several times in AutoCAD.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;These operations consist in adding a perimeter to a closed area (Boundary command) and then using a random lisp file I found on your site to select this boundary and to annotate the area (square meters) of the closed area.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wish I could find an AutoLISP file that would allow me, by clicking once in a closed area, to create the perimeter and at the same time to place a text indicating the area (square meters) of this closed area.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can someone give me the link of such a file or guiding me through the construction of a Lisp that could fulfill my needs?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot and have a great day!&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jul 2015 23:16:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-needed-for-closed-areas/m-p/5719911#M140063</guid>
      <dc:creator>JB-T</dc:creator>
      <dc:date>2015-07-14T23:16:30Z</dc:date>
    </item>
    <item>
      <title>Re: LISP needed for closed areas</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-needed-for-closed-areas/m-p/5719953#M140064</link>
      <description>&lt;P&gt;Hello&amp;nbsp;JB-T and welcome to the Autodesk Community!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Quick and dirty, and as a strating point...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(vl-load-com)
(defun c:demo ( / area ent lst obj pt)
  (if (and (setq lst (entlast))
           (setq pt (getpoint "\nSpecify internal point: "))
           (vl-cmdf "_.-boundary" pt "")
           (setq ent (entlast))
           (not (eq lst ent))
      )
    (progn
      (setq obj  (vlax-ename-&amp;gt;vla-object ent)
            area (vla-get-area obj)
      )
      (entmake (list
                 '(0 . "TEXT")
                 (cons 10 pt)
                 (cons 40 (getvar 'TEXTSIZE))
                 (cons 1 (strcat (rtos area 2 2) " m2"))
               )
      )
    )
  )
  (princ)
)&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&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>Wed, 15 Jul 2015 00:21:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-needed-for-closed-areas/m-p/5719953#M140064</guid>
      <dc:creator>hmsilva</dc:creator>
      <dc:date>2015-07-15T00:21:07Z</dc:date>
    </item>
    <item>
      <title>Re: LISP needed for closed areas</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-needed-for-closed-areas/m-p/5720750#M140065</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This little script you gave me is truly awesome Henrique! Thanks alot!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was wondering how we could simply modify this script so that the routine could stay in the command after I clicked in the first closed area, ready for another click. With this modification I would be able to "click-mouse pan-click [...]" without having to press enter each time before clicking.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks alot for your help it is really appreciate!&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jul 2015 14:36:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-needed-for-closed-areas/m-p/5720750#M140065</guid>
      <dc:creator>JB-T</dc:creator>
      <dc:date>2015-07-15T14:36:59Z</dc:date>
    </item>
    <item>
      <title>Re: LISP needed for closed areas</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-needed-for-closed-areas/m-p/5720763#M140066</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3164629"&gt;@JB-T&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Hello!&lt;/P&gt;
&lt;P&gt;This little script you gave me is truly awesome Henrique! Thanks alot!&lt;/P&gt;
&lt;P&gt;I was wondering how we could simply modify this script so that the routine could stay in the command after I clicked in the first closed area, ready for another click. With this modification I would be able to "click-mouse pan-click [...]" without having to press enter each time before clicking.&lt;/P&gt;
&lt;P&gt;Thanks alot for your help it is really appreciate!&lt;/P&gt;
&lt;HR /&gt;You're welcome, JB-T&lt;BR /&gt;Glad I could help!&lt;/BLOCKQUOTE&gt;
&lt;BLOCKQUOTE&gt;Code revised...&lt;/BLOCKQUOTE&gt;
&lt;BLOCKQUOTE&gt;
&lt;PRE&gt;(vl-load-com)
(defun c:demo (/ area ent lst obj pt)
  (while (and (setq lst (entlast))
              (setq pt (getpoint "\nSpecify internal point: "))
              (vl-cmdf "_.-boundary" pt "")
              (setq ent (entlast))
              (not (eq lst ent))
         )
    (setq obj  (vlax-ename-&amp;gt;vla-object ent)
          area (vla-get-area obj)
    )
    (entmake (list
               '(0 . "TEXT")
               (cons 10 (trans pt 1 0))
               (cons 40 (getvar 'TEXTSIZE))
               (cons 1 (strcat (rtos area 2 2) " m2"))
               (cons 50 (angle '(0.0 0.0) (getvar 'UCSXDIR)))
             )
    )
  )
  (princ)
)&lt;/PRE&gt;
&lt;/BLOCKQUOTE&gt;
&lt;BLOCKQUOTE&gt;Henrique&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Jul 2015 14:59:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-needed-for-closed-areas/m-p/5720763#M140066</guid>
      <dc:creator>hmsilva</dc:creator>
      <dc:date>2015-07-15T14:59:03Z</dc:date>
    </item>
    <item>
      <title>Re: LISP needed for closed areas</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-needed-for-closed-areas/m-p/5725593#M140067</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After a few days of use, I can tell you that I saved a lot of time using this routine! Thanks to Henrique!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I noticed two points that I would like to adjust in order to improve the operation of this routine for the future.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First, it would be useful if the routine could ask for the text height that we want to use for the annotations, when we invoke the command.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, I found out that AutoCAD exits the routine if we click in a non-closed area or on an element such as a line, which can happen sometimes when I go fast. Surprisingly the first version of the script didn’t have this “issue”.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Are these improvements possible?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much and have a good day!&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jul 2015 21:55:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-needed-for-closed-areas/m-p/5725593#M140067</guid>
      <dc:creator>JB-T</dc:creator>
      <dc:date>2015-07-17T21:55:59Z</dc:date>
    </item>
    <item>
      <title>Re: LISP needed for closed areas</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-needed-for-closed-areas/m-p/5725623#M140068</link>
      <description>&lt;P&gt;&lt;SPAN class="hps alt-edited"&gt;Something like this, perhaps...&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(vl-load-com)
(defun c:demo (/ area ent flag lst obj pt tmpH)
  (if (or (not *Hscl*) (/= (type *Hscl*) 'REAL))
    (setq *Hscl* (getvar 'TEXTSIZE))
  )
  (initget 6)
  (setq tmpH (getreal (strcat "\nSpecify Text Height: &amp;lt;" (rtos *Hscl*) "&amp;gt;: ")))
  (if (/= tmpH nil)
    (setq *Hscl* tmpH)
  )
  (while (null flag)
    (cond ((setq pt (getpoint "\nSpecify internal point &amp;lt;exit&amp;gt;: "))
           (if (and (setq lst (entlast))
                    (vl-cmdf "_.-boundary" pt "")
                    (setq ent (entlast))
                    (not (eq lst ent))
               )
             (progn
               (setq obj  (vlax-ename-&amp;gt;vla-object ent)
                     area (vla-get-area obj)
               )
               (entmake (list
                          '(0 . "TEXT")
                          (cons 10 (trans pt 1 0))
                          (cons 40 *Hscl*)
                          (cons 1 (strcat (rtos area 2 2) " m2"))
                          (cons 50 (angle '(0.0 0.0) (getvar 'UCSXDIR)))
                        )
               )
             )
           )
          )
          (T
           (setq flag T)
          )
    )
  )
  (princ)
)&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="hps alt-edited"&gt;Hope this helps, &lt;BR /&gt;Henrique&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jul 2015 22:35:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-needed-for-closed-areas/m-p/5725623#M140068</guid>
      <dc:creator>hmsilva</dc:creator>
      <dc:date>2015-07-17T22:35:39Z</dc:date>
    </item>
    <item>
      <title>Re: LISP needed for closed areas</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-needed-for-closed-areas/m-p/5741064#M140069</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you Henrique for the last version!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I have been using it during the past week and it works pretty well, saved me a lot of time.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I noted &lt;/SPAN&gt;&lt;SPAN&gt;a couple of improvements that I would like to bring to this wonderful routine if it is possible :&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;1 - I would like the routine to disable Osnap when it starts. However, It would not Clear all the prefered Object Snap modes.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2 - I noticed that sometimes after using the routine, the Lasso selection method becomes enabled. Is there something in this Lisp that could explain a change in the selection mode? If yes, could it be modify to stop it to be enabled?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;3 - I don't know it is possible, but I would like to have the insertion point of the text zone in its center instead of having it in the left down corner.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;4 - Finally, I would like to know how I can modify the routine if I decide to use a comma instead of a point&amp;nbsp;to separate the decimals and to remove the "m2" of the annotation.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Thank you again for your time, I really appreciate your help!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;JBT&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 26 Jul 2015 19:36:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-needed-for-closed-areas/m-p/5741064#M140069</guid>
      <dc:creator>JB-T</dc:creator>
      <dc:date>2015-07-26T19:36:21Z</dc:date>
    </item>
    <item>
      <title>Re: LISP needed for closed areas</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-needed-for-closed-areas/m-p/5741087#M140070</link>
      <description>&lt;P&gt;Hi JBT,&lt;BR /&gt;you're welcome!&lt;/P&gt;
&lt;P&gt;I'm with an old laptop and a very old AutoCAD version, so I can't test 'the Lasso selection method becomes enabled', only next week...&lt;SPAN class="hps"&gt;but&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;I can not understand&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;why&lt;/SPAN&gt; it &lt;SPAN class="hps alt-edited"&gt;becomes&lt;/SPAN&gt; &lt;SPAN class="hps"&gt;enabled...&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(vl-load-com)
(defun c:demo (/ *error* area ent lst obj osm pt tmpH)

  (defun *error* (msg)
    (if osm
      (setvar 'OSMODE osm)
    )
    (cond ((not msg))
          ((member msg '("Function cancelled" "quit / exit abort")))
          ((princ (strcat "\n** Error: " msg " ** ")))
    )
    (princ)
  )

  (setq osm (getvar 'OSMODE))
  (setvar 'OSMODE (+ osm 16384))
  (if (or (not *Hscl*) (/= (type *Hscl*) 'REAL))
    (setq *Hscl* (getvar 'TEXTSIZE))
  )
  (initget 6)
  (setq tmpH (getreal (strcat "\nSpecify Text Height: &amp;lt;" (rtos *Hscl*) "&amp;gt;: ")))
  (if (/= tmpH nil)
    (setq *Hscl* tmpH)
  )
  (while (and (setq lst (entlast))
              (setq pt (getpoint "\nSpecify internal point: "))
              (vl-cmdf "_.-boundary" pt "")
              (setq ent (entlast))
              (not (eq lst ent))
         )
    (setq obj  (vlax-ename-&amp;gt;vla-object ent)
          area (vla-get-area obj)
    )
    (entmake (list
               '(0 . "TEXT")
               '(10 0.0 0.0 0.0)
               (cons 40 *Hscl*)
               (cons 1 (strcat (rtos area 2 2) " m2"))
               (cons 50 (angle '(0.0 0.0) (getvar 'UCSXDIR)))
               '(72 . 1)
               (cons 11 (trans pt 1 0))
               '(73 . 2)
             )
    )
  )
  (*error* nil)
  (princ)
)&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="hps"&gt;The text is justified to 'middle center', if you need to justify to 'center', change the (73 . 2) to (73 . 0)&lt;BR /&gt;To remove the "m2" of the annotation, just change the (cons 1 (strcat (rtos area 2 2) " m2")) to (cons 1 (rtos area 2 2))&lt;BR /&gt;To change the point to a comma, change the (cons 1 (rtos area 2 2)) to (cons 1 (vl-string-subst "," "." (rtos area 2 2)))&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="hps"&gt;Hope this helps, &lt;BR /&gt;Henrique&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 26 Jul 2015 20:23:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-needed-for-closed-areas/m-p/5741087#M140070</guid>
      <dc:creator>hmsilva</dc:creator>
      <dc:date>2015-07-26T20:23:37Z</dc:date>
    </item>
    <item>
      <title>Re : LISP needed for closed areas</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-needed-for-closed-areas/m-p/6686694#M140071</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have been using this awesome routine for a year now and I have notice an issue with OSMODE.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Every now and then I receive this message, when I try to launch the routine by typing the command :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;** Error : variable setting rejected : OSMODE 35361 **&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The 5-digits number at the end varies all the time.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I noticed that when it happens, I just have to enable 2D OSNAP from&amp;nbsp;my bottom bar and then it is possible for me to launch the routine properly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the code I use, with minor adjustements from hmsilva latest version.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;(vl-load-com)
(defun c:plani (/ *error* area ent lst obj osm pt tmpH)
(defun *error* (msg)
(if osm
(setvar 'OSMODE osm)
)
(cond ((not msg))
((member msg '("Function cancelled" "quit / exit abort")))
((princ (strcat "\n** Error: " msg " ** ")))
)
(princ)
)
(setq osm (getvar 'OSMODE))
(setvar 'OSMODE (+ osm 16384))
(if (or (not *Hscl*) (/= (type *Hscl*) 'REAL))
(setq *Hscl* (getvar 'TEXTSIZE))
)
(initget 6)
(setq tmpH (getreal (strcat "\nSpecify Text Height: &amp;lt;" (rtos *Hscl*) "&amp;gt;: ")))
(if (/= tmpH nil)
(setq *Hscl* tmpH)
)
(while (and (setq lst (entlast))
(setq pt (getpoint "\nSpecify internal point: "))
(vl-cmdf "_.-boundary" pt "")
(setq ent (entlast))
(not (eq lst ent))
)
(setq obj (vlax-ename-&amp;gt;vla-object ent)
area (vla-get-area obj)
)
(entmake (list
'(0 . "TEXT")
'(10 0.0 0.0 0.0)
(cons 40 *Hscl*)
(cons 1 (strcat (vl-string-subst "," "." (rtos area 2 2))))
(cons 50 (angle '(0.0 0.0) (getvar 'UCSXDIR)))
'(72 . 1)
(cons 11 (trans pt 1 0))
'(73 . 2)
)
)
)
(*error* nil)
(princ)
)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can someone help me fix the problem?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your time !&lt;/P&gt;</description>
      <pubDate>Mon, 14 Nov 2016 17:57:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-needed-for-closed-areas/m-p/6686694#M140071</guid>
      <dc:creator>JB-T</dc:creator>
      <dc:date>2016-11-14T17:57:22Z</dc:date>
    </item>
    <item>
      <title>Re : LISP needed for closed areas</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-needed-for-closed-areas/m-p/6686758#M140072</link>
      <description>&lt;P&gt;Look into &amp;nbsp;what the system variable OSOPTIONS &amp;nbsp;current value when the program is not showing the error. then include that on the routine, see if that&amp;nbsp;error goes away.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(if	osm
      &lt;FONT color="#0000FF"&gt;(mapcar 
	'setvar 
	  '("OSMODE" "OSOPTIONS")
	    (list osm oso )
	    )&lt;/FONT&gt;
    )

....

 (setq osm (getvar 'OSMODE)
        &lt;FONT color="#0000FF"&gt;oso (getvar 'OSOPTIONS)&lt;/FONT&gt;)
    
  (setvar 'OSMODE (+ osm 16384))
  &lt;FONT color="#0000FF"&gt;(setvar 'OSOPTIONS 4)&lt;/FONT&gt; ;&amp;lt;-- your preferred value

...&lt;/PRE&gt;
&lt;P&gt;Not&amp;nbsp;&amp;nbsp;tested it as i can't seem to reproduce that same error on my pc.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;HTH&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Nov 2016 18:24:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-needed-for-closed-areas/m-p/6686758#M140072</guid>
      <dc:creator>pbejse</dc:creator>
      <dc:date>2016-11-14T18:24:51Z</dc:date>
    </item>
    <item>
      <title>Re : LISP needed for closed areas</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-needed-for-closed-areas/m-p/6686889#M140073</link>
      <description>&lt;P&gt;when you pass&lt;STRONG&gt; (setvar 'OSMODE (+ osm 16384))&lt;/STRONG&gt;, this will turn off object snap (similar to hitting F3 key).However, in the current code you posted there is no check done to see if&amp;nbsp;object snap is already off&amp;nbsp;(anytime the osmode variable is higher than 16384, it means 2D object snap is off).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try replacing&lt;/P&gt;
&lt;PRE&gt;(setvar 'OSMODE (+ osm 16384))&lt;/PRE&gt;
&lt;P&gt;with&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(if (&amp;lt; osm 16384) (setvar 'osmode (+ osm 16384)))&lt;/PRE&gt;</description>
      <pubDate>Mon, 14 Nov 2016 19:38:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-needed-for-closed-areas/m-p/6686889#M140073</guid>
      <dc:creator>Ranjit_Singh</dc:creator>
      <dc:date>2016-11-14T19:38:18Z</dc:date>
    </item>
    <item>
      <title>Re : LISP needed for closed areas</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-needed-for-closed-areas/m-p/6687453#M140074</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/3261555"&gt;@Ranjit_Singh&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;....the osmode variable is higher than 16384, it means 2D object snap is off)&amp;nbsp;...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;That makes a whole lot of sense.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 15 Nov 2016 02:04:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-needed-for-closed-areas/m-p/6687453#M140074</guid>
      <dc:creator>pbejse</dc:creator>
      <dc:date>2016-11-15T02:04:42Z</dc:date>
    </item>
    <item>
      <title>Re : LISP needed for closed areas</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-needed-for-closed-areas/m-p/6688023#M140075</link>
      <description>&lt;P&gt;Thank you to both contributors, this fixed my problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have a good day !&lt;/P&gt;</description>
      <pubDate>Tue, 15 Nov 2016 11:21:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-needed-for-closed-areas/m-p/6688023#M140075</guid>
      <dc:creator>JB-T</dc:creator>
      <dc:date>2016-11-15T11:21:38Z</dc:date>
    </item>
    <item>
      <title>Re: LISP needed for closed areas</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-needed-for-closed-areas/m-p/10972236#M140076</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;I have been using the following routine alot in the last 6 years. It is trully awesome, I will never thank you guys enough for it, but I would like to modify a detail in order to gain productivity.&lt;/P&gt;&lt;P&gt;When I click in a "seem-to-be-closed-area",&amp;nbsp; and it happens that this area is not really closed, AutoCAD exits the command and I have to invoke it again.&lt;/P&gt;&lt;P&gt;Can you guys modify the routine in order that AutoCAD won't exit the command when I click in a non-closed area ?&lt;/P&gt;&lt;P&gt;Thanks alot !&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(vl-load-com)&lt;BR /&gt;(defun c:planii (/ *error* area ent lst obj osm pt tmpH)&lt;/P&gt;&lt;P&gt;(defun *Erreur* (msg)&lt;BR /&gt;(if osm&lt;BR /&gt;(setvar 'OSMODE osm)&lt;BR /&gt;)&lt;BR /&gt;(cond ((not msg))&lt;BR /&gt;((member msg '("Fonction annulée" "quit / exit abort")))&lt;BR /&gt;((princ (strcat "\n** Erreur: " msg " ** ")))&lt;BR /&gt;)&lt;BR /&gt;(princ)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;(setq osm (getvar 'OSMODE))&lt;BR /&gt;(if (&amp;lt; osm 16384) (setvar 'osmode (+ osm 16384)))&lt;BR /&gt;(if (or (not *Hscl*) (/= (type *Hscl*) 'REAL))&lt;BR /&gt;(setq *Hscl* (getvar 'TEXTSIZE))&lt;BR /&gt;)&lt;BR /&gt;(initget 6)&lt;BR /&gt;(setq tmpH (getreal (strcat "\nEntrer la hauteur de texte à utiliser &amp;lt;" (rtos *Hscl*) "&amp;gt;: ")))&lt;BR /&gt;(if (/= tmpH nil)&lt;BR /&gt;(setq *Hscl* tmpH)&lt;BR /&gt;)&lt;BR /&gt;(while (and (setq lst (entlast))&lt;BR /&gt;(setq pt (getpoint "\nCliquer dans la zone à mesurer "))&lt;BR /&gt;(vl-cmdf "_.-boundary" pt "")&lt;BR /&gt;(setq ent (entlast))&lt;BR /&gt;(not (eq lst ent))&lt;BR /&gt;)&lt;BR /&gt;(setq obj (vlax-ename-&amp;gt;vla-object ent)&lt;BR /&gt;area (vla-get-area obj)&lt;BR /&gt;)&lt;BR /&gt;(entmake (list&lt;BR /&gt;'(0 . "TEXT")&lt;BR /&gt;'(10 0.0 0.0 0.0)&lt;BR /&gt;(cons 40 *Hscl*)&lt;BR /&gt;(cons 1 (strcat (vl-string-subst "," "." (rtos area 2 2))))&lt;BR /&gt;(cons 50 (angle '(0.0 0.0) (getvar 'UCSXDIR)))&lt;BR /&gt;'(72 . 1)&lt;BR /&gt;(cons 11 (trans pt 1 0))&lt;BR /&gt;'(73 . 2)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;(*Erreur* nil)&lt;BR /&gt;(princ)&lt;BR /&gt;)&lt;/P&gt;</description>
      <pubDate>Fri, 25 Feb 2022 16:21:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-needed-for-closed-areas/m-p/10972236#M140076</guid>
      <dc:creator>JB-T</dc:creator>
      <dc:date>2022-02-25T16:21:06Z</dc:date>
    </item>
    <item>
      <title>Re: LISP needed for closed areas</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-needed-for-closed-areas/m-p/10972537#M140077</link>
      <description>&lt;P&gt;Comment this line :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(not (eq lst ent))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(just put ; in front)&lt;/P&gt;</description>
      <pubDate>Fri, 25 Feb 2022 19:05:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-needed-for-closed-areas/m-p/10972537#M140077</guid>
      <dc:creator>marko_ribar</dc:creator>
      <dc:date>2022-02-25T19:05:09Z</dc:date>
    </item>
  </channel>
</rss>

