<?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: Block Rename to Attribute Tag Value in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/block-rename-to-attribute-tag-value/m-p/10577736#M72081</link>
    <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;Thanks for the code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it possible to change the code so it makes a new block but only whit the content of the specified layer? I have a block that contains two layers and I need content of only one layer.&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;Denis&lt;/P&gt;</description>
    <pubDate>Fri, 27 Aug 2021 07:43:02 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2021-08-27T07:43:02Z</dc:date>
    <item>
      <title>Block Rename to Attribute Tag Value</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/block-rename-to-attribute-tag-value/m-p/9638877#M72076</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to rename my blocks with the Attribute tag value.&lt;/P&gt;&lt;P&gt;In the included example drawing I have 2 different Blocks (Style-M) &amp;amp; (Style-L) with multiple copies of each.&lt;/P&gt;&lt;P&gt;And each copies have its unique Attributes and I want to rename each copies of the block using the Attribute values.&lt;/P&gt;&lt;P&gt;For e.g. Style-M blocks will need be renamed using the attributes to 2000, 2001, 2002 ...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have been searching the forum and the closest I could find is the below.&lt;/P&gt;&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/block-rename-to-attribute-text-value/m-p/3926303" target="_blank"&gt;https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/block-rename-to-attribute-text-value/m-p/3926303&lt;/A&gt;&lt;/P&gt;&lt;P&gt;The LISP as it is doesn't work for my requirement, but I am hopeful that the experts here can provide a solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Nazeeb H&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jul 2020 12:24:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/block-rename-to-attribute-tag-value/m-p/9638877#M72076</guid>
      <dc:creator>NAZEEB.HAMZA</dc:creator>
      <dc:date>2020-07-16T12:24:27Z</dc:date>
    </item>
    <item>
      <title>Re: Block Rename to Attribute Tag Value</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/block-rename-to-attribute-tag-value/m-p/9639167#M72077</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7973843"&gt;@NAZEEB.HAMZA&lt;/a&gt;&amp;nbsp;wrote:
&lt;P&gt;For e.g. Style-M blocks will need be renamed using the attributes to 2000, 2001, 2002 ...&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT size="3"&gt;Untested... copied from link&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;I see its a different , let me get my hands on a computer, hang on.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;Here you go.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;(Defun c:renb ( /. aDoc blocks ss i effname e)
  (setq aDoc (vla-get-ActiveDocument (vlax-get-acad-object))
	blocks (vla-get-blocks adoc))
  	(if (setq ss (ssget "_:L" '((0 . "INSERT"))))
	  	(repeat (setq i (sslength ss))
		  	(setq e (vlax-ename-&amp;gt;vla-object (ssname ss (setq i (1- i))))
				effname (vla-get-EffectiveName e))
		  (cond
		    (	(not (setq atval (vl-some
				      '(lambda (at)
					 (if (= (vla-get-tagstring at) "PK1") (vla-get-textstring at)))
			  	(vlax-invoke e 'GetAttributes)))		
						)
		     )
		    ( (tblsearch "BLOCK" atval) (vlax-put e 'Name atval)
		     				)
		    ( (=  effname atval)	)	
		    ( T
		       (vlax-invoke e 'ConvertToAnonymousBlock) 
		       (vla-put-name (vla-item blocks (Vlax-get e 'Name)) atval) )
		    			)
		  )	
	  )
  (princ)
  )&lt;/LI-CODE&gt;
&lt;P&gt;HTH&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jul 2020 14:48:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/block-rename-to-attribute-tag-value/m-p/9639167#M72077</guid>
      <dc:creator>pbejse</dc:creator>
      <dc:date>2020-07-16T14:48:05Z</dc:date>
    </item>
    <item>
      <title>Re: Block Rename to Attribute Tag Value</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/block-rename-to-attribute-tag-value/m-p/9639260#M72078</link>
      <description>&lt;P&gt;It working..... &lt;span class="lia-unicode-emoji" title=":grinning_face:"&gt;😀&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jul 2020 15:00:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/block-rename-to-attribute-tag-value/m-p/9639260#M72078</guid>
      <dc:creator>kajanthangavel</dc:creator>
      <dc:date>2020-07-16T15:00:32Z</dc:date>
    </item>
    <item>
      <title>Re: Block Rename to Attribute Tag Value</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/block-rename-to-attribute-tag-value/m-p/9639273#M72079</link>
      <description>&lt;P&gt;Awesome!!! It is working, Thanks a lot Mr. Patrick.&lt;/P&gt;&lt;P&gt;I also really appreciate the quick response.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jul 2020 15:11:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/block-rename-to-attribute-tag-value/m-p/9639273#M72079</guid>
      <dc:creator>NAZEEB.HAMZA</dc:creator>
      <dc:date>2020-07-16T15:11:50Z</dc:date>
    </item>
    <item>
      <title>Re: Block Rename to Attribute Tag Value</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/block-rename-to-attribute-tag-value/m-p/9639298#M72080</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7973843"&gt;@NAZEEB.HAMZA&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Awesome!!! It is working, Thanks a lot.&lt;/P&gt;
&lt;P&gt;Also I really appreciate the quick solution!&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT size="3"&gt;Good to hear that. You are welcome&amp;nbsp;&amp;nbsp;&lt;/FONT&gt;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;FONT size="3"&gt;- One is glad to be of service --&amp;nbsp;&lt;/FONT&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;Nice to know it works for you too&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6662555"&gt;@kajanthangavel&lt;/a&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Jul 2020 15:16:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/block-rename-to-attribute-tag-value/m-p/9639298#M72080</guid>
      <dc:creator>pbejse</dc:creator>
      <dc:date>2020-07-16T15:16:46Z</dc:date>
    </item>
    <item>
      <title>Re: Block Rename to Attribute Tag Value</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/block-rename-to-attribute-tag-value/m-p/10577736#M72081</link>
      <description>&lt;P&gt;Hi!&lt;/P&gt;&lt;P&gt;Thanks for the code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it possible to change the code so it makes a new block but only whit the content of the specified layer? I have a block that contains two layers and I need content of only one layer.&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;Denis&lt;/P&gt;</description>
      <pubDate>Fri, 27 Aug 2021 07:43:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/block-rename-to-attribute-tag-value/m-p/10577736#M72081</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-08-27T07:43:02Z</dc:date>
    </item>
    <item>
      <title>Re: Block Rename to Attribute Tag Value</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/block-rename-to-attribute-tag-value/m-p/10578126#M72082</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Is it possible to change the code so it makes a new block but only whit the content of the specified layer? I have a block that contains two layers and I need content of only one layer.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT size="3"&gt;That's an interesting twist to the original intent of the code. I supposed it can be done. How would the user specify the layer ? and what will be the eventual name of the block? will it still be from an attribute value?&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Aug 2021 10:27:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/block-rename-to-attribute-tag-value/m-p/10578126#M72082</guid>
      <dc:creator>pbejse</dc:creator>
      <dc:date>2021-08-27T10:27:35Z</dc:date>
    </item>
    <item>
      <title>Re: Block Rename to Attribute Tag Value</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/block-rename-to-attribute-tag-value/m-p/10578149#M72083</link>
      <description>&lt;P&gt;thanks for answer&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;it could be specified in the code that the content of the layer named LAYER1 should create the new named block.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I didn't say at the first post...content of the second layer should move outside the block, not to be deleted.&lt;/P&gt;&lt;P&gt;Yes, the name&amp;nbsp;&lt;SPAN&gt;will still be from an attribute value.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;tnx&lt;/P&gt;&lt;P&gt;d&lt;/P&gt;</description>
      <pubDate>Fri, 27 Aug 2021 10:49:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/block-rename-to-attribute-tag-value/m-p/10578149#M72083</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-08-27T10:49:40Z</dc:date>
    </item>
    <item>
      <title>Re: Block Rename to Attribute Tag Value</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/block-rename-to-attribute-tag-value/m-p/10578263#M72084</link>
      <description>&lt;P&gt;&lt;EM&gt;-move outside the block,&amp;nbsp;-&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;On every instance of the block?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A sample drawing would explain much better than how the way you were describing the intent.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Aug 2021 11:30:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/block-rename-to-attribute-tag-value/m-p/10578263#M72084</guid>
      <dc:creator>pbejse</dc:creator>
      <dc:date>2021-08-27T11:30:48Z</dc:date>
    </item>
    <item>
      <title>Re: Block Rename to Attribute Tag Value</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/block-rename-to-attribute-tag-value/m-p/10578326#M72085</link>
      <description>&lt;P&gt;Sorry for not being clear...here is a sample drawing&lt;/P&gt;&lt;P&gt;content of layer2 could be in the old block if that's easier to do...&lt;/P&gt;</description>
      <pubDate>Fri, 27 Aug 2021 11:53:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/block-rename-to-attribute-tag-value/m-p/10578326#M72085</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-08-27T11:53:59Z</dc:date>
    </item>
    <item>
      <title>Re: Block Rename to Attribute Tag Value</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/block-rename-to-attribute-tag-value/m-p/10578634#M72086</link>
      <description>&lt;P&gt;&lt;FONT size="3"&gt;But what of the value of the attributes? Are you wanting to retain the value and not leave it as a broken link?&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="pbejse_0-1630070362433.png" style="width: 263px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/958107i82EEFD9A8CADC362/image-dimensions/263x168?v=v2" width="263" height="168" role="button" title="pbejse_0-1630070362433.png" alt="pbejse_0-1630070362433.png" /&gt;&lt;/span&gt;&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>Fri, 27 Aug 2021 13:21:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/block-rename-to-attribute-tag-value/m-p/10578634#M72086</guid>
      <dc:creator>pbejse</dc:creator>
      <dc:date>2021-08-27T13:21:11Z</dc:date>
    </item>
    <item>
      <title>Re: Block Rename to Attribute Tag Value</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/block-rename-to-attribute-tag-value/m-p/10578641#M72087</link>
      <description>&lt;P&gt;If it's any problem to retain value it can be a broken link.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Aug 2021 13:24:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/block-rename-to-attribute-tag-value/m-p/10578641#M72087</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-08-27T13:24:44Z</dc:date>
    </item>
    <item>
      <title>Re: Block Rename to Attribute Tag Value</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/block-rename-to-attribute-tag-value/m-p/10580393#M72088</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Sorry for not being clear...here is a sample drawing&lt;/P&gt;
&lt;P&gt;content of layer2 could be in the old block if that's easier to do...&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT size="3"&gt;I had to delete the "K_NP_125_65_140" block that was there on the sample drawing , as the insertion point is way off.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;Here's how the code works&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT size="3"&gt;The list shown on the code is key.&lt;/FONT&gt;&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;(setq BnameLayer '(("POLICA" "POLICA" "LAYER1")))&lt;/LI-CODE&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;FONT size="3"&gt;The first item of the list is the Block name&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT size="3"&gt;Second item is the TAG name as the source for the new name&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;FONT size="3"&gt;Third item is the layer name to be retained on the renamed block, the rest will be left "outside"&lt;/FONT&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Command: &lt;STRONG&gt;REBeL&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;Select objects: Specify opposite corner: 12 found&lt;/P&gt;
&lt;P&gt;Select objects:&lt;BR /&gt;Block reference renamed to: K_NP_125_65_140&lt;BR /&gt;Block reference renamed to: K_NP_125_35_140&lt;BR /&gt;Block reference renamed to: K_NP_100_45_140&lt;BR /&gt;Block reference renamed to: K_NP_90_35_140&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;HTH&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;Refer to attached files [&amp;nbsp;Rename Explode By Layer.dwg |&amp;nbsp;Rename Explode By Layer.lsp ]&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 28 Aug 2021 04:56:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/block-rename-to-attribute-tag-value/m-p/10580393#M72088</guid>
      <dc:creator>pbejse</dc:creator>
      <dc:date>2021-08-28T04:56:49Z</dc:date>
    </item>
    <item>
      <title>Re: Block Rename to Attribute Tag Value</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/block-rename-to-attribute-tag-value/m-p/10581548#M72089</link>
      <description>&lt;P&gt;Thank you very much, it is working perfectly!&lt;/P&gt;&lt;P&gt;Regards!&lt;/P&gt;&lt;P&gt;Denis&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 28 Aug 2021 19:28:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/block-rename-to-attribute-tag-value/m-p/10581548#M72089</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-08-28T19:28:52Z</dc:date>
    </item>
    <item>
      <title>Re: Block Rename to Attribute Tag Value</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/block-rename-to-attribute-tag-value/m-p/10584510#M72090</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;@Anonymous&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thank you very much, it is working perfectly!&lt;/P&gt;
&lt;P&gt;Regards!&lt;/P&gt;
&lt;P&gt;Denis&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;FONT size="3"&gt;Glad i could help &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 30 Aug 2021 12:30:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/block-rename-to-attribute-tag-value/m-p/10584510#M72090</guid>
      <dc:creator>pbejse</dc:creator>
      <dc:date>2021-08-30T12:30:54Z</dc:date>
    </item>
  </channel>
</rss>

