Change all xref layer

Change all xref layer

kidznok
Advocate Advocate
419 Views
4 Replies
Message 1 of 5

Change all xref layer

kidznok
Advocate
Advocate

Hi,
I would like to create button which change all xrefs layer using command line.
I have problem how to use qselect to all xref.

Is someone try sth like that?

0 Likes
420 Views
4 Replies
Replies (4)
Message 2 of 5

ВeekeeCZ
Consultant
Consultant

-layer color 7 *|*

Edit test

0 Likes
Message 3 of 5

pendean
Community Legend
Community Legend
Change what?
To what?
0 Likes
Message 4 of 5

cadffm
Consultant
Consultant

Hi,

you can not select objects inside a block a block or xref, except you are inside bedit while editing the block or xref.

Qselect can not select layers, just objects, so we don't know what you rwally trying.

 

If you really try to edit layers, also xref layers, qselect is the wrong command.

Command -LAYER can edit Layers.

 

 

Sebastian

0 Likes
Message 5 of 5

ronjonp
Mentor
Mentor

Do you mean put all xrefs on a common layer? If so, try this:

 

(defun c:foo (/ ln s)
  (setq ln "XREFLAYERNAME")
  (if (setq s (ssget "_X" '((0 . "INSERT"))))
    (foreach e (mapcar 'cadr (ssnamex s))
      (if (/= "" (cdr (assoc 1 (entget (tblobjname "block" (cdr (assoc 2 (entget e))))))))
	(entmod (append (entget e) (list (cons 8 ln))))
      )
    )
  )
  (princ)
)