matchprop from line/pline on xref

matchprop from line/pline on xref

sunlight1
Enthusiast Enthusiast
667 Views
7 Replies
Message 1 of 8

matchprop from line/pline on xref

sunlight1
Enthusiast
Enthusiast

hi all, 

i need a lisp that can change the layers prop of an xref lines that i want, 

i dont need to change them in the original xref file, 

only to change them on my file to match my ctb file. 

i want that the xref lines (that i pick) take all my line prop, color,linetype, lineweight xtc

im using a lisp that change the color of xref line. so i thought why whouldn"t i find a lisp that can change more than a color. 

my plan is to set my own legend and start converting lines from an xref 

 

0 Likes
668 Views
7 Replies
Replies (7)
Message 2 of 8

pbejse
Mentor
Mentor

@sunlight1 wrote:

...

im using a lisp that change the color of xref line. so i thought why whouldn"t i find a lisp that can change more than a color. 


Where is the lisp code? Mind posting it here.

 

0 Likes
Message 3 of 8

sunlight1
Enthusiast
Enthusiast

i think i found it here, cant find the post ATM 

this is not matchprop so i thought ist not relevant 

 

 

(defun c:clc (/ c d e l)
;; RJP » 2018-08-17
;; Set layer color by pick
(or (getenv "clc") (setenv "clc" "(62 . 1)"))
(cond ((setq c (acad_truecolordlg (read (getenv "clc"))))
(setenv "clc" (vl-prin1-to-string (last c)))
(setq d (vla-get-activedocument (vlax-get-acad-object)))
(while (and (setq e (car (nentsel "\nSelect entity to change layer color: ")))
(setq l (tblobjname "layer" (cdr (assoc 8 (entget e)))))
)
(entmod (append (entget l) c))
(vla-regen d acactiveviewport)
)
)
)
(princ)
)
(vl-load-com)

 

 

0 Likes
Message 4 of 8

pbejse
Mentor
Mentor

@sunlight1 wrote:

(defun c:clc (/ c d e l)
;; RJP » 2018-08-17 ;; Set layer color by pick


I know that guy, he'll come along and get you sorted.

 

0 Likes
Message 5 of 8

Kent1Cooper
Consultant
Consultant

@sunlight1 wrote:

im using a lisp that change the color of xref line.

....

i think i found it here....

....
(setq l (tblobjname "layer" (cdr (assoc 8 (entget e)))))
(entmod (append (entget l) c))

.....


That is not to change the color of the selected object, but of the Layer it's on.  If you really have something that will change the color of a nested selected object, it should be adjustable to change other properties, but I'm having a hard time imagining how that could be done, without changing it in the source Xref.

Kent Cooper, AIA
0 Likes
Message 6 of 8

sunlight1
Enthusiast
Enthusiast

i dont need to change the layer in the source Xref, 

i only need to change the properties in the LAYER PROPERTIES MANAGER in the main file. 

which get me the properties of a line, and copy them to the LAYER PROPERTIES MANAGER of an xref layer i choose.

it should looks like this

pick a line/pl

get the prop 

pick an xref line

then copy the line prop (u've got) to that xref layer in the LAYER PROPERTIES MANAGER (of the main file)

that whould change the layer.

thats it. 

 

 

 

0 Likes
Message 7 of 8

Kent1Cooper
Consultant
Consultant

@sunlight1 wrote:

i dont need to change the layer in the source Xref, 

i only need to change the properties in the LAYER PROPERTIES MANAGER in the main file. 

which get me the properties of a line, and copy them to the LAYER PROPERTIES MANAGER of an xref layer i choose.

....


This from Message 1 is what sounded like you were talking about changing the properties of an object, not of its Layer:

"im using a lisp that change the color of xref line."

 

Also, you say "this is not matchprop so i thought ist not relevant".  MATCHPROP can't be relevant to changing a Layer's properties, anyway -- it is only about the properties of objects.

 

Do you just want to modify the code you posted from asking the User for a color to getting the color from an object, and add more properties to be changed?

 

If the color/linetype/lineweight/transparency of the first-selected object is BYLAYER, do I assume correctly that you would want that property of its Layer extracted and given to the Xref Layer?  [BYLAYER cannot be assigned to a Layer's properties.]

Kent Cooper, AIA
0 Likes
Message 8 of 8

sunlight1
Enthusiast
Enthusiast

ok, im sorry if u misunderstood me. 

the only reason i posterd the lisp, is that pbejse ask for it. 

in that lisp i posted (i didnt wrote it like u know) 

u choose the color u want the layer change. 

this is not good for my post because i dont want to choose color, i want that the list COPY the prop from a line i choose, exactly like Matchprop command does. 

the good thing for my post about the lisp i posted is that color layer i choose, is changing in the right place i need here, in the LAYER PROPERTIES MANAGER. 

im sorry of i misnderstood, 

i need layer change, not object. 

my goal is to have template that contains my layers and lines, 

and then easily change xref layers to my layers line with the same properties

0 Likes