<?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 Move Blocks to insertion point of another Block in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/move-blocks-to-insertion-point-of-another-block/m-p/8915522#M86424</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone have a LISP that can move a selection of blocks so that they all meet together at their &lt;U&gt;insertion points&lt;/U&gt;, or a given coordinate?&lt;/P&gt;&lt;P&gt;I am cleaning up my cooworkers drawings and they don't bother placing their blocks neatly.&amp;nbsp;&amp;nbsp; For example: I've got 5 blocks in a cluster that &lt;EM&gt;should&lt;/EM&gt; all be inserted at the same point, but they are scattered about.&amp;nbsp; I've got endless clusters to clean.&lt;/P&gt;</description>
    <pubDate>Wed, 17 Jul 2019 20:08:03 GMT</pubDate>
    <dc:creator>Designer_1E</dc:creator>
    <dc:date>2019-07-17T20:08:03Z</dc:date>
    <item>
      <title>Move Blocks to insertion point of another Block</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/move-blocks-to-insertion-point-of-another-block/m-p/8915522#M86424</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone have a LISP that can move a selection of blocks so that they all meet together at their &lt;U&gt;insertion points&lt;/U&gt;, or a given coordinate?&lt;/P&gt;&lt;P&gt;I am cleaning up my cooworkers drawings and they don't bother placing their blocks neatly.&amp;nbsp;&amp;nbsp; For example: I've got 5 blocks in a cluster that &lt;EM&gt;should&lt;/EM&gt; all be inserted at the same point, but they are scattered about.&amp;nbsp; I've got endless clusters to clean.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jul 2019 20:08:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/move-blocks-to-insertion-point-of-another-block/m-p/8915522#M86424</guid>
      <dc:creator>Designer_1E</dc:creator>
      <dc:date>2019-07-17T20:08:03Z</dc:date>
    </item>
    <item>
      <title>Re: Move Blocks to insertion point of another Block</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/move-blocks-to-insertion-point-of-another-block/m-p/8915713#M86425</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;(rh:get_blks ( / ss)
  (prompt "\nSelect Blocks to align : ")
  (setq ss (ssget '((0 . "INSERT"))))
);end_defun

(defun c:ab ( / osm ss a_pt cnt ent i_pt)

  (setq osm (getvar 'osmode))
  
  (while (setq ss (rh:get_blks))
    (setvar 'osmode 64)
    (setq a_pt (getpoint "\nSelect Alignment Point : "))
    (repeat (setq cnt (sslength ss))
      (setq ent (ssname ss (setq cnt (1- cnt)))
            i_pt (cdr (assoc 10 (entget ent)))
      );end_setq
      (setvar 'osmode 0)
      (vl-cmdf "move" ent i_pt a_pt)
      (setvar 'osmode 64)&lt;BR /&gt;    );end_repeat
    (setq ss nil)&lt;BR /&gt;    (gc)&lt;BR /&gt;  );end_while
  (setvar 'osmode osm)
  (princ)
);end_defun&lt;/PRE&gt;&lt;P&gt;No error checking. Everything happens in a while loop, so you can process multiple groups without restarting the lisp. Too quit press return when asked to select blocks. Only select blocks in groups required.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;OSMODE is set to (insertion) when asked to select the alignment point then off when the blocks are moved.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Its not ideal but should speed things up.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jul 2019 21:23:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/move-blocks-to-insertion-point-of-another-block/m-p/8915713#M86425</guid>
      <dc:creator>dlanorh</dc:creator>
      <dc:date>2019-07-17T21:23:11Z</dc:date>
    </item>
    <item>
      <title>Re: Move Blocks to insertion point of another Block</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/move-blocks-to-insertion-point-of-another-block/m-p/8915774#M86426</link>
      <description>&lt;P&gt;Sorry, code didn't update properly. Try This&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;(defun rh:get_blks ( / ss)
  (prompt "\nSelect Blocks to align : ")
  (setq ss (ssget '((0 . "INSERT"))))
);end_defun

(defun c:ab ( / osm ss a_pt cnt ent i_pt)

  (setq osm (getvar 'osmode))
  
  (while (setq ss (rh:get_blks))
    (setvar 'osmode 64)
    (setq a_pt (getpoint "\nSelect Alignment Point : "))
    (repeat (setq cnt (sslength ss))
      (setq ent (ssname ss (setq cnt (1- cnt)))
            i_pt (cdr (assoc 10 (entget ent)))
      );end_setq
      (setvar 'osmode 0)
      (vl-cmdf "move" ent "" i_pt a_pt)
      (setvar 'osmode 64)
    );end_repeat
    (setq ss nil)
    (gc)
  );end_while
  (setvar 'osmode osm)
  (princ)
);end_defun&lt;/PRE&gt;</description>
      <pubDate>Wed, 17 Jul 2019 22:00:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/move-blocks-to-insertion-point-of-another-block/m-p/8915774#M86426</guid>
      <dc:creator>dlanorh</dc:creator>
      <dc:date>2019-07-17T22:00:39Z</dc:date>
    </item>
    <item>
      <title>Re: Move Blocks to insertion point of another Block</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/move-blocks-to-insertion-point-of-another-block/m-p/8917206#M86427</link>
      <description>&lt;P&gt;This is really close.&amp;nbsp; It does group the blocks together, but not at the point selected.&amp;nbsp; For some reason they are moved to&amp;nbsp; -70',-70' from the selected point?&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2019 14:34:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/move-blocks-to-insertion-point-of-another-block/m-p/8917206#M86427</guid>
      <dc:creator>Designer_1E</dc:creator>
      <dc:date>2019-07-18T14:34:46Z</dc:date>
    </item>
    <item>
      <title>Re: Move Blocks to insertion point of another Block</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/move-blocks-to-insertion-point-of-another-block/m-p/8917232#M86428</link>
      <description>&lt;P&gt;ok, I think it is because I changed the origin in that file... Now I need to figure out how to reset the origin.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jul 2019 14:43:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/move-blocks-to-insertion-point-of-another-block/m-p/8917232#M86428</guid>
      <dc:creator>Designer_1E</dc:creator>
      <dc:date>2019-07-18T14:43:09Z</dc:date>
    </item>
    <item>
      <title>Re: Move Blocks to insertion point of another Block</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/move-blocks-to-insertion-point-of-another-block/m-p/8945671#M86429</link>
      <description>&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Aug 2019 17:40:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/move-blocks-to-insertion-point-of-another-block/m-p/8945671#M86429</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2019-08-02T17:40:47Z</dc:date>
    </item>
  </channel>
</rss>

