Author Topic: Mulitple Attach Xref within a Lisp  (Read 1630 times)

0 Members and 1 Guest are viewing this topic.

MSTG007

  • Gator
  • Posts: 2601
  • I can't remeber what I already asked! I need help!
Mulitple Attach Xref within a Lisp
« on: February 03, 2017, 12:59:48 PM »
I know this is a stupid question. I am trying to put together a simple lisp that walks a user through setting up a drawing. From inserting all the dim styles, text styles and layers, then going to paper space to attach some drawings (Title Block, legend) then back to model space to attach more drawings (proposed and existing).

I do like this routine but it will only allow the user to select 1 file at a time.

Code: [Select]
(defun c:QXA (/)
  (initdia)
  (command "_.-XREF" "_Attach")
  (if (> (getvar "CMDACTIVE") 0)
    (progn
      (command "_None" '(0.0 0.0 0.0))
      (while (> (getvar "CMDACTIVE") 0) (command ""))
    )
  )
  (princ)
); defun

Thanks for any light!
Civil3D 2020

ronjonp

  • Needs a day job
  • Posts: 7529
Re: Mulitple Attach Xref within a Lisp
« Reply #1 on: February 03, 2017, 01:27:23 PM »
Use the command "XATTACH".

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

MSTG007

  • Gator
  • Posts: 2601
  • I can't remeber what I already asked! I need help!
Re: Mulitple Attach Xref within a Lisp
« Reply #2 on: February 03, 2017, 02:21:30 PM »
Smart Smart Smart! Works.

Code: [Select]
(defun c:QXA (/)
  (initdia)
  (command "_XAttach")
  (if (> (getvar "CMDACTIVE") 0)
    (progn
      (command "_None" '(0.0 0.0 0.0))
      (while (> (getvar "CMDACTIVE") 0) (command ""))
    )
  )
  (princ)
); defun
(C:QXA)

Thanks for those eyes or yours!
Civil3D 2020