<?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: Compare two selection sets to make a fourth out of a third... in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/compare-two-selection-sets-to-make-a-fourth-out-of-a-third/m-p/11710730#M35396</link>
    <description>&lt;P&gt;Hmm spoke too soon.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just tested further and on the original test drawing it only picks up 2 of the 4 trees.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Komondormrex's solution seems to work perfectly.&lt;/P&gt;</description>
    <pubDate>Fri, 27 Jan 2023 16:35:32 GMT</pubDate>
    <dc:creator>dlbsurveysuk</dc:creator>
    <dc:date>2023-01-27T16:35:32Z</dc:date>
    <item>
      <title>Compare two selection sets to make a fourth out of a third...</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/compare-two-selection-sets-to-make-a-fourth-out-of-a-third/m-p/11704466#M35366</link>
      <description>&lt;P&gt;I know what I need to achieve but the coding for it is a bit beyond me...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is this code correct to make two selection sets of the coordinates of, all blocks "PRE", and all on layer "TEXT", and a third set of all the text items on layer "TEXT"?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(setq TRcoord (cdr (assoc 10 (entget (ssname (ssget "_X" '((2 . "PTRE"))) 0)))))
(setq TXTcoord (cdr (assoc 10 (entget (ssname (ssget "_X" '((8 . "TEXT"))) 0)))))
(setq TXTS (ssget "_X" '((8 . "TEXT"))))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If so, I then need to compare the first two selection sets, and make a fourth selection set out of the third one of all selections whose coordinates in the second set match any selection in the first set, then perform a subroutine (defun c:TREN) on each text string in the fourth set...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(when I say match, all the coordinates in the second set have an x value that match by +/-0.001, and have a y value of 0.07 less (+/-0.001) than the match in the first set (does this mean a fuzz factor is involved), and z values are all over the place, but it's only the x,y that I need to pass on to the subroutine.)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope that all makes sense. Not sure if I'm overcomplicating things... Any help appreciated. Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2023 13:27:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/compare-two-selection-sets-to-make-a-fourth-out-of-a-third/m-p/11704466#M35366</guid>
      <dc:creator>dlbsurveysuk</dc:creator>
      <dc:date>2023-01-25T13:27:18Z</dc:date>
    </item>
    <item>
      <title>Re: Compare two selection sets to make a fourth out of a third...</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/compare-two-selection-sets-to-make-a-fourth-out-of-a-third/m-p/11704486#M35367</link>
      <description>&lt;OL&gt;
&lt;LI&gt;If you can't code well, don't try to do too much on each line.&amp;nbsp;&lt;/LI&gt;
&lt;LI&gt;Each line of your posted code will result in the insertion point of a single block, not of a group of blocks. Save the selection sets first.&lt;/LI&gt;
&lt;LI&gt;You've mispelled "PRE" either in your explanation or in your code.&lt;/LI&gt;
&lt;/OL&gt;
&lt;P&gt;Visit leemac's website for a complete discussion of processing selection sets.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2023 13:37:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/compare-two-selection-sets-to-make-a-fourth-out-of-a-third/m-p/11704486#M35367</guid>
      <dc:creator>dbroad</dc:creator>
      <dc:date>2023-01-25T13:37:52Z</dc:date>
    </item>
    <item>
      <title>Re: Compare two selection sets to make a fourth out of a third...</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/compare-two-selection-sets-to-make-a-fourth-out-of-a-third/m-p/11704552#M35368</link>
      <description>&lt;P&gt;Oops yes both should be "PTRE".&lt;/P&gt;&lt;P&gt;Ah ok I see now, so I need to -&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(if (setq PTREset (ssget "_X" '((2 . "PTRE"))))
       (repeat (setq i (sslength PTREset))
              (setq i (1- i))
              (setq TRcoord(cdr )assoc 10 (entget (ssname PTREset i)))
       )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;?&lt;/P&gt;&lt;P&gt;Thanks for the advice, my coding is improving, but slowly...&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2023 13:56:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/compare-two-selection-sets-to-make-a-fourth-out-of-a-third/m-p/11704552#M35368</guid>
      <dc:creator>dlbsurveysuk</dc:creator>
      <dc:date>2023-01-25T13:56:55Z</dc:date>
    </item>
    <item>
      <title>Re: Compare two selection sets to make a fourth out of a third...</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/compare-two-selection-sets-to-make-a-fourth-out-of-a-third/m-p/11704562#M35369</link>
      <description>&lt;P&gt;*&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(setq TRcoord (cdr (assoc 10 (entget (ssname PTREset i))) 0))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2023 14:05:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/compare-two-selection-sets-to-make-a-fourth-out-of-a-third/m-p/11704562#M35369</guid>
      <dc:creator>dlbsurveysuk</dc:creator>
      <dc:date>2023-01-25T14:05:23Z</dc:date>
    </item>
    <item>
      <title>Re: Compare two selection sets to make a fourth out of a third...</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/compare-two-selection-sets-to-make-a-fourth-out-of-a-third/m-p/11704714#M35370</link>
      <description>&lt;P&gt;post the TREN func.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2023 14:37:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/compare-two-selection-sets-to-make-a-fourth-out-of-a-third/m-p/11704714#M35370</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2023-01-25T14:37:39Z</dc:date>
    </item>
    <item>
      <title>Re: Compare two selection sets to make a fourth out of a third...</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/compare-two-selection-sets-to-make-a-fourth-out-of-a-third/m-p/11705146#M35371</link>
      <description>&lt;P&gt;This is the TREN function. Pick a point entity and then the text string in the form (Girth-Spread-Height-Species) that is sitting over the point . It separates the string using the "-" delimeter then draws a tree trunk and canopy to scale with a formatted note. My goal is to auto find all these points + text and draw all the trees in one go.&amp;nbsp;All the tree points are in their own layer "PTRE" but the text strings are in a general "TEXT" layer, so need isolating from other text and matching with their partnering point.&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(defun c:TREN ()

         (defun *error* (MSG)

            (if (/= MSG "Function cancelled")
                (princ (strcat "\nError: " MSG)))

              (if osm (setvar "OSMODE" OSM))
              (if lyr (setvar "CLAYER" LYR))

          (princ) )

  ;; String to List  -  Lee Mac  ;; http://www.lee-mac.com/stringtolist.html
  ;; Separates a string using a given delimiter
  ;; str - [str] String to process
  ;; del - [str] Delimiter by which to separate the string
  ;; Returns: [lst] List of strings
  
  (defun LM:str-&amp;gt;lst ( str del / pos )
    (if (setq pos (vl-string-search del str))
      (cons (substr str 1 pos) (LM:str-&amp;gt;lst (substr str (+ pos 1 (strlen del))) del))
      (list str)))
  
  (setq OSM (getvar "OSMODE"))
  (setq LYR (getvar "CLAYER"))

           (command "osnap" "INSERT")
           (setq xy (getpoint "Where? "))
  
           (setq en (car (entsel "Pick info: ")))
           (setq lst (LM:str-&amp;gt;lst (cdr (assoc 1 (entget en))) "-"))     ;; "G-S-H-species"
  
                 (setq tr (atof (car lst)))
                 (setq sp (atof (cadr lst)))
                 (setq h (atof (caddr lst)))
                 (setq spe (last lst))
  
                (command "osnap" "none")
   
                (command "LAYER" "M" "TRTEXT" "")
                (setq txy (polar xy 0.4636 0.894))
  
                (command "TEXT" txy "" "" spe)
                (command "TEXT" "" (strcat "G "(rtos tr 2 2)))
                (command "TEXT" "" (strcat "S "(rtos sp 2 1)))
                (command "TEXT" "" (strcat "H "(rtos h  2 0)))
  
                       (command "LAYER" "M" "TRTR" "")
                       (command "INSERT" "treebole" xy (/ tr PI) "" "" "")
  
                       (command "LAYER" "M" "TRCAN" "")
                       (command "INSERT" "trcan" xy sp "" "" "")

   (setvar "OSMODE" OSM)
   (setvar "CLAYER" LYR)

  (princ)
  )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2023 16:44:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/compare-two-selection-sets-to-make-a-fourth-out-of-a-third/m-p/11705146#M35371</guid>
      <dc:creator>dlbsurveysuk</dc:creator>
      <dc:date>2023-01-25T16:44:15Z</dc:date>
    </item>
    <item>
      <title>Re: Compare two selection sets to make a fourth out of a third...</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/compare-two-selection-sets-to-make-a-fourth-out-of-a-third/m-p/11705183#M35372</link>
      <description>&lt;P&gt;This is your starting point. Your 4th ss is called s. Your 1st ss is called s, your 2nd one too. The is no 3rd one though.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(defun c:test ( / s i c e l)

  (if (setq s (ssget "_X" '((2 . "PTRE"))))
    (repeat (setq i (sslength s))
      (setq c (cdr (assoc 10 (entget (ssname s (setq i (1- i))))))
	    l (cons c l))))

  (if (setq s (ssget "_X" '((8 . "PTRE"))))
    (repeat (setq i (sslength s))
      (setq c (cdr (assoc 10 (entget (setq e (ssname s (setq i (1- i)))))))
	    l (vl-sort l '(lambda (c1 c2) (&amp;lt; (distance c c1) (distance c c2)))))
      (if (not (equal c (car l) 1e-1)) (ssdel e s))))

  (if (and s (/= 0 (sslength s)))
    do whatever you want to do with c:TREN...........
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2023 19:04:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/compare-two-selection-sets-to-make-a-fourth-out-of-a-third/m-p/11705183#M35372</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2023-01-25T19:04:16Z</dc:date>
    </item>
    <item>
      <title>Re: Compare two selection sets to make a fourth out of a third...</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/compare-two-selection-sets-to-make-a-fourth-out-of-a-third/m-p/11705188#M35373</link>
      <description>&lt;P&gt;PS. If the text string was exactly over the point/insert it could all be done from the text string insertion point but the text string is off by approx 0.07 as I mentioned before and the tree needs to sit on the point/insert&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2023 16:54:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/compare-two-selection-sets-to-make-a-fourth-out-of-a-third/m-p/11705188#M35373</guid>
      <dc:creator>dlbsurveysuk</dc:creator>
      <dc:date>2023-01-25T16:54:27Z</dc:date>
    </item>
    <item>
      <title>Re: Compare two selection sets to make a fourth out of a third...</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/compare-two-selection-sets-to-make-a-fourth-out-of-a-third/m-p/11705193#M35374</link>
      <description>&lt;P&gt;Woah that was fast. Thanks. I'll examine it...&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2023 16:55:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/compare-two-selection-sets-to-make-a-fourth-out-of-a-third/m-p/11705193#M35374</guid>
      <dc:creator>dlbsurveysuk</dc:creator>
      <dc:date>2023-01-25T16:55:52Z</dc:date>
    </item>
    <item>
      <title>Re: Compare two selection sets to make a fourth out of a third...</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/compare-two-selection-sets-to-make-a-fourth-out-of-a-third/m-p/11705754#M35375</link>
      <description>&lt;P&gt;Should the second (if be (8."TEXT") ? I've tried it and get nil&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can't seem to make sense of it...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As they are -&lt;/P&gt;&lt;P&gt;If I run the first (if on it's own I get a list of "PTRE" coordinates.&lt;/P&gt;&lt;P&gt;If I run both (if together I get nil&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Wed, 25 Jan 2023 20:32:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/compare-two-selection-sets-to-make-a-fourth-out-of-a-third/m-p/11705754#M35375</guid>
      <dc:creator>dlbsurveysuk</dc:creator>
      <dc:date>2023-01-25T20:32:33Z</dc:date>
    </item>
    <item>
      <title>Re: Compare two selection sets to make a fourth out of a third...</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/compare-two-selection-sets-to-make-a-fourth-out-of-a-third/m-p/11706804#M35376</link>
      <description>&lt;P&gt;Sure, whatever meets your needs.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jan 2023 11:06:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/compare-two-selection-sets-to-make-a-fourth-out-of-a-third/m-p/11706804#M35376</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2023-01-26T11:06:07Z</dc:date>
    </item>
    <item>
      <title>Re: Compare two selection sets to make a fourth out of a third...</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/compare-two-selection-sets-to-make-a-fourth-out-of-a-third/m-p/11707092#M35377</link>
      <description>&lt;P&gt;Assuming from your description that fourth set s contains only the text that has matching coordinates to the first set s (blocks) ?...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Tried this - with the TREN routine in a repeat loop, with the (setq&amp;nbsp; XY) and (setq EN) lines modified to get info from the list, but it doesn't work - ; error: bad argument type: lselsetp nil&lt;/P&gt;&lt;LI-CODE lang="general"&gt;(defun c:test ( / s i c e l)

  (if (setq s (ssget "_X" '((2 . "PTRE"))))
    (repeat (setq i (sslength s))

      (setq c (cdr (assoc 10 (entget (ssname s (setq i (1- i))))))
	    l (cons c l))))


  (if (setq s (ssget "_X" '((8 . "TEXT"))))
    (repeat (setq i (sslength ss))

         (setq c (cdr (assoc 10 (entget (setq e (ssname ss (setq i (1- i)))))))
	    l (vl-sort l '(lambda (c1 c2) (&amp;lt; (distance c c1) (distance c c2)))))
         (if (not (equal c (car l) 1e-3)) (ssdel e ss))))


(if (and s (/= 0 (sslength s)))                  ;;    do whatever you want to do with c:TREN...........

     (repeat (setq i (sslength s))
                    (setq i (1- i))


         (defun *error* (MSG)

            (if (/= MSG "Function cancelled")
                (princ (strcat "\nError: " MSG)))

              (if osm (setvar "OSMODE" OSM))
              (if lyr (setvar "CLAYER" LYR))

          (princ) )

  ;; String to List  -  Lee Mac  ;; http://www.lee-mac.com/stringtolist.html
  ;; Separates a string using a given delimiter
  ;; str - [str] String to process
  ;; del - [str] Delimiter by which to separate the string
  ;; Returns: [lst] List of strings
  
  (defun LM:str-&amp;gt;lst ( str del / pos )
    (if (setq pos (vl-string-search del str))
      (cons (substr str 1 pos) (LM:str-&amp;gt;lst (substr str (+ pos 1 (strlen del))) del))
      (list str)))
  
  (setq OSM (getvar "OSMODE"))
  (setq LYR (getvar "CLAYER"))

           (command "osnap" "INSERT")
         
            (setq XY (cdr (assoc 10 (entget (ssname s i)))))      ;;;  (setq xy (getpoint "Where? "))
  
            (setq EN (entget (ssname s i)))                       ;;;  (setq en (car (entsel "Pick info: ")))


           (setq lst (LM:str-&amp;gt;lst (cdr (assoc 1 (entget en))) "-"))   ;;; "G-S-H-species"
  
                 (setq tr (atof (car lst)))
                 (setq sp (atof (cadr lst)))
                 (setq h (atof (caddr lst)))
                 (setq spe (last lst))
  
                (command "osnap" "none")
   
                (command "LAYER" "M" "TRTEXT" "")
                (setq txy (polar xy 0.4636 0.894))
  
                (command "TEXT" txy "" "" spe)
                (command "TEXT" "" (strcat "G "(rtos tr 2 2)))
                (command "TEXT" "" (strcat "S "(rtos sp 2 1)))
                (command "TEXT" "" (strcat "H "(rtos h  2 0)))
  
                       (command "LAYER" "M" "TRTR" "")
                       (command "INSERT" "treebole" xy (/ tr PI) "" "" "")
  
                       (command "LAYER" "M" "TRCAN" "")
                       (command "INSERT" "trcan" xy sp "" "" "")

   (setvar "OSMODE" OSM)
   (setvar "CLAYER" LYR)
 );repeat
);if

(princ)
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jan 2023 11:01:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/compare-two-selection-sets-to-make-a-fourth-out-of-a-third/m-p/11707092#M35377</guid>
      <dc:creator>dlbsurveysuk</dc:creator>
      <dc:date>2023-01-26T11:01:59Z</dc:date>
    </item>
    <item>
      <title>Re: Compare two selection sets to make a fourth out of a third...</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/compare-two-selection-sets-to-make-a-fourth-out-of-a-third/m-p/11707105#M35378</link>
      <description>&lt;P&gt;Post some test dwg.&lt;/P&gt;
&lt;P&gt;States before, and after.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;btw it would be nice if you read the code, not the description.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jan 2023 11:15:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/compare-two-selection-sets-to-make-a-fourth-out-of-a-third/m-p/11707105#M35378</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2023-01-26T11:15:57Z</dc:date>
    </item>
    <item>
      <title>Re: Compare two selection sets to make a fourth out of a third...</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/compare-two-selection-sets-to-make-a-fourth-out-of-a-third/m-p/11707140#M35379</link>
      <description>&lt;P&gt;I have been trying to read the code - I think spending literally hours trying to understand it but seem to be getting nowhere... I can understand isolated parts but then get lost when variable names aren't descriptive and there are multiple functions nested multiple times. I'm trying.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've isolated some PTRE blocks and some layer TEXT to a drawing. There are 4 tree positions with associated text that isn't quite in the same positions, and other isolated text that needs to be ignored.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for taking the time to look at this.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jan 2023 11:34:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/compare-two-selection-sets-to-make-a-fourth-out-of-a-third/m-p/11707140#M35379</guid>
      <dc:creator>dlbsurveysuk</dc:creator>
      <dc:date>2023-01-26T11:34:51Z</dc:date>
    </item>
    <item>
      <title>Re: Compare two selection sets to make a fourth out of a third...</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/compare-two-selection-sets-to-make-a-fourth-out-of-a-third/m-p/11707297#M35380</link>
      <description>&lt;P&gt;OK. There are like 8 errors to fix. 4 of those are mine (easy to fix), the rest is yours&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;You need to learn how to DEBUG your code and fix it&lt;/STRONG&gt;.&lt;/FONT&gt;&amp;nbsp;&lt;A href="https://autode.sk/3Dhlthf" target="_blank" rel="noopener"&gt;HERE&lt;/A&gt;&amp;nbsp;is a video from the start...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Some notes:&lt;/P&gt;
&lt;P&gt;Tick on a Breat at point. Then the program breaks at the error line. You need to use "Last Break Source" to get there.&lt;/P&gt;
&lt;P&gt;Sometimes it does not locate the line... or your problem is not clear...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;... then make some break "Toggle break" icon(s),&amp;nbsp;add at least *LAST-VALUE* to the Watch and go one step by another to see what the program evaluates, whether it's good or not.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, if you have a large sets of items in the drawing, remove most of it - keep just 2-3 items&amp;nbsp;of its kind so that you don't drown in endless loops of similar items...&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;One more, it's good to rewrite '(lambda ...) into (function (lambda ...)) - will step thru the function easier.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here are some comments on the code. It's just a screenshot taken just before the inevitable crash...&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="BeekeeCZ_0-1674736584854.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1167518i5CA9A44A6BF06BF4/image-size/medium?v=v2&amp;amp;px=400" role="button" title="BeekeeCZ_0-1674736584854.png" alt="BeekeeCZ_0-1674736584854.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Once you fix all the errors, then it requires some optimization.&lt;/P&gt;
&lt;P&gt;BTW the last 3 of yours check the command-line listing. They don't stop the code from running but make the code terribly slow.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Enjoy the next few hours of quality time spent...&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="thinking.gif" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1167528i438B530727CBC238/image-size/medium?v=v2&amp;amp;px=400" role="button" title="thinking.gif" alt="thinking.gif" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jan 2023 13:23:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/compare-two-selection-sets-to-make-a-fourth-out-of-a-third/m-p/11707297#M35380</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2023-01-26T13:23:45Z</dc:date>
    </item>
    <item>
      <title>Re: Compare two selection sets to make a fourth out of a third...</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/compare-two-selection-sets-to-make-a-fourth-out-of-a-third/m-p/11707479#M35381</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/8967756"&gt;@dlbsurveysuk&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;just wondering, maybe u need selecting texts in near proximity to insertion points of inserts with regard to fuzziness set?&lt;/P&gt;&lt;P dir="ltr"&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="lisp"&gt;;****************************************************************************************************

(defun make_rectangular_list (insert_point fuzzyness)
	(list
		 (list (- (car insert_point) fuzzyness) (- (cadr insert_point) fuzzyness))
		 (list (- (car insert_point) fuzzyness) (+ (cadr insert_point) fuzzyness))
		 (list (+ (car insert_point) fuzzyness) (+ (cadr insert_point) fuzzyness))
		 (list (+ (car insert_point) fuzzyness) (- (cadr insert_point) fuzzyness))
	)
)

;****************************************************************************************************

(defun ftpb (/ insert_sset_ptre insert_index proximity_texts_sset insert_ename insert_point
				 proximity_text_sset
			  )
	(setq insert_sset_ptre (ssget "_x" '((2 . "ptre")))
		  insert_index -1
		  proximity_texts_sset (ssadd)
	)
	(repeat (sslength insert_sset_ptre)
		(setq insert_ename (ssname insert_sset_ptre (setq insert_index (1+ insert_index)))
			  insert_point (cdr (assoc 10 (entget insert_ename)))
			  proximity_text_sset (ssget "_cp" (make_rectangular_list insert_point 0.07) '((0 . "text")))
		)
		(if proximity_text_sset 
			(setq proximity_texts_sset (ssadd (ssname proximity_text_sset 0) proximity_texts_sset))
		)
	)
	(sssetfirst nil proximity_texts_sset)
	proximity_texts_sset
)

;****************************************************************************************************&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jan 2023 14:41:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/compare-two-selection-sets-to-make-a-fourth-out-of-a-third/m-p/11707479#M35381</guid>
      <dc:creator>komondormrex</dc:creator>
      <dc:date>2023-01-26T14:41:14Z</dc:date>
    </item>
    <item>
      <title>Re: Compare two selection sets to make a fourth out of a third...</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/compare-two-selection-sets-to-make-a-fourth-out-of-a-third/m-p/11707663#M35382</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/8967756"&gt;@dlbsurveysuk&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Should the second (if be (8."TEXT") ? ....&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;That kind of entry requires &lt;EM&gt;spaces on either side of the period&lt;/EM&gt;:&amp;nbsp;&amp;nbsp;(8 . "TEXT")&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jan 2023 15:02:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/compare-two-selection-sets-to-make-a-fourth-out-of-a-third/m-p/11707663#M35382</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2023-01-26T15:02:50Z</dc:date>
    </item>
    <item>
      <title>Re: Compare two selection sets to make a fourth out of a third...</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/compare-two-selection-sets-to-make-a-fourth-out-of-a-third/m-p/11709141#M35383</link>
      <description>&lt;P&gt;&amp;nbsp;Few comments&lt;/P&gt;&lt;P&gt;If you use CIV3D or similar civil package you can have a point with a description label,&lt;/P&gt;&lt;P&gt;Reading a points file can match X,Y,Z,code and insert block need correct lisp,&lt;/P&gt;&lt;P&gt;I use a dynamic block that has 2 items a circle for the trunk dia and the second the spread dia so matches you code style,&lt;/P&gt;&lt;P&gt;You would though need multiple dynamic blocks if you want different look for trees.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would take a step back and look seriously at how your importing your points.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In image all blocks were inserted automatically by reading the pt,X,Y,Z,code&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SeaHaven_0-1674791324423.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1167869i33B036C79C379937/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SeaHaven_0-1674791324423.png" alt="SeaHaven_0-1674791324423.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jan 2023 03:48:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/compare-two-selection-sets-to-make-a-fourth-out-of-a-third/m-p/11709141#M35383</guid>
      <dc:creator>Sea-Haven</dc:creator>
      <dc:date>2023-01-27T03:48:46Z</dc:date>
    </item>
    <item>
      <title>Re: Compare two selection sets to make a fourth out of a third...</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/compare-two-selection-sets-to-make-a-fourth-out-of-a-third/m-p/11709438#M35384</link>
      <description>&lt;P&gt;I'm a one man band and only have standard AutoCad (was thinking about Bricscad but I use point clouds a lot and currently Bricscad doesn't have all the same features/performance) . Civil3D costs an extra £1000 a year here.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All the data is collected by Leica Captivate with a LSS codelist, and run through LSS DTM software to calc traverse, contours etc. This is then exported as a DXF into AutoCad. (reason for LSS is it's UK based and cheap (£250).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When collecting tree info on site the LSS tree code has a set of attributes that will then auto draw a tree in the LSS software, but...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The Leica logger process of going through all the attributes is clunky and annoying, it's easier and faster to just type a single note (G-S-H-TYPE), and the LSS software has a particular style/look to the drawings it produces, which isn't what I want.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So after a minimum of processing I export the raw survey into AutoCad. On a lot of jobs I also now collect a lot of my topo info through scanning with a BLK360, with just control targets and a smattering of traditional topo with the theodolite, so I combine in AutoCad for drawing/editing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All level cross blocks etc. circles, and rectangles are automatic.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've written a lisp routine that converts everything exported from LSS into the style I want, the trees are the last thing that hasn't been fully automated. Currently I have to run the Lisp TREN and pick each tree point and note to auto draw the trees one by one. Once that is sorted it'll be as efficient as what you describe, without having to follow LSS standards or buying Civil3D.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a similar situation with point clouds - I just use Leica Register 360 BLK Edition (the cheapest) to process them and export to AutoCad. Then have the Point Cloud Cropping Tools addin (one off £40!), and a series of my own Lisp routines to work with them, whereas I know other people who have additional software such as Cloudworx (which also costs an extra £1000 a year).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I do use dynamic blocks (windows, doors etc) when drawing building plans and elevations + I have a block with a number attribute that I insert to all target points using a Lisp routine that auto numbers them, then use Dataextraction to export the numbered target x,y,z points into Register 360. But I can't export blocks with attributes from LSS to AutoCad.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It's all about having my own system using minimal expensive software while still keeping up efficiency.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jan 2023 08:04:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/compare-two-selection-sets-to-make-a-fourth-out-of-a-third/m-p/11709438#M35384</guid>
      <dc:creator>dlbsurveysuk</dc:creator>
      <dc:date>2023-01-27T08:04:06Z</dc:date>
    </item>
    <item>
      <title>Re: Compare two selection sets to make a fourth out of a third...</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/compare-two-selection-sets-to-make-a-fourth-out-of-a-third/m-p/11709443#M35385</link>
      <description>&lt;P&gt;Yeah, it's correct in the actual code.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jan 2023 08:05:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/compare-two-selection-sets-to-make-a-fourth-out-of-a-third/m-p/11709443#M35385</guid>
      <dc:creator>dlbsurveysuk</dc:creator>
      <dc:date>2023-01-27T08:05:14Z</dc:date>
    </item>
  </channel>
</rss>

