"paint" xref layers as my layer.

"paint" xref layers as my layer.

sunlight1
Enthusiast Enthusiast
418 Views
5 Replies
Message 1 of 6

"paint" xref layers as my layer.

sunlight1
Enthusiast
Enthusiast

HI ALL 
i need a lisp that can copy properties from my layers on a xref layer. such as color, linetype, transparency etc

all the properties that show in "layer properties manager" window

all changes will be in my file, and not in the xref file. 

it should be like

select layer 

get properties

select xref layer 

and change layer properties. 

i dont mind if the xref keep the layer name or not, it is only for visual in my file, and for easy ctb edit.
tnx for helping me. 

Capture.PNG

0 Likes
Accepted solutions (2)
419 Views
5 Replies
Replies (5)
Message 2 of 6

ВeekeeCZ
Consultant
Consultant

Use LAYTRANS to match the layers.

 

BTW CTB is kinda obsolete, STB is much more powerful and easier to work with.

0 Likes
Message 3 of 6

sunlight1
Enthusiast
Enthusiast

sometimes i have 20 layers to change, 

instead of searching layers in a list, 

the easy way is one click on my layer , and one click on them

i hope that can be possible in a lisp. 

0 Likes
Message 4 of 6

ВeekeeCZ
Consultant
Consultant
Accepted solution

20 layers? Oh boy, I often have 500+ xref layers to maintain. And guess what, with the right STB styles I can do that in just a few mins.

 

Also, LAYTRANS could save you plenty of time.

 

But understand, you need a LISP. In that case, HERE is all you need.

 

0 Likes
Message 5 of 6

Kent1Cooper
Consultant
Consultant
Accepted solution

Try this [minimally tested]:

(defun C:LPP (/ lay1 layobj1 lay2 layobj2); = Layer Properties Paint [onto another Layer]
  (setq
    lay1 (cdr (assoc 8 (entget (car (nentsel "\nObject on Source Layer for Properties: ")))))
    layobj1 (tblobjname "layer" lay1)
    lay2 (cdr (assoc 8 (entget (car (nentsel "\nObject on Target Layer to Paint Properties on: ")))))
    layobj2 (tblobjname "layer" lay2)
  ); setq
  (foreach prop '("Color" "IsLocked" "IsPlottable" "LineWeight" "LinetypeObjectId" "Transparency")
    (setpropertyvalue layobj2 prop (getpropertyvalue layobj1 prop))
  ); foreach
  (command "_.regen")
  (princ)
); defun

That's in simplest terms, without [yet] verification that you picked something, *error* handling, Undo begin/end wrapping, etc.  There may be other Properties you would want to transfer, or you may not want all those I included.

 

It works between any Layers, whether either or both or neither is part of an Xref.  BUT be aware that if you pick on something nested in a Block or Xref that at its lowest nesting level was drawn on Layer 0, it will work with Layer 0's Properties, not the apparent Layer of it in its insertion/reference.

Kent Cooper, AIA
Message 6 of 6

sunlight1
Enthusiast
Enthusiast

TNX A LOT ! 
im glad we have ppl like u. 

tnx again! 

0 Likes