Author Topic: [XDrX-PlugIn(54)] Enhance NCOPY, support window selection, XREF  (Read 1443 times)

0 Members and 1 Guest are viewing this topic.

xdcad

  • Swamp Rat
  • Posts: 527
[XDrX-PlugIn(54)] Enhance NCOPY, support window selection, XREF
« on: December 19, 2023, 11:00:43 PM »
You may need to download the XDRX API updated on December 20,
https://github.com/xdcad/XDrx-API

Code: [Select]
(defun c:XDTB_Ncopy (/ blkref mat p1 p2 box ss ents)
  (xdrx-begin)
  (if (and (setq blkref (car (xdrx-entsel
       (xdrx-string-multilanguage
"\n拾取图块或XREF<退出>:"
"\nPick BLOCK or XREF<Exit>:"
       )
       '((0 . "insert"))
     )
)
   )
   (setq mat (xdrx-matrix-wcs2block blkref))
   (setq p1 (getpoint (xdrx-string-multilanguage
"\n窗口第一点<退出>:"
"\nFirst point of window <Exit>:"
      )
    )
   )
   (setq p2 (xd::doc:getcorner
      p1
      (xdrx-string-multilanguage
"\n窗口第二点<退出>:"
"\nSecond point of window <Exit>:"
      )
      7
      nil
    )
   )
   (setq box (last p2))
   (setq ss (xdrx-block-getentities blkref "wp" box));;BLOCK, XREF, window selection entities
   (setq ms (xdrx-get-currentspace));;Current Space ID
   (setq ents (xdrx-object-deepclone ms ss mat))
          ;;Deep clone from XREF database to current space, apply transformation matrix, clone in situ
      )
    (progn
      (xd::drag:freemove
ents
(xd::geom:get9pt ents 5);drag basepoint at center
(+ 1  4 128);;Activate the base point, rotate 90 degrees, and align
547
t
      )
    )
  )
  (xdrx-end)
  (princ)
)
« Last Edit: December 19, 2023, 11:17:24 PM by xdcad »
The code I wrote uses XDRX-API,which can be downloaded from github.com and is updated at any time.
===================================
https://github.com/xdcad
https://sourceforge.net/projects/xdrx-api-zip/
http://bbs.xdcad.net

dieptp

  • Mosquito
  • Posts: 6
Re: [XDrX-PlugIn(54)] Enhance NCOPY, support window selection, XREF
« Reply #1 on: January 22, 2024, 10:13:23 PM »
 I got this:

Command:  XDTB_NCOPY
Pick BLOCK or XREF<Exit>:
First point of window <Exit>:
Second point of window <Exit>:
Application Error: 0 :- no function definition: nilno function definition: nil

xdcad

  • Swamp Rat
  • Posts: 527
Re: [XDrX-PlugIn(54)] Enhance NCOPY, support window selection, XREF
« Reply #2 on: January 22, 2024, 10:31:10 PM »
I got this:

Command:  XDTB_NCOPY
Pick BLOCK or XREF<Exit>:
First point of window <Exit>:
Second point of window <Exit>:
Application Error: 0 :- no function definition: nilno function definition: nil

go:  https://github.com/xdcad/XDrx-API
download xdrx-api, install, and.....
The code I wrote uses XDRX-API,which can be downloaded from github.com and is updated at any time.
===================================
https://github.com/xdcad
https://sourceforge.net/projects/xdrx-api-zip/
http://bbs.xdcad.net