Originally Posted by
irneb
Ugh
, you're correct!
But you don't even need to use getfiled first. You can simply automate the arguments of the -XREF command:
Code:
(defun c:QuickXAttach (/)
(initdia)
(command "_.-XREF" "_Attach" "_None" '(0.0 0.0 0.0))
(while (> (getvar "CMDACTIVE") 0) (command ""))
(princ)
)
If you need to be able to select the insertion point, change the "_None" '(0.0 0.0 0.0) to pause.
True, I was just thinking about if the user doesn't select a file.
Code:
(defun c:QuickXAttach (/ f)
(if (setq f (getfiled "Select Reference File:" (getvar 'dwgprefix) "dwg" 2))
(progn (command "_.-XREF" "_Attach" f "_None" '(0.0 0.0 0.0))
(while (> (getvar "CMDACTIVE") 0) (command ""))
)
)
(princ)
)