I'd like to create a lisp routine to pick an xref and then use the -xref command to detach the selected xref. How do I 'get' the xref's name. I'm looking for something that works like getvar does with system variables.
|
|
|
I'd like to create a lisp routine to pick an xref and then use the -xref command to detach the selected xref. How do I 'get' the xref's name. I'm looking for something that works like getvar does with system variables.
Here is one I use.
Code:(defun c:xr-d(/ xr1 xr2 xr3 tx1 tb1) ; Select xref to detach. (if (setq xr1 (entsel "\nSelect xref to detach: ")) (progn (setq xr2 (entget (car xr1))) (setq tx1 (cdr (assoc 0 xr2))) (if (= tx1 "INSERT") (progn (setq xr3 (cdr (assoc 2 xr2))) (setq tb1 (tblobjname "block" xr3)) (if (equal (logand 4 (cdr (assoc 70 (entget tb1)))) 4) (command "-xref" "d" xr3) (prompt "\nNo External Reference selected") ) ) (prompt "\nNo External Reference selected") ) ) ) (princ) )
Thank you, Tim.
This is way over my head. I've got a lot to learn.
You're welcome. This one doesn't have to many parts, so it wouldn't be to hard to explain, so if you have any questions just ask.