<?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 to find a duplicate attribute value in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-find-a-duplicate-attribute-value/m-p/10691510#M53881</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/8472127"&gt;@ssuoiresos&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;Can somebody please help me with a LISP that &lt;STRONG&gt;highlights&lt;/STRONG&gt; the blocks with duplicate attribute values?&lt;/P&gt;
&lt;P&gt;.. . So even though there will be other duplicates in the blocks, I will need just this specific attribute value (FUEL_CONSUMPTION) to be different each time&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="lisp"&gt;(defun c:FCtag (/ _ipt ssdup ss i ev attval a b FC_Coll)
  (defun _ipt (e) (cdr (assoc 10 (entget e))))
  (if (setq ssdup (ssadd)
	    ss	  (ssget
		    "_X"
		    (list '(0 . "INSERT") '(66 . 1) (cons 410 (getvar 'Ctab)))
		  )
      )
    (progn
      (repeat (setq i (sslength ss))
	(setq ev (ssname ss (Setq i (1- i))))
	(setq attval (mapcar '(lambda (at)
				(list (vla-get-tagstring at)
				      (vla-get-textstring at)
				)
			      )
			     (vlax-invoke
			       (vlax-ename-&amp;gt;vla-object ev)
			       'GetAttributes
			     )
		     )
	)
	(if (setq f (assoc "FUEL_CONSUMPTION" attval))
	  (setq FC_Coll (cons (list f ev) FC_Coll))
	)
      )
      (while (or b (setq a (Car FC_Coll)))
	(if
	  (setq	b (vl-some '(lambda (c)
			      (if (equal (Car a) (Car c))
				c
			      )
			    )
			   (cdr FC_Coll)
		  )
	  )
	   (progn
	     (entmakex (list (cons 0 "LINE")
			     (cons 10 (_ipt (Cadr a)))
			     (cons 11 (_ipt (Cadr b)))
		       )
	     )
	     (ssadd (Cadr a) ssdup)
	     (ssadd (Cadr b) ssdup)
	     (setq FC_Coll (Vl-remove b FC_Coll)
		   b	   a
	     )
	   )
	   (setq FC_Coll (cdr FC_Coll))
	)
      )
      (sssetfirst nil ssdup)
    )
  )
  (princ)
)&lt;/LI-CODE&gt;
&lt;P&gt;&lt;FONT size="3"&gt;Command: FCtag&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;HTH&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 15 Oct 2021 18:14:04 GMT</pubDate>
    <dc:creator>pbejse</dc:creator>
    <dc:date>2021-10-15T18:14:04Z</dc:date>
    <item>
      <title>LISP to find a duplicate attribute value</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-find-a-duplicate-attribute-value/m-p/10690981#M53872</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;Can somebody please help me with a LISP that highlights the blocks with duplicate attribute values? I am after a program that will search through multiple blocks (CAR_1, CAR_2, CAR_3) in my sample drawing and looks for a duplicate just in a specific attribute value (FUEL_CONSUMPTION in my drawing). So even though there will be other duplicates in the blocks, I will need just this specific attribute value (FUEL_CONSUMPTION) to be different each time. In my drawing I have&amp;nbsp; 2 blocks with 32MPG duplicate that I will need them highlighted. I would like to be able to do a quick check for duplicates without extracting all the data in excel each time. I hope this makes sense. Please see attached a sample drawing. Thank you.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Oct 2021 13:51:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-find-a-duplicate-attribute-value/m-p/10690981#M53872</guid>
      <dc:creator>ssuoiresos</dc:creator>
      <dc:date>2021-10-15T13:51:53Z</dc:date>
    </item>
    <item>
      <title>Re: LISP to find a duplicate attribute value</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-find-a-duplicate-attribute-value/m-p/10691007#M53873</link>
      <description>&lt;P&gt;OK. Try SEACH. It should do all you need.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://autode.sk/2YYe05N" target="_blank"&gt;https://autode.sk/2YYe05N&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Oct 2021 14:15:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-find-a-duplicate-attribute-value/m-p/10691007#M53873</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2021-10-15T14:15:59Z</dc:date>
    </item>
    <item>
      <title>Re: LISP to find a duplicate attribute value</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-find-a-duplicate-attribute-value/m-p/10691045#M53874</link>
      <description>Thanks for your reply. What I mean is drawings with 200 blocks, where you have made an error but you don't know where, therefore you don't know what to look for... You have to know what to search for...</description>
      <pubDate>Fri, 15 Oct 2021 14:27:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-find-a-duplicate-attribute-value/m-p/10691045#M53874</guid>
      <dc:creator>ssuoiresos</dc:creator>
      <dc:date>2021-10-15T14:27:39Z</dc:date>
    </item>
    <item>
      <title>Re: LISP to find a duplicate attribute value</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-find-a-duplicate-attribute-value/m-p/10691047#M53875</link>
      <description>&lt;P&gt;well, I have a starting point for you... this will get you a list of the values in your FUEL_CONSUMPTION paired with the INSERT entity it is associated with.&amp;nbsp; The list will be in the variable VALUES and is in the format ((&amp;lt;entity&amp;gt; "#MPG)(&amp;lt;entity&amp;gt; "#MPG)(&amp;lt;entity&amp;gt; "#MPG)...).&amp;nbsp; From here you would use LISP to compare the values in the list to each other.&amp;nbsp; I'm not sure offhand how to highlight the blocks once you find the ones that match each other, I'm at work and not ready to search for that answer, but I hope this helps put you on the right track.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(setq CARBLOCKS (ssget))&lt;BR /&gt;(setq COUNT 0)&lt;BR /&gt;(repeat (sslength CARBLOCKS)&lt;BR /&gt;(setq FIRSTBLOCK (ssname CARBLOCKS COUNT))&lt;BR /&gt;(setq SELS (entnext FIRSTBLOCK))&lt;BR /&gt;(progn&lt;BR /&gt;(while (and (not (equal (cdr (assoc 0 (entget SELS))) "INSERT"))&lt;BR /&gt;(not (equal (cdr (assoc 0 (entget SELS))) "SEQEND")))&lt;BR /&gt;(if (equal (cdr (assoc 0 (entget SELS))) "ATTRIB")&lt;BR /&gt;(progn (setq VALUE (cdr (assoc 1 (entget SELS))))&lt;BR /&gt;(setq TAG (cdr (assoc 2 (entget SELS))))&lt;BR /&gt;(setq SELS (entnext SELS))&lt;BR /&gt;(if (equal TAG "FUEL_CONSUMPTION") (setq VALUES (cons (list FIRSTBLOCK VALUE) VALUES)))&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;(setq COUNT (1+ COUNT))&lt;BR /&gt;);END REPEAT&lt;BR /&gt;(setq COUNT nil)&lt;BR /&gt;(princ VALUES)&lt;/P&gt;</description>
      <pubDate>Fri, 15 Oct 2021 14:28:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-find-a-duplicate-attribute-value/m-p/10691047#M53875</guid>
      <dc:creator>james_moore</dc:creator>
      <dc:date>2021-10-15T14:28:21Z</dc:date>
    </item>
    <item>
      <title>Re: LISP to find a duplicate attribute value</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-find-a-duplicate-attribute-value/m-p/10691187#M53876</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/8472127"&gt;@ssuoiresos&lt;/a&gt;&amp;nbsp;, hi. Will be always the block name start with CAR_xx, and the att tag name&amp;nbsp;&lt;SPAN&gt;FUEL_CONSUMPTION?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Oct 2021 15:28:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-find-a-duplicate-attribute-value/m-p/10691187#M53876</guid>
      <dc:creator>devitg</dc:creator>
      <dc:date>2021-10-15T15:28:48Z</dc:date>
    </item>
    <item>
      <title>Re: LISP to find a duplicate attribute value</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-find-a-duplicate-attribute-value/m-p/10691213#M53877</link>
      <description>&lt;P&gt;SEARCH is not a valid ACAD core command.&amp;nbsp; Ah, never mind... you mean FIND.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Oct 2021 15:39:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-find-a-duplicate-attribute-value/m-p/10691213#M53877</guid>
      <dc:creator>james_moore</dc:creator>
      <dc:date>2021-10-15T15:39:48Z</dc:date>
    </item>
    <item>
      <title>Re: LISP to find a duplicate attribute value</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-find-a-duplicate-attribute-value/m-p/10691302#M53878</link>
      <description>Hi, block name can be different but the attribute tag name will always be the same. Thanks</description>
      <pubDate>Fri, 15 Oct 2021 16:18:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-find-a-duplicate-attribute-value/m-p/10691302#M53878</guid>
      <dc:creator>ssuoiresos</dc:creator>
      <dc:date>2021-10-15T16:18:13Z</dc:date>
    </item>
    <item>
      <title>Re: LISP to find a duplicate attribute value</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-find-a-duplicate-attribute-value/m-p/10691322#M53879</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/8472127"&gt;@ssuoiresos&lt;/a&gt;&amp;nbsp; about block names , will they have any COMMON part? , as I can see at the dwg CAR_ is a COMMON part&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Oct 2021 16:32:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-find-a-duplicate-attribute-value/m-p/10691322#M53879</guid>
      <dc:creator>devitg</dc:creator>
      <dc:date>2021-10-15T16:32:24Z</dc:date>
    </item>
    <item>
      <title>Re: LISP to find a duplicate attribute value</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-find-a-duplicate-attribute-value/m-p/10691362#M53880</link>
      <description>I tried to keep it really simple in the drawing. "STT-CAR NAME" will be the name of the block. "CAR NAME" can have different names ( a library with over 100 blocks), "STT" is in all of them. So "STT" Is the common part</description>
      <pubDate>Fri, 15 Oct 2021 16:55:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-find-a-duplicate-attribute-value/m-p/10691362#M53880</guid>
      <dc:creator>ssuoiresos</dc:creator>
      <dc:date>2021-10-15T16:55:42Z</dc:date>
    </item>
    <item>
      <title>Re: LISP to find a duplicate attribute value</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-find-a-duplicate-attribute-value/m-p/10691510#M53881</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/8472127"&gt;@ssuoiresos&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;Can somebody please help me with a LISP that &lt;STRONG&gt;highlights&lt;/STRONG&gt; the blocks with duplicate attribute values?&lt;/P&gt;
&lt;P&gt;.. . So even though there will be other duplicates in the blocks, I will need just this specific attribute value (FUEL_CONSUMPTION) to be different each time&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="lisp"&gt;(defun c:FCtag (/ _ipt ssdup ss i ev attval a b FC_Coll)
  (defun _ipt (e) (cdr (assoc 10 (entget e))))
  (if (setq ssdup (ssadd)
	    ss	  (ssget
		    "_X"
		    (list '(0 . "INSERT") '(66 . 1) (cons 410 (getvar 'Ctab)))
		  )
      )
    (progn
      (repeat (setq i (sslength ss))
	(setq ev (ssname ss (Setq i (1- i))))
	(setq attval (mapcar '(lambda (at)
				(list (vla-get-tagstring at)
				      (vla-get-textstring at)
				)
			      )
			     (vlax-invoke
			       (vlax-ename-&amp;gt;vla-object ev)
			       'GetAttributes
			     )
		     )
	)
	(if (setq f (assoc "FUEL_CONSUMPTION" attval))
	  (setq FC_Coll (cons (list f ev) FC_Coll))
	)
      )
      (while (or b (setq a (Car FC_Coll)))
	(if
	  (setq	b (vl-some '(lambda (c)
			      (if (equal (Car a) (Car c))
				c
			      )
			    )
			   (cdr FC_Coll)
		  )
	  )
	   (progn
	     (entmakex (list (cons 0 "LINE")
			     (cons 10 (_ipt (Cadr a)))
			     (cons 11 (_ipt (Cadr b)))
		       )
	     )
	     (ssadd (Cadr a) ssdup)
	     (ssadd (Cadr b) ssdup)
	     (setq FC_Coll (Vl-remove b FC_Coll)
		   b	   a
	     )
	   )
	   (setq FC_Coll (cdr FC_Coll))
	)
      )
      (sssetfirst nil ssdup)
    )
  )
  (princ)
)&lt;/LI-CODE&gt;
&lt;P&gt;&lt;FONT size="3"&gt;Command: FCtag&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;HTH&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Oct 2021 18:14:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-find-a-duplicate-attribute-value/m-p/10691510#M53881</guid>
      <dc:creator>pbejse</dc:creator>
      <dc:date>2021-10-15T18:14:04Z</dc:date>
    </item>
    <item>
      <title>Re: LISP to find a duplicate attribute value</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-find-a-duplicate-attribute-value/m-p/10691528#M53882</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/8472127"&gt;@ssuoiresos&lt;/a&gt;&amp;nbsp; ha escrito:&lt;BR /&gt;I tried to keep it really simple in the drawing. "STT-CAR NAME" will be the name of the block. "CAR NAME" can have different names ( a library with over 100 blocks), "STT" is in all of them. So "STT" Is the common part&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;So please upload a more detailed DWG with such STT named blocks .&amp;nbsp;&lt;/P&gt;&lt;P&gt;Do you want to highlight&amp;nbsp; the reference blk, by steps, say first the ones that have 32mpg,&amp;nbsp; do something , and then&amp;nbsp;&lt;/P&gt;&lt;P&gt;to the next duplicated att string value , or better to mark&amp;nbsp; all duplicated by&amp;nbsp; any way , maybe by means of a text with the att-string value.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Oct 2021 18:21:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-find-a-duplicate-attribute-value/m-p/10691528#M53882</guid>
      <dc:creator>devitg</dc:creator>
      <dc:date>2021-10-15T18:21:02Z</dc:date>
    </item>
    <item>
      <title>Re: LISP to find a duplicate attribute value</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-find-a-duplicate-attribute-value/m-p/10691717#M53883</link>
      <description>Thank you so much. It works like a charm. You really know your stuff.</description>
      <pubDate>Fri, 15 Oct 2021 19:54:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-find-a-duplicate-attribute-value/m-p/10691717#M53883</guid>
      <dc:creator>ssuoiresos</dc:creator>
      <dc:date>2021-10-15T19:54:01Z</dc:date>
    </item>
    <item>
      <title>Re: LISP to find a duplicate attribute value</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-find-a-duplicate-attribute-value/m-p/11713428#M53884</link>
      <description>&lt;DIV class=""&gt;&lt;SPAN class=""&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/564264"&gt;@pbejse&lt;/a&gt;&amp;nbsp;hello, didn't want to open a new thread as it is related. Are you able to help me out with amending this code, so that it looks for duplicates in both FUEL_CONSUMPTION and REF1? If both values are the same, then it returns and highlights the blocks. If only one value is different, it no longer highlights? I've tried looking online for assistance and couldn't find what I'm looking for.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 29 Jan 2023 07:38:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-find-a-duplicate-attribute-value/m-p/11713428#M53884</guid>
      <dc:creator>adminXYZ5K</dc:creator>
      <dc:date>2023-01-29T07:38:24Z</dc:date>
    </item>
    <item>
      <title>Re: LISP to find a duplicate attribute value</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-find-a-duplicate-attribute-value/m-p/11713634#M53885</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/12882933"&gt;@adminXYZ5K&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;DIV class=""&gt;&lt;SPAN class=""&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/564264"&gt;@pbejse&lt;/a&gt;&amp;nbsp;hello, didn't want to open a new thread as it is related. Are you able to help me out with amending this code, so that it looks for duplicates in both FUEL_CONSUMPTION and REF1? If both values are the same, then it returns and highlights the blocks. If only one value is different, it no longer highlights? I've tried looking online for assistance and couldn't find what I'm looking for.&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Is that &lt;STRONG&gt;ALSO&lt;/STRONG&gt; same value&amp;nbsp;&lt;EM&gt;&lt;SPAN class=""&gt;FUEL_CONSUMPTION&lt;/SPAN&gt;&lt;/EM&gt;&amp;nbsp;&lt;STRONG&gt;AND&lt;/STRONG&gt;&amp;nbsp;&lt;SPAN class=""&gt;&lt;EM&gt;REF1 &lt;/EM&gt;then highlight?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 29 Jan 2023 11:44:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-find-a-duplicate-attribute-value/m-p/11713634#M53885</guid>
      <dc:creator>pbejse</dc:creator>
      <dc:date>2023-01-29T11:44:55Z</dc:date>
    </item>
    <item>
      <title>Re: LISP to find a duplicate attribute value</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-find-a-duplicate-attribute-value/m-p/11713638#M53886</link>
      <description>&lt;P&gt;FUEL_CONSUMPTION AND REF1 would be different values.&lt;/P&gt;&lt;P&gt;Please see the examples attached.&amp;nbsp;&lt;/P&gt;&lt;P&gt;In the first example, the duplicates should not highlight, as REF1 differs between blocks.&lt;/P&gt;&lt;P&gt;In the second example, the duplicates should highlight, as REF1 &amp;amp; FUEL_CONSUMPTION is the same in both.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for helping&lt;/P&gt;</description>
      <pubDate>Sun, 29 Jan 2023 11:52:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-find-a-duplicate-attribute-value/m-p/11713638#M53886</guid>
      <dc:creator>adminXYZ5K</dc:creator>
      <dc:date>2023-01-29T11:52:09Z</dc:date>
    </item>
    <item>
      <title>Re: LISP to find a duplicate attribute value</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-find-a-duplicate-attribute-value/m-p/11713675#M53887</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/12882933"&gt;@adminXYZ5K&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;FUEL_CONSUMPTION AND REF1 would be different values.&lt;/P&gt;
&lt;P&gt;Please see the examples attached.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the first example, the duplicates should not highlight, as REF1 differs between blocks.&lt;/P&gt;
&lt;P&gt;In the second example, the duplicates should highlight, as REF1 &amp;amp; FUEL_CONSUMPTION is the same in both.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for helping&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(defun c:FCtag (/ _ipt ssdup ss i ev attval a b FC_Coll)
  (defun _ipt (e) (cdr (assoc 10 (entget e))))
  &lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;(setq theseTags '("FUEL_CONSUMPTION" "REF1"))&lt;/STRONG&gt;&lt;/FONT&gt;
  (if (setq ssdup (ssadd)
	    ss	  (ssget
		    "_X"
		    (list '(0 . "INSERT") '(66 . 1) (cons 410 (getvar 'Ctab)))
		  )
      )
    (progn
      (repeat (setq i (sslength ss))
	(setq ev (ssname ss (Setq i (1- i))))
	(setq attval (mapcar '(lambda (at)
				(list (vla-get-tagstring at)
				      (vla-get-textstring at)
				)
			      )
			     (vlax-invoke
			       (vlax-ename-&amp;gt;vla-object ev)
			       'GetAttributes
			     )
		     )
	)
	(if &lt;STRONG&gt;&lt;FONT color="#0000FF"&gt;(vl-every '(lambda (at / ft )
				 (and (setq ft (assoc at attval))
				      (setq f (cons ft f)))) theseTags)&lt;/FONT&gt;&lt;/STRONG&gt;
			
	  (setq FC_Coll (cons &lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;(append f (list ev))&lt;/STRONG&gt;&lt;/FONT&gt; FC_Coll) f nil)
	)
      )
      (while (or b (setq a (Car FC_Coll)))
	(if
	  (setq	b (vl-some '(lambda (c)
			      (if &lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;(and&lt;/STRONG&gt;&lt;/FONT&gt;
				    (equal (Car a) (Car c))&lt;STRONG&gt;&lt;FONT color="#0000FF"&gt;(equal (Cadr a) (Cadr c)))&lt;/FONT&gt;&lt;/STRONG&gt;
				c
			      )
			    )
			   (cdr FC_Coll)
		  )
	  )
	   (progn
	     (entmakex (list (cons 0 "LINE")
			     (cons 10 (_ipt (&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;last&lt;/STRONG&gt;&lt;/FONT&gt; a)))
			     (cons 11 (_ipt (&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;last&lt;/STRONG&gt;&lt;/FONT&gt; b)))
		       )
	     )
	     (ssadd (&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;last&lt;/STRONG&gt;&lt;/FONT&gt; a) ssdup)
	     (ssadd (&lt;FONT color="#0000FF"&gt;&lt;STRONG&gt;last&lt;/STRONG&gt; &lt;/FONT&gt;b) ssdup)
	     (setq FC_Coll (Vl-remove b FC_Coll)
		   b	   a
	     )
	   )
	   (setq FC_Coll (cdr FC_Coll))
	)
      )
      (sssetfirst nil ssdup)
    )
  )
  (princ)
)
&lt;/PRE&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 29 Jan 2023 12:30:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-find-a-duplicate-attribute-value/m-p/11713675#M53887</guid>
      <dc:creator>pbejse</dc:creator>
      <dc:date>2023-01-29T12:30:30Z</dc:date>
    </item>
    <item>
      <title>Re: LISP to find a duplicate attribute value</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-find-a-duplicate-attribute-value/m-p/11713758#M53888</link>
      <description>&lt;P&gt;Thank you very much, that works.&lt;/P&gt;</description>
      <pubDate>Sun, 29 Jan 2023 13:49:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-find-a-duplicate-attribute-value/m-p/11713758#M53888</guid>
      <dc:creator>adminXYZ5K</dc:creator>
      <dc:date>2023-01-29T13:49:01Z</dc:date>
    </item>
    <item>
      <title>Re: LISP to use M2P - mirror between two points</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-find-a-duplicate-attribute-value/m-p/12854230#M53889</link>
      <description>&lt;P&gt;Hello and thanks&lt;/P&gt;&lt;P&gt;I have the lisp routine for M2P but I don't know where to put it.&amp;nbsp; To mirror between two points&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(defun c:m2p (/ ent1 ent2 ep1 ep2 pt1 pt2 sp1 sp2 tmp)&lt;BR /&gt;&amp;nbsp;(setq ent1 (car (entsel "\nSelect first line: "))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ent2 (car (entsel " \nselect second line: "))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sp1&amp;nbsp; (vlax-curve-getstartpoint ent1)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ep1&amp;nbsp; (vlax-curve-getendpoint ent1)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sp2&amp;nbsp; (vlax-curve-getstartpoint ent2)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ep2&amp;nbsp; (vlax-curve-getendpoint ent2))&lt;BR /&gt;&amp;nbsp;(if (&amp;gt; (distance sp1 sp2) (distance sp1 ep2))&lt;BR /&gt;&amp;nbsp; (setq tmp sp2&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sp2 ep2&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ep2 tmp))&lt;BR /&gt;&amp;nbsp;(setq pt1 (mapcar '/ (mapcar '+ sp1 sp2) '(2 2))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pt2 (mapcar '/ (mapcar '+ ep1 ep2) '(2 2)))&lt;BR /&gt;&amp;nbsp;(command "._mirror" (ssget) "" pt1 pt2 "_n"))&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jun 2024 17:45:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-find-a-duplicate-attribute-value/m-p/12854230#M53889</guid>
      <dc:creator>5624david</dc:creator>
      <dc:date>2024-06-21T17:45:08Z</dc:date>
    </item>
    <item>
      <title>Re: LISP to use M2P - mirror between two points</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-find-a-duplicate-attribute-value/m-p/12854236#M53890</link>
      <description>&lt;P&gt;I tried posting this once so it may have already been posted.&amp;nbsp; My mirror between 2 points icons quit working so my reseller sent me the lisp routine but I have no idea where to put it.&amp;nbsp; I don't know anything about stuff like this&amp;nbsp; &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(defun c:m2p (/ ent1 ent2 ep1 ep2 pt1 pt2 sp1 sp2 tmp)&lt;BR /&gt;&amp;nbsp;(setq ent1 (car (entsel "\nSelect first line: "))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ent2 (car (entsel " \nselect second line: "))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sp1&amp;nbsp; (vlax-curve-getstartpoint ent1)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ep1&amp;nbsp; (vlax-curve-getendpoint ent1)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sp2&amp;nbsp; (vlax-curve-getstartpoint ent2)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ep2&amp;nbsp; (vlax-curve-getendpoint ent2))&lt;BR /&gt;&amp;nbsp;(if (&amp;gt; (distance sp1 sp2) (distance sp1 ep2))&lt;BR /&gt;&amp;nbsp; (setq tmp sp2&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; sp2 ep2&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ep2 tmp))&lt;BR /&gt;&amp;nbsp;(setq pt1 (mapcar '/ (mapcar '+ sp1 sp2) '(2 2))&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pt2 (mapcar '/ (mapcar '+ ep1 ep2) '(2 2)))&lt;BR /&gt;&amp;nbsp;(command "._mirror" (ssget) "" pt1 pt2 "_n"))&lt;/P&gt;</description>
      <pubDate>Fri, 21 Jun 2024 17:51:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-find-a-duplicate-attribute-value/m-p/12854236#M53890</guid>
      <dc:creator>5624david</dc:creator>
      <dc:date>2024-06-21T17:51:22Z</dc:date>
    </item>
    <item>
      <title>Re: LISP to use M2P - mirror between two points</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-find-a-duplicate-attribute-value/m-p/12858424#M53891</link>
      <description>&lt;P&gt;Please do not double / tripple post.&lt;/P&gt;&lt;P&gt;See my remarks on your topic 'Lisp'.&lt;/P&gt;&lt;P&gt;Here is what I posted there:&lt;/P&gt;&lt;P&gt;"&lt;/P&gt;&lt;P&gt;You say:&lt;/P&gt;&lt;P&gt;"&lt;SPAN&gt;I have a lisp routine someone sent me" ..&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;You could ask that individual what to do with it.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;OR,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;You could load that program with every drawing open. (assuming you have a version of AutoCAD that supports Lisp).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;You place a copy of your lisp in any 'support' folder for acad, then using Notepad, make a file called acaddoc.lsp with this in it.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;(load "M2P.lsp")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;IF you have the file M2P.lsp stored somewhere else on you drive, use the 'path' to the M2P.lsp file, such as:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;(load "c:/path/M2P.lsp"); where path is your location of the file.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Place the acaddoc.lsp&amp;nbsp; in your \AutoCADxxx\Support&amp;nbsp; &amp;nbsp;folder.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Open Acad, then at the Command Prompt, type M2P&amp;lt;enter&amp;gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;ECCAD"&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Jun 2024 16:20:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-find-a-duplicate-attribute-value/m-p/12858424#M53891</guid>
      <dc:creator>ec-cad</dc:creator>
      <dc:date>2024-06-24T16:20:05Z</dc:date>
    </item>
  </channel>
</rss>

