<?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: Script to explode block and transfer to layer in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/script-to-explode-block-and-transfer-to-layer/m-p/12377041#M21818</link>
    <description>&lt;P&gt;Awesome, thanks!&lt;/P&gt;</description>
    <pubDate>Tue, 14 Nov 2023 18:12:06 GMT</pubDate>
    <dc:creator>Temssi.d</dc:creator>
    <dc:date>2023-11-14T18:12:06Z</dc:date>
    <item>
      <title>Script to explode block and transfer to layer</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/script-to-explode-block-and-transfer-to-layer/m-p/12375573#M21812</link>
      <description>&lt;P&gt;I am looking for a script that will explode a block and then transfer all its parts to a specific layer&lt;/P&gt;&lt;P&gt;(01_layer).&lt;/P&gt;&lt;P&gt;Thank you for your help!&lt;/P&gt;</description>
      <pubDate>Tue, 14 Nov 2023 07:16:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/script-to-explode-block-and-transfer-to-layer/m-p/12375573#M21812</guid>
      <dc:creator>Temssi.d</dc:creator>
      <dc:date>2023-11-14T07:16:10Z</dc:date>
    </item>
    <item>
      <title>Re: Script to explode block and transfer to layer</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/script-to-explode-block-and-transfer-to-layer/m-p/12375815#M21813</link>
      <description>&lt;P&gt;check this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="lisp"&gt;(defun c:explode_to_layer (/ list_exploded last_ename sset_exploded)
	(setq target_insert (vlax-ename-&amp;gt;vla-object (car (entsel "\nPick target insert: ")))
		  last_ename (entlast)
	)
	(if (setq list_exploded (vlax-invoke target_insert 'explode))
		(mapcar '(lambda (object) (vla-put-layer object "01_layer")) list_exploded)
		(progn
			(setq sset_exploded (ssadd))
			(while (setq last_ename (entnext last_ename))
				(ssadd last_ename sset_exploded) 
			)
			(command "_chprop" sset_exploded "" "_la" "01_layer" "")
		)
	)
	(vla-erase target_insert) 
	(princ)
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 14 Nov 2023 10:57:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/script-to-explode-block-and-transfer-to-layer/m-p/12375815#M21813</guid>
      <dc:creator>komondormrex</dc:creator>
      <dc:date>2023-11-14T10:57:09Z</dc:date>
    </item>
    <item>
      <title>Re: Script to explode block and transfer to layer</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/script-to-explode-block-and-transfer-to-layer/m-p/12376334#M21814</link>
      <description>&lt;P&gt;Since the result of an EXPLODE command simply becomes the &lt;STRONG&gt;P&lt;/STRONG&gt;revious selection set, there's no need to save the last object, Explode, and then step through and find all newer objects.&amp;nbsp; It can be simpler:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;(defun C:X2L (/ ss)
  (prompt "\nTo Explode Block(s) to Layer 01_layer,")
  (if (setq ss (ssget "_:L" '((0 . "INSERT"))))
    (progn ; then
      (initcommandversion)
      (command
        "_.explode" ss ""
        "_.chprop" "_previous" "" "_layer" "01_layer" ""
      ); command
    ); progn
  ); if
  (prin1)
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;which also prevents selection of inappropriate objects, and even lets you do it to as many Blocks as you want, all at the same time.&lt;/P&gt;
&lt;P&gt;That assumes that the Layer in question exists in the drawing.&amp;nbsp; If it might not, that can be accommodated.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Nov 2023 13:40:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/script-to-explode-block-and-transfer-to-layer/m-p/12376334#M21814</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2023-11-14T13:40:45Z</dc:date>
    </item>
    <item>
      <title>Re: Script to explode block and transfer to layer</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/script-to-explode-block-and-transfer-to-layer/m-p/12376440#M21815</link>
      <description>&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5656544"&gt;@Temssi.d&lt;/a&gt;  XPLODE command (there is no E at the beginning) has been around for decades and does what you want, and more &lt;BR /&gt;&lt;A href="https://help.autodesk.com/view/ACD/2023/ENU/?guid=GUID-FC4139AB-D527-4743-8E68-F83DA6E5D192#:~:text=SHARE-,XPLODE%20(Command),-Breaks%20a%20compound" target="_blank"&gt;https://help.autodesk.com/view/ACD/2023/ENU/?guid=GUID-FC4139AB-D527-4743-8E68-F83DA6E5D192#:~:text=SHARE-,XPLODE%20(Command),-Breaks%20a%20compound&lt;/A&gt; &lt;BR /&gt;&lt;BR /&gt;It's even in the LT version of AutoCAD.</description>
      <pubDate>Tue, 14 Nov 2023 14:13:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/script-to-explode-block-and-transfer-to-layer/m-p/12376440#M21815</guid>
      <dc:creator>pendean</dc:creator>
      <dc:date>2023-11-14T14:13:10Z</dc:date>
    </item>
    <item>
      <title>Re: Script to explode block and transfer to layer</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/script-to-explode-block-and-transfer-to-layer/m-p/12377033#M21816</link>
      <description>Thank you so much it works perfectly! ‌‌</description>
      <pubDate>Tue, 14 Nov 2023 18:09:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/script-to-explode-block-and-transfer-to-layer/m-p/12377033#M21816</guid>
      <dc:creator>Temssi.d</dc:creator>
      <dc:date>2023-11-14T18:09:45Z</dc:date>
    </item>
    <item>
      <title>Re: Script to explode block and transfer to layer</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/script-to-explode-block-and-transfer-to-layer/m-p/12377036#M21817</link>
      <description>Wow!&lt;BR /&gt;thanks:)&lt;BR /&gt;</description>
      <pubDate>Tue, 14 Nov 2023 18:10:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/script-to-explode-block-and-transfer-to-layer/m-p/12377036#M21817</guid>
      <dc:creator>Temssi.d</dc:creator>
      <dc:date>2023-11-14T18:10:18Z</dc:date>
    </item>
    <item>
      <title>Re: Script to explode block and transfer to layer</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/script-to-explode-block-and-transfer-to-layer/m-p/12377041#M21818</link>
      <description>&lt;P&gt;Awesome, thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 14 Nov 2023 18:12:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/script-to-explode-block-and-transfer-to-layer/m-p/12377041#M21818</guid>
      <dc:creator>Temssi.d</dc:creator>
      <dc:date>2023-11-14T18:12:06Z</dc:date>
    </item>
  </channel>
</rss>

