Community
Hi.
I have a drawing that contain xrefs. I have the xref name, I have the layers in the xref. What I need is to step through objects on each xref layer to get object type and object properties. Is that possible in LISP? Someone that can share some thoughts on this? Thanks in advance.
\Freddy
Solved! Go to Solution.
Solved by hmsilva. Go to Solution.
As a starting point
(defun c:demo (/ ent lst name sel xent xref) (if (and (setq sel (entsel "\nSelect a Xref: ")) (setq ent (entget (car sel))) (assoc 2 ent) (= 4 (logand 4 (cdr (assoc 70 (tblsearch "BLOCK" (setq name (cdr (assoc 2 ent)))))) ) ) ) (progn (setq xref (tblobjname "block" name)) (while (setq xref (entnext xref)) (setq xent (entget xref) lst (cons (list (cdr (assoc 410 xent));; layout tab name (cdr (assoc 0 xent));; entity type (cdr (assoc 8 xent));; Layer name ) lst ) ) ) (if lst (princ lst) ) ) ) (princ) )
Hope that helps
Henrique