Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Get properties on xref objects

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
fk
Advocate
1687 Views, 3 Replies

Get properties on xref objects

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

3 REPLIES 3
Message 2 of 4
hmsilva
in reply to: fk

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

EESignature

Message 3 of 4
fk
Advocate
in reply to: hmsilva

Worked great.

Thanks a lot.

 

Message 4 of 4
hmsilva
in reply to: fk

You're welcome,fk

Henrique

EESignature

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost