<?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: NCOPY with window selection in Visual LISP, AutoLISP and General Customization Forum</title>
    <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/ncopy-with-window-selection/m-p/9092210#M82871</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/69526"&gt;@Kent1Cooper&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1779365"&gt;@ВeekeeCZ&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Playing with this approach, but it fails on (entnext)...&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I assume it's not really necessary to remove the &lt;EM&gt;newly-copied&lt;/EM&gt;&amp;nbsp; objects from the Block.&amp;nbsp; You can remove the original selection, and leave the newly-copied ones as part of the Block.&amp;nbsp; Does this work [untested]?&lt;/P&gt;
&lt;PRE&gt;(defun C:NCopyM (/ ss) ; = NCOPY Multiple objects
  (command "_.-REFEDIT" pause "_Ok" "_All" "_No")
  (if (setq ss (ssget "_:L"))
    (command
      "_.COPY" ss "" "0,0" "0,0"
      "_.REFSET" "_R" ss ""
    ); command
  ); if
  &lt;STRONG&gt;(command "_.REFCLOSE" &lt;FONT color="#FF0000"&gt;"_SAVE"&lt;/FONT&gt;) &lt;/STRONG&gt;
  (command-s "_.MOVE" ss "")
  (princ)
)&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It isn't unless you actually save the changes to the original. That I didn't want to do...&lt;/P&gt;
&lt;P&gt;But maybe&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6615168"&gt;@SAFizzy&lt;/a&gt;&amp;nbsp; wouldn't mind...&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 17 Oct 2019 12:48:13 GMT</pubDate>
    <dc:creator>ВeekeeCZ</dc:creator>
    <dc:date>2019-10-17T12:48:13Z</dc:date>
    <item>
      <title>NCOPY with window selection</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/ncopy-with-window-selection/m-p/9091896#M82867</link>
      <description>&lt;P&gt;Hello Friends&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i am looking for NCOPY with window selection, but can't find any solution. can some one help me by customizing through lisp rutine so i can copy objects by window selection.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Thu, 17 Oct 2019 10:59:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/ncopy-with-window-selection/m-p/9091896#M82867</guid>
      <dc:creator>SAFizzy</dc:creator>
      <dc:date>2019-10-17T10:59:44Z</dc:date>
    </item>
    <item>
      <title>Re: NCOPY with window selection</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/ncopy-with-window-selection/m-p/9091966#M82868</link>
      <description>&lt;P&gt;&lt;A href="https://www.cadtutor.net/forum/topic/52294-selection-set-with-multiple-nested-objects/" target="_blank"&gt;https://www.cadtutor.net/forum/topic/52294-selection-set-with-multiple-nested-objects/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Oct 2019 11:24:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/ncopy-with-window-selection/m-p/9091966#M82868</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2019-10-17T11:24:09Z</dc:date>
    </item>
    <item>
      <title>Re: NCOPY with window selection</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/ncopy-with-window-selection/m-p/9092160#M82869</link>
      <description>&lt;P&gt;Playing with this approach, but it fails on (entnext)...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(defun c:CopyNestedObjects (/ enl ss sn) 
  (command "_.-REFEDIT" pause "_Ok" "_All" "_No")
  (setq enl (entlast))
  (if (setq ss (ssget "_:L"))
    (command "_.COPY" ss "" "0,0" "0,0"))
  (setq sn (&lt;STRONG&gt;somehow-select-all-new&lt;/STRONG&gt;))
  (if (&amp;gt; (sslength sn) 0)
    (command "_.REFSET" "_R" ss ""))
  (command "_.REFCLOSE" "_Disc")
  (command-s "_.MOVE" ss "")
  (princ)
)&lt;/PRE&gt;</description>
      <pubDate>Thu, 17 Oct 2019 12:27:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/ncopy-with-window-selection/m-p/9092160#M82869</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2019-10-17T12:27:55Z</dc:date>
    </item>
    <item>
      <title>Re: NCOPY with window selection</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/ncopy-with-window-selection/m-p/9092198#M82870</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1779365"&gt;@ВeekeeCZ&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Playing with this approach, but it fails on (entnext)...&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I assume it's not really necessary to remove the &lt;EM&gt;newly-copied&lt;/EM&gt;&amp;nbsp; objects from the Block.&amp;nbsp; You can remove the original selection, and leave the newly-copied ones as part of the Block.&amp;nbsp; Does this work [untested]?&lt;/P&gt;
&lt;PRE&gt;(defun C:NCopyM (/ ss) ; = NCOPY Multiple objects
  (command "_.-REFEDIT" pause "_Ok" "_All" "_No")
  (if (setq ss (ssget "_:L"))
    (command
      "_.COPY" ss "" "0,0" "0,0"
      "_.REFSET" "_R" ss ""
    ); command
  ); if
  (command "_.REFCLOSE" "_Disc")
  (command-s "_.MOVE" ss "")
  (princ)
)&lt;/PRE&gt;</description>
      <pubDate>Thu, 17 Oct 2019 12:38:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/ncopy-with-window-selection/m-p/9092198#M82870</guid>
      <dc:creator>Kent1Cooper</dc:creator>
      <dc:date>2019-10-17T12:38:54Z</dc:date>
    </item>
    <item>
      <title>Re: NCOPY with window selection</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/ncopy-with-window-selection/m-p/9092210#M82871</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/69526"&gt;@Kent1Cooper&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1779365"&gt;@ВeekeeCZ&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Playing with this approach, but it fails on (entnext)...&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I assume it's not really necessary to remove the &lt;EM&gt;newly-copied&lt;/EM&gt;&amp;nbsp; objects from the Block.&amp;nbsp; You can remove the original selection, and leave the newly-copied ones as part of the Block.&amp;nbsp; Does this work [untested]?&lt;/P&gt;
&lt;PRE&gt;(defun C:NCopyM (/ ss) ; = NCOPY Multiple objects
  (command "_.-REFEDIT" pause "_Ok" "_All" "_No")
  (if (setq ss (ssget "_:L"))
    (command
      "_.COPY" ss "" "0,0" "0,0"
      "_.REFSET" "_R" ss ""
    ); command
  ); if
  &lt;STRONG&gt;(command "_.REFCLOSE" &lt;FONT color="#FF0000"&gt;"_SAVE"&lt;/FONT&gt;) &lt;/STRONG&gt;
  (command-s "_.MOVE" ss "")
  (princ)
)&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It isn't unless you actually save the changes to the original. That I didn't want to do...&lt;/P&gt;
&lt;P&gt;But maybe&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/6615168"&gt;@SAFizzy&lt;/a&gt;&amp;nbsp; wouldn't mind...&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Oct 2019 12:48:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/ncopy-with-window-selection/m-p/9092210#M82871</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2019-10-17T12:48:13Z</dc:date>
    </item>
    <item>
      <title>Re: NCOPY with window selection</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/ncopy-with-window-selection/m-p/9093337#M82872</link>
      <description>&lt;P&gt;Seems that a vla-copy method does a better job.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;(vl-load-com)

(defun c:CopyNestedObjects (/ ss sn doc obj objnew)
  
  (command "_.-REFEDIT" pause "_Ok" "_All" "_No")

  (if (and (setq ss (ssget "_:L"))
	   (setq doc (vla-get-ActiveDocument (vlax-get-acad-object)))
	   (setq sn (ssadd))
	   )	 
    (repeat (setq i (sslength ss))
      (setq obj (vlax-ename-&amp;gt;vla-object (ssname ss (setq i (1- i)))))
      (if (setq objnew (vla-Copy obj))
	(ssadd (vlax-vla-object-&amp;gt;ename objnew) sn))))
  
  (if (&amp;gt; (sslength sn) 0)
    (command "_.REFSET" "_R" sn ""))
  (command "_.REFCLOSE" "_Disc")
  (command-s "_.MOVE" sn "")
  (princ)
)&lt;/PRE&gt;
&lt;DIV id="gtx-trans" style="position: absolute; left: 293px; top: 148.2px;"&gt;
&lt;DIV class="gtx-trans-icon"&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Thu, 17 Oct 2019 19:50:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/ncopy-with-window-selection/m-p/9093337#M82872</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2019-10-17T19:50:24Z</dc:date>
    </item>
    <item>
      <title>Re: NCOPY with window selection</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/ncopy-with-window-selection/m-p/9096024#M82873</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1779365"&gt;@ВeekeeCZ&lt;/a&gt;&amp;nbsp;thanks for help.&amp;nbsp;&lt;/P&gt;&lt;P&gt;that's what i am looking for, only if we can skip pause and confirmation in middle so that command work directly like copy, it will be perfect.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Sat, 19 Oct 2019 06:39:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/ncopy-with-window-selection/m-p/9096024#M82873</guid>
      <dc:creator>SAFizzy</dc:creator>
      <dc:date>2019-10-19T06:39:08Z</dc:date>
    </item>
    <item>
      <title>Re: NCOPY with window selection</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/ncopy-with-window-selection/m-p/9101985#M82874</link>
      <description>&lt;P&gt;Hello &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/1779365"&gt;@ВeekeeCZ&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1) Thanks for your routine ! So Kudos for you ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2) But I have a small defect : the routine seems to run ONLY ONCE !&lt;/P&gt;
&lt;P&gt;I can't re-run the routine on the XREF to extract again entities from an other area !?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks, Regards, Patrice (The Old French EE Froggy)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Oct 2019 20:21:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/ncopy-with-window-selection/m-p/9101985#M82874</guid>
      <dc:creator>braudpat</dc:creator>
      <dc:date>2019-10-22T20:21:12Z</dc:date>
    </item>
    <item>
      <title>Re: NCOPY with window selection</title>
      <link>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/ncopy-with-window-selection/m-p/9102610#M82875</link>
      <description>&lt;P&gt;Hm... well, I would not expect much from it. It was just kinda 'proof of concept', I did not test it much. And the 'refedit' is not really 'custom-friendly' command.&lt;/P&gt;
&lt;P&gt;Anyway, it seems to me to be working quite fain (2020). I am able to repeat the command, no confirmation receiving... a yes, there would be still the need to select an insert which from you copy objects. At least for the first time.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you give me more information - possibly a test file, command-line listing, or screen capture... I could look into that.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Oct 2019 07:31:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/ncopy-with-window-selection/m-p/9102610#M82875</guid>
      <dc:creator>ВeekeeCZ</dc:creator>
      <dc:date>2019-10-23T07:31:43Z</dc:date>
    </item>
  </channel>
</rss>

