Author Topic: Xrefed layers Only  (Read 1839 times)

0 Members and 1 Guest are viewing this topic.

Shade

  • Guest
Xrefed layers Only
« on: January 04, 2008, 10:58:45 AM »
How would one obtain a list of all the xref layers names?

I am in the process of brainstorming a lisp that would change certain xref'd layers colour to a shade darker.
Similar to locking the layer the xref is on in 2008.
My 'ctb is set up so that a shade darker of the colours will print lighter.
Thereby having the final plot show new and existing work, through the line weights.

Any help would be greatly appreciated.... :mrgreen:
 

Guest

  • Guest
Re: Xrefed layers Only
« Reply #1 on: January 04, 2008, 11:14:26 AM »
Just use wildcards and the pipe | symbol.

Quote
Command: -la
-LAYER
Current layer:  "0"
Enter an option
[?/Make/Set/New/ON/OFF/Color/Ltype/LWeight/MATerial/Plot/Freeze/Thaw/LOck/Unlock
/stAte]: c
New color [truecolor/COlorbook] : 1
Enter name list of layer(s) for color 1 (red) <0>: *|*  <-- Grabs ALL xref layers.
Enter an option
[?/Make/Set/New/ON/OFF/Color/Ltype/LWeight/MATerial/Plot/Freeze/Thaw/LOck/Unlock
/stAte]:

Command:

ronjonp

  • Needs a day job
  • Posts: 7526
Re: Xrefed layers Only
« Reply #2 on: January 04, 2008, 11:25:46 AM »
Code: [Select]
(defun c:xreflaycolor (/)
  (vlax-map-collection
    (vla-get-layers
      (vla-get-activedocument (vlax-get-acad-object))
    )
    '(lambda (x)
       (if (wcmatch (vla-get-name x) "*|*")
(vla-put-color x 1);;color
(vla-put-color x 5);;if not xref color
       )
     )
  )
  (princ)
)

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC