TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Shade on January 04, 2008, 10:58:45 AM

Title: Xrefed layers Only
Post by: Shade 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:
 
Title: Re: Xrefed layers Only
Post by: Guest 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:
Title: Re: Xrefed layers Only
Post by: ronjonp 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)
)