<?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: Why does the code stop in the middle of the process? in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/why-does-the-code-stop-in-the-middle-of-the-process/m-p/9282339#M79144</link>
    <description>&lt;P&gt;&lt;FONT size="4"&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1779365"&gt;@ВeekeeCZ&lt;/a&gt;&amp;nbsp; Thanks!! it works.&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 29 Jan 2020 13:12:39 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-01-29T13:12:39Z</dc:date>
    <item>
      <title>Why does the code stop in the middle of the process?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/why-does-the-code-stop-in-the-middle-of-the-process/m-p/9282221#M79142</link>
      <description>&lt;P&gt;&lt;FONT size="4"&gt;This code works relatively well, however when I run it for the first time it generates&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;&lt;EM&gt;&lt;FONT size="4"&gt;Error: bad argument type: stringp nilbad argument type: stringp #&amp;lt;FILE internal&amp;gt;&amp;nbsp;&lt;/FONT&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#333333"&gt;&lt;FONT size="4"&gt;and does not end.&amp;nbsp;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size="4"&gt;I've done it step by step and I don't understand why, any guidance?&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;;;--------------------- { Get Attribute Value  -  Lee Mac } --------------------;;
;;                                                                              ;;
;;------------------------------------------------------------------------------;;
;;  Autor: Lee Mac                                                              ;;
;;------------------------------------------------------------------------------;;
;;  Argumentos:                                                                 ;;
;;   blk - [vla] VLA Block Reference Object                                     ;;
;;   tag - [str] Attribute TagString                                            ;;
;;------------------------------------------------------------------------------;;

(defun LM:vl-getattributevalue ( blk tag )
  (setq tag (strcase tag))
  (vl-some '(lambda ( att ) (if (= tag (strcase (vla-get-tagstring att))) (vla-get-textstring att))) (vlax-invoke blk 'getattributes))
)

;;--------------------- { Set attributevalue  -  Lee Mac- } --------------------;;
;;                                                                              ;;
;;------------------------------------------------------------------------------;;
;;  Autor: Lee Mac                                                              ;;
;;------------------------------------------------------------------------------;;
;;  Argumentos:                                                                 ;;
;;   blk - [vla] VLA Block Reference Object                                     ;;
;;   tag - [str] Attribute TagString                                            ;;
;;   val - [str] Attribute Value                                                ;;
;;------------------------------------------------------------------------------;;


(defun LM:vl-setattributevalue ( blk tag val )
  (setq tag (strcase tag))
    (vl-some '(lambda ( att )(if (= tag (strcase (vla-get-tagstring att))) (progn (vla-put-textstring att val) val)))(vlax-invoke blk 'getattributes))
)

;;------------------------------------------------------------------------------;;

(defun c:EXTRELATORIO (/ ss file i blk vatt ratt ip ss2 att1 att2 att3 att4 att5 )
    (defun *error* (errmsg)
        (if (not (wcmatch errmsg "Function cancelled,quit / exit abort,console break"))
            (princ (strcat "\nError: " errmsg))
        )
        (close file)
        (vl-file-delete file)
      (princ)
    )
    (setq ss (ssget '((0 . "INSERT") (66 . 1)(2 . "Poste_Enel,`*U*"))))
    (setq file (open (strcat (getvar 'dwgprefix) (vl-filename-base (getvar 'dwgname)) ".txt") "w"))
    (write-line "Numero;Latitude;Longitude;Relatorio" file )
    (repeat (setq i (sslength ss))
        (setq blk (vlax-ename-&amp;gt;vla-object (ssname ss (setq i (1- i)))))
        (setq vatt '("NUM" "LATITUDE" "LONGITUDE" "RELATORIO"))
        (setq ratt (mapcar '(lambda (x) (LM:vl-getattributevalue blk x)) vatt))
        ;(setq ratt (mapcar '(lambda (x) (vl-some '(lambda ( att ) (if (= (strcase x) (strcase (vla-get-tagstring att))) (vla-get-textstring att))) (vlax-invoke blk 'getattributes))) vatt)) &amp;lt;- Melhor!
        (mapcar 'set '(att1 att2 att3 att4) ratt)
        (setq ip (vlax-get blk 'insertionpoint))
        (setq ss2 (ssget "_C" (mapcar '+ ip '(5 5)) (mapcar '- ip '(5 5)) '((0 . "INSERT")(66 . 1)(2 . "Caixa001,Caixa002,Caixa003,Caixa004,Caixa005,Caixa006"))))
        (if (/= ss2 nil)
            (if (= (sslength ss2) 1)
                (progn
                    (setq blk2 (vlax-ename-&amp;gt;vla-object (ssname ss2 0)))
                    (LM:vl-setattributevalue blk2 "IDCX" att1)
                    (setq att5 (LM:vl-getattributevalue blk2 "NOM"))
                )
            )
            (setq att5 "")
        )
        (write-line (strcat  att1 ";" att2 ";" att3 ";" att4 ";" att5 ) file )
     )
    (close file)
    ;(startapp "notepad" "G:\\Meu Drive\\Brisanet Programas\\Desenhos\\Extrator Material\\Teste-.txt")  
    (princ)
)
&lt;/PRE&gt;</description>
      <pubDate>Wed, 29 Jan 2020 12:41:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/why-does-the-code-stop-in-the-middle-of-the-process/m-p/9282221#M79142</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-01-29T12:41:35Z</dc:date>
    </item>
    <item>
      <title>Re: Why does the code stop in the middle of the process?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/why-does-the-code-stop-in-the-middle-of-the-process/m-p/9282271#M79143</link>
      <description>&lt;P&gt;Because your selection filter is not good enough to filter out all useless blocks.&lt;/P&gt;
&lt;P&gt;They are dynamic blocks, anonymous, you need to filter them by their&lt;STRONG&gt; Effective name&lt;/STRONG&gt;!&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jan 2020 13:08:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/why-does-the-code-stop-in-the-middle-of-the-process/m-p/9282271#M79143</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2020-01-29T13:08:12Z</dc:date>
    </item>
    <item>
      <title>Re: Why does the code stop in the middle of the process?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/why-does-the-code-stop-in-the-middle-of-the-process/m-p/9282339#M79144</link>
      <description>&lt;P&gt;&lt;FONT size="4"&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1779365"&gt;@ВeekeeCZ&lt;/a&gt;&amp;nbsp; Thanks!! it works.&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jan 2020 13:12:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/why-does-the-code-stop-in-the-middle-of-the-process/m-p/9282339#M79144</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-01-29T13:12:39Z</dc:date>
    </item>
    <item>
      <title>Re: Why does the code stop in the middle of the process?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/why-does-the-code-stop-in-the-middle-of-the-process/m-p/9282354#M79145</link>
      <description>&lt;P&gt;you're welcome,&amp;nbsp;@Anonymous&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jan 2020 13:15:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/why-does-the-code-stop-in-the-middle-of-the-process/m-p/9282354#M79145</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2020-01-29T13:15:27Z</dc:date>
    </item>
    <item>
      <title>Re: Why does the code stop in the middle of the process?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/why-does-the-code-stop-in-the-middle-of-the-process/m-p/9283358#M79146</link>
      <description>&lt;P&gt;FWIW .. a quick observation:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Might want to check that these two are valid before continuing:&lt;/P&gt;&lt;PRE&gt;(if (and (setq ss (ssget '((0 . "INSERT") (66 . 1) (2 . "Poste_Enel,`*U*"))))
	   (setq
	     file (open (strcat (getvar 'dwgprefix) (vl-filename-base (getvar 'dwgname)) ".txt") "w")
	   )
      )
    (progn . . .)
  )&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This logic:&lt;/P&gt;&lt;PRE&gt;    (setq ss2
	   (ssget
	     "_C"
	     (mapcar '+ ip '(5 5))
	     (mapcar '- ip '(5 5))
	     '((0 . "INSERT") (66 . 1) (2 . "Caixa001,Caixa002,Caixa003,Caixa004,Caixa005,Caixa006"))
	   )
    )
    (if	(/= ss2 nil)
      (if (= (sslength ss2) 1)
	(progn (setq blk2 (vlax-ename-&amp;gt;vla-object (ssname ss2 0)))
	       (lm:vl-setattributevalue blk2 "IDCX" att1)
	       (setq att5 (lm:vl-getattributevalue blk2 "NOM"))
	)
      )
      (setq att5 "")
    )&lt;/PRE&gt;&lt;P&gt;Could be written like this:&lt;/P&gt;&lt;PRE&gt;(if	(and (setq ss2 (ssget "_C"
			      (mapcar '+ ip '(5 5))
			      (mapcar '- ip '(5 5))
			      '((0 . "INSERT")
				(66 . 1)
				(2 . "Caixa001,Caixa002,Caixa003,Caixa004,Caixa005,Caixa006")
			       )
		       )
	     )
	     (= (sslength ss2) 1)
	)
      (progn (setq blk2 (vlax-ename-&amp;gt;vla-object (ssname ss2 0)))
	     (lm:vl-setattributevalue blk2 "IDCX" att1)
	     (setq att5 (lm:vl-getattributevalue blk2 "NOM"))
      )
      (setq att5 "")
    )&lt;/PRE&gt;&lt;P&gt;And don't need to set all the 'att#' variables:&lt;/P&gt;&lt;PRE&gt;    ;; (write-line (strcat att1 ";" att2 ";" att3 ";" att4 ";" att5) file)
    (write-line
      (apply 'strcat (mapcar '(lambda (x) (strcat x ",")) (append ratt (list att5))))
      file
    )&lt;/PRE&gt;&lt;P&gt;That being said ... either way works :).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jan 2020 18:10:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/why-does-the-code-stop-in-the-middle-of-the-process/m-p/9283358#M79146</guid>
      <dc:creator>ronjonp</dc:creator>
      <dc:date>2020-01-29T18:10:02Z</dc:date>
    </item>
    <item>
      <title>Betreff: Why does the code stop in the middle of the process?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/why-does-the-code-stop-in-the-middle-of-the-process/m-p/9283904#M79147</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/593837"&gt;@ronjonp&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You quote the SSGET expression, but this part was the first mistake, the TO solved it and check the effectivenames now.&lt;/P&gt;
&lt;P&gt;(both ssget parts were a problem in the original post)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;@Anonymous&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You fixed the filterproblem for Poste_Enel, but did you also changed the second ssget part too?&lt;/P&gt;
&lt;P&gt;There is the same problem.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;And there is another thing&lt;/STRONG&gt; what can be the next problem.&lt;/P&gt;
&lt;P&gt;Even if you filters the right blockreferences (effectivename) well, it is still possible&lt;/P&gt;
&lt;P&gt;that your block reference does not contain all expected attributes!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This causes the STRCAT&amp;nbsp; fail again (STRCAT was function where the ERROR started)&lt;/P&gt;
&lt;P&gt;because a variable does not contain a string, but is nil.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try it in my attached File, i edited the Blockreference in the red border- what is often a problem in files from outside.&lt;/P&gt;
&lt;P&gt;Your code will work with the item in the green border, but not with the one in the red border.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Better to check that att1-4 all true&lt;/P&gt;
&lt;P&gt;(and att1 att2 att3 att4) =&amp;gt; T = okay&lt;/P&gt;
&lt;P&gt;(and att1 att2 att3 att4) =&amp;gt; nil = something wrong&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;--&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;And there is another thing&lt;/STRONG&gt;.&lt;/P&gt;
&lt;P&gt;You are using a graphic depend ssget mode, the "C ross" mode.&lt;/P&gt;
&lt;P&gt;In AutoCAD the window, cross, a,o. are depends of the current VIEW&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;(and the given coordinates are depending on the current UCS, which can be different from the current view)&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;SSGET works equal to the standard objectselection method, so it is true for ssget too.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Because of this i miss your View Handling, a ZOOM Object SS&amp;nbsp;&amp;nbsp; and ZOOM Previous for example.&lt;/P&gt;
&lt;P&gt;Test this also in my attached file,&lt;/P&gt;
&lt;P&gt;Re- open my file, delete the edited blockreference in the red border.&lt;/P&gt;
&lt;P&gt;zoom to the left blockreference, so the right couple is outside your file window.&lt;/P&gt;
&lt;P&gt;run your code - (use selection method ALL) -it works but it doesn't change the IDX value of the Caixa003&lt;/P&gt;
&lt;P&gt;ZOOM EXTENTS&lt;/P&gt;
&lt;P&gt;run your code - (use selection method ALL) - it works and it&amp;nbsp; change the IDX value of the Caixa003&lt;/P&gt;
&lt;P&gt;That how some autocad selection methods works.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Instead of&amp;nbsp; selection method ALL you can also select all objects by window selection, but zoom to only the left item before you end the selection method.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;[EDIT: File]&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jan 2020 21:09:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/why-does-the-code-stop-in-the-middle-of-the-process/m-p/9283904#M79147</guid>
      <dc:creator>cadffm</dc:creator>
      <dc:date>2020-01-29T21:09:16Z</dc:date>
    </item>
    <item>
      <title>Betreff: Why does the code stop in the middle of the process?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/why-does-the-code-stop-in-the-middle-of-the-process/m-p/9283924#M79148</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/71745"&gt;@cadffm&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/593837"&gt;@ronjonp&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You quote the SSGET expression, but this part was the first mistake, the TO solved it and check the effectivenames now.&lt;/P&gt;&lt;P&gt;(both ssget parts were a problem in the original post)&lt;/P&gt;&lt;P&gt;[EDIT: File]&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/71745"&gt;@cadffm&lt;/a&gt;&amp;nbsp;Not sure what you're saying here ? My response was a quick observation and had nothing to do directly with the problem at hand, only refactoring for logic.&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":clinking_beer_mugs:"&gt;🍻&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jan 2020 21:16:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/why-does-the-code-stop-in-the-middle-of-the-process/m-p/9283924#M79148</guid>
      <dc:creator>ronjonp</dc:creator>
      <dc:date>2020-01-29T21:16:04Z</dc:date>
    </item>
    <item>
      <title>Betreff: Why does the code stop in the middle of the process?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/why-does-the-code-stop-in-the-middle-of-the-process/m-p/9283990#M79149</link>
      <description>&lt;P&gt;&amp;gt;"&lt;FONT size="6"&gt;only&lt;/FONT&gt; refactoring for logic"&lt;/P&gt;
&lt;P&gt;and these are good hints for the TO &lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jan 2020 21:53:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/why-does-the-code-stop-in-the-middle-of-the-process/m-p/9283990#M79149</guid>
      <dc:creator>cadffm</dc:creator>
      <dc:date>2020-01-29T21:53:40Z</dc:date>
    </item>
    <item>
      <title>Re: Why does the code stop in the middle of the process?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/why-does-the-code-stop-in-the-middle-of-the-process/m-p/9285556#M79150</link>
      <description>&lt;P&gt;&lt;FONT size="4"&gt;Thanks for the suggestions, you are always fantastic&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="4"&gt;Follow your advice and I'm still working on the final result.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="4"&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/71745"&gt;@cadffm&lt;/a&gt;&amp;nbsp; Yes yes I made some changes to the selection set and it worked better !!! And in relation to the block "LATI_WHAT" I will analyze.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="4"&gt;Attaching what I have so far, I changed the name of the variables to better understand.&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="4"&gt;The problem at the moment is that some values are exported in duplicate. But I will find out how to fix this.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;FONT size="4"&gt;Thank you so much guys.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;;;Get Attribute Value  -  Lee Mac
(defun LM:vl-getattributevalue ( blk tag )
  (setq tag (strcase tag))
  (vl-some '(lambda ( att ) (if (= tag (strcase (vla-get-tagstring att))) (vla-get-textstring att))) (vlax-invoke blk 'getattributes))
)

;; Set attributevalue -  Lee Mac
(defun LM:vl-setattributevalue ( blk tag val )
  (setq tag (strcase tag))
    (vl-some '(lambda ( att )(if (= tag (strcase (vla-get-tagstring att))) (progn (vla-put-textstring att val) val)))(vlax-invoke blk 'getattributes))
)
    
;;-------------------------------------------------------------------------;;

(defun c:TESTE (/ file selection contador blkobj attributes stealattribute Numero latitudeude longitude relatorio baseblkselection selecionXdistancetxtCX  )

    (defun *error* (errmsg)
        (if (not (wcmatch errmsg "Function cancelled,quit / exit abort,console break"))
            (princ (strcat "\nError: " errmsg))
        )
        (close file)
        (vl-file-delete file)
        (princ)
    )
  
    (if
        (and
            (setq selection
                (ssget "_X"
                    '( 
                        (-4 . "&amp;lt;OR")
                            (-4 . "&amp;lt;AND")(0 . "INSERT")(66 . 1)(2 . "Poste_Enel")(8 . "D_Poste")(-4 . "AND&amp;gt;")
                            (-4 . "&amp;lt;AND")(0 . "INSERT")(66 . 1)(2 . "`*U*")(8 . "D_Poste")(-4 . "AND&amp;gt;")
                        (-4 . "OR&amp;gt;")
                    )
                )
            )
            (setq file (open (strcat (getvar 'dwgprefix) (vl-filename-base (getvar 'dwgname)) ".csv") "w"))
        )
        (progn
            (write-line "Numero,Latitude,Longitude,Relatorio,Caixa" file )
            (repeat (setq contador (sslength selection))
                (setq blkobj (vlax-ename-&amp;gt;vla-object (ssname selection (setq contador (1- contador)))))
                (setq attributes '("NUM" "LATITUDE" "LONGITUDE" "RELATORIO"))
                (setq stealattribute (mapcar '(lambda ( x ) (LM:vl-getattributevalue blkobj x )) attributes ))
                (mapcar 'set '(Numero latitudeude longitude relatorio) stealattribute)
                (setq baseblkselection (vlax-get blkobj 'insertionpoint))
                (if
                    (and
                        (setq selecionXdistance
                            (ssget "_C"
                                (mapcar '+ baseblkselection '(5 5)) 
                                (mapcar '- baseblkselection '(5 5))
                                '(
                                    (-4 . "&amp;lt;AND")
                                        (0 . "INSERT")
                                        (66 . 1)
                                        (2 . "`*U*,Caixa001,Caixa002,Caixa003,Caixa004,Caixa005,Caixa006")
                                        (8 . "P_Caixa001,P_Caixa002,P_Caixa003,P_Caixa004,P_Caixa005,P_Caixa006")
                                    (-4 . "AND&amp;gt;")
                                )
                            )
                        )
                        (= (sslength selecionXdistance) 1)
                    )
                    (progn 
                        (setq blkobjCX (vlax-ename-&amp;gt;vla-object (ssname selecionXdistance 0)))
                        (LM:vl-setattributevalue blkobjCX "IDCX" Numero)
                        (setq txtCX (LM:vl-getattributevalue blkobjCX "NOM"))
                    )
                    (setq txtCX "")
                )
                (write-line
                    (apply 'strcat (mapcar '(lambda (x) (strcat x ",")) (append stealattribute (list txtCX))))
                    file
                )
            )
          (close file)
        )
    )
  (startapp "notepad" (strcat (getvar 'dwgprefix) (vl-filename-base (getvar 'dwgname)) ".txt"))
  (princ)
)
;;(c:TESTE)&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="duplicate.JPG" style="width: 580px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/723749i5E94438C8E7303C4/image-size/large?v=v2&amp;amp;px=999" role="button" title="duplicate.JPG" alt="duplicate.JPG" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jan 2020 13:59:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/why-does-the-code-stop-in-the-middle-of-the-process/m-p/9285556#M79150</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-01-30T13:59:45Z</dc:date>
    </item>
    <item>
      <title>Re: Why does the code stop in the middle of the process?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/why-does-the-code-stop-in-the-middle-of-the-process/m-p/9285593#M79151</link>
      <description>&lt;P&gt;oh.&lt;/P&gt;
&lt;P&gt;near to "nothing" is really fixed in this version,&lt;/P&gt;
&lt;P&gt;I see the problems, know how to fix it, but no time for this at the moment, wish you a lot of support from the others, I am withdrawing. &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jan 2020 14:10:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/why-does-the-code-stop-in-the-middle-of-the-process/m-p/9285593#M79151</guid>
      <dc:creator>cadffm</dc:creator>
      <dc:date>2020-01-30T14:10:40Z</dc:date>
    </item>
    <item>
      <title>Re: Why does the code stop in the middle of the process?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/why-does-the-code-stop-in-the-middle-of-the-process/m-p/9285654#M79152</link>
      <description>&lt;P&gt;Sorry .. I don't know what you are trying to accomplish.&lt;/P&gt;&lt;P&gt;Another tip to simplify your filter though &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;PRE&gt;(2 . "`*U*,Caixa00[1-6]")
(8 . "P_Caixa00[1-6]")&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jan 2020 14:27:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/why-does-the-code-stop-in-the-middle-of-the-process/m-p/9285654#M79152</guid>
      <dc:creator>ronjonp</dc:creator>
      <dc:date>2020-01-30T14:27:10Z</dc:date>
    </item>
    <item>
      <title>Re: Why does the code stop in the middle of the process?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/why-does-the-code-stop-in-the-middle-of-the-process/m-p/9285665#M79153</link>
      <description>&lt;P&gt;I did dig into it very much... I can see this:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="image.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/723782i4C6289D964C6DEC8/image-size/medium?v=v2&amp;amp;px=400" role="button" title="image.png" alt="image.png" /&gt;&lt;/span&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Should not the second selection (crossing one) select only the block that matches this number?&amp;nbsp; 076 vs 076&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jan 2020 14:30:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/why-does-the-code-stop-in-the-middle-of-the-process/m-p/9285665#M79153</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2020-01-30T14:30:28Z</dc:date>
    </item>
    <item>
      <title>Re: Why does the code stop in the middle of the process?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/why-does-the-code-stop-in-the-middle-of-the-process/m-p/9285722#M79154</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="4"&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/71745"&gt;@cadffm&lt;/a&gt;&amp;nbsp;Thanks, I will follow your suggestions and search on (effectivename) !!!&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="4"&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/593837"&gt;@ronjonp&lt;/a&gt;&amp;nbsp;Thanks, I'll use it &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; I'm trying to collect and export data from a few different blocks.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="4"&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1779365"&gt;@ВeekeeCZ&lt;/a&gt;&amp;nbsp;Exactly!! now how to fix it. . .? I need to select with "selectXdistance" if it is in the same rotation. . . ? I have to think of a solution.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jan 2020 14:45:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/why-does-the-code-stop-in-the-middle-of-the-process/m-p/9285722#M79154</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-01-30T14:45:28Z</dc:date>
    </item>
    <item>
      <title>Re: Why does the code stop in the middle of the process?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/why-does-the-code-stop-in-the-middle-of-the-process/m-p/9285732#M79155</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1779365"&gt;@ВeekeeCZ&lt;/a&gt;&amp;nbsp; schrieb:&lt;BR /&gt;
&lt;P&gt;Should not the second selection (crossing one) select only the block that matches this number?&amp;nbsp; 076 vs 076&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Yes and no, the second searchs for&lt;/P&gt;
&lt;PRE&gt;Caixa001,Caixa002,Caixa003,Caixa004,Caixa005,Caixa006&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and if found, override this attributvalue with the value from the block&amp;nbsp;Poste_Enel (to make sure the "couples have the same idx number. )&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The TO needs a "remember Handle-list": &amp;gt;If found more than one time =&amp;gt; ALERT&lt;/P&gt;</description>
      <pubDate>Thu, 30 Jan 2020 14:48:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/why-does-the-code-stop-in-the-middle-of-the-process/m-p/9285732#M79155</guid>
      <dc:creator>cadffm</dc:creator>
      <dc:date>2020-01-30T14:48:44Z</dc:date>
    </item>
    <item>
      <title>Re: Why does the code stop in the middle of the process?</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/why-does-the-code-stop-in-the-middle-of-the-process/m-p/9286293#M79156</link>
      <description>&lt;P&gt;&lt;FONT size="4"&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/71745"&gt;@cadffm&lt;/a&gt;&amp;nbsp; when you talk about effectivename is that what you mean?&lt;/FONT&gt;&lt;/P&gt;
&lt;PRE&gt;(setq blkname (vla-get-effectivename (setq blkobj (vlax-ename-&amp;gt;vla-object (ssname selection (setq contador (1- contador)))))))&lt;/PRE&gt;
&lt;P&gt;&lt;FONT size="4"&gt;Verification&lt;/FONT&gt;&lt;/P&gt;
&lt;PRE&gt;(if (wcmatch  blkname "Poste_Enel")&lt;BR /&gt; [...]&lt;/PRE&gt;
&lt;P&gt;&lt;FONT size="4"&gt;how to store all the tags of my block in the list ?????&lt;/FONT&gt;&lt;/P&gt;
&lt;PRE&gt;(setq attributes '("NUM" "LATITUDE" "LONGITUDE" "RELATORIO")) ;;&amp;lt;- Como armazenar todas as tags do meu bloco na lista ?????&lt;/PRE&gt;</description>
      <pubDate>Thu, 30 Jan 2020 18:33:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/why-does-the-code-stop-in-the-middle-of-the-process/m-p/9286293#M79156</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-01-30T18:33:21Z</dc:date>
    </item>
  </channel>
</rss>

