Layer's color

Layer's color

Anonymous
Not applicable
211 Views
7 Replies
Message 1 of 8

Layer's color

Anonymous
Not applicable
With the layer's name, how can I get the layer's color with Lisp or
Visual Lisp ?

Sergio
0 Likes
212 Views
7 Replies
Replies (7)
Message 2 of 8

Anonymous
Not applicable
(vlax-get-property(vla-item(vla-get-layers(vla-get-ActiveDocument(vlax-get-acad-object))) "layername")"color") At your service - James Buzbee
0 Likes
Message 3 of 8

Anonymous
Not applicable
or you don't want the VLAX why you can also use
basic lisp.

 

(setq ent (entget (tblobjname "LAYER"
"Layer_Name_Here")))
(setq Col (assoc 62 ent);;;gets color

 

If you are going to use the VLAX why then don't
forget the (vl-load-com) before you try to run code or else it will
fail.

 

 

--
Rob Starz

href="mailto:[email protected]">[email protected]

Plogv 3.0 & 2000
(plot logging) for r14 & 2000
***Enhancement Tools for Arch. Desktop
*****

href="http://www.stardsign.com/main.htm">http://www.stardsign.com/main.htm
   

StarDsign cad solution
0 Likes
Message 4 of 8

Anonymous
Not applicable
Thank's for the help,

James


style="BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px">
(vlax-get-property(vla-item(vla-get-layers(vla-get-ActiveDocument(vlax-get-acad-object)))
"layername")"color") At your service - James Buzbee
0 Likes
Message 5 of 8

Anonymous
Not applicable
Thank's for the help

Rob


style="BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px">

or you don't want the VLAX why you can also use
basic lisp.

 

(setq ent (entget (tblobjname "LAYER"
"Layer_Name_Here")))
(setq Col (assoc 62 ent);;;gets color

 

If you are going to use the VLAX why then don't
forget the (vl-load-com) before you try to run code or else it will
fail.

 

 

--
Rob Starz

href="mailto:[email protected]">[email protected]

Plogv 3.0 & 2000
(plot logging) for r14 & 2000
***Enhancement Tools for Arch. Desktop
*****

href="http://www.stardsign.com/main.htm">http://www.stardsign.com/main.htm
   

StarDsign cad solution
0 Likes
Message 6 of 8

Anonymous
Not applicable
Spelling problems today.

 

or you don't want the VLAX why you can also use
basic lisp.

 

Should read

 

Of IF you don't want the VLAX WAY you can
also.....


--
Rob Starz

href="mailto:[email protected]">[email protected]

Plogv 3.0 & 2000
(plot logging) for r14 & 2000
***Enhancement Tools for Arch. Desktop
*****

href="http://www.stardsign.com/main.htm">http://www.stardsign.com/main.htm
   

StarDsign cad solution


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">

or you don't want the VLAX why you can also use
basic lisp.

 

(setq ent (entget (tblobjname "LAYER"
"Layer_Name_Here")))
(setq Col (assoc 62 ent);;;gets color

 

If you are going to use the VLAX why then don't
forget the (vl-load-com) before you try to run code or else it will
fail.

 

 

--
Rob Starz

href="mailto:[email protected]">[email protected]

Plogv 3.0 & 2000
(plot logging) for r14 & 2000
***Enhancement Tools for Arch. Desktop
*****

href="http://www.stardsign.com/main.htm">http://www.stardsign.com/main.htm
   

StarDsign cad solution
0 Likes
Message 7 of 8

Anonymous
Not applicable
Thanks to Rob for the (vl-load-com) reminder! A poor memory is why I got into programing in the first place; "Now what was that system variable to set the paperspace linetype scale . . .?" Always, at your service - James Buzbee
0 Likes
Message 8 of 8

Anonymous
Not applicable
 

Don't feel bad.

 


 

 


style="BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: 0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px">
Thanks
to Rob for the (vl-load-com) reminder! A poor memory is why I got into
programing in the first place; "Now what was that system variable to set the
paperspace linetype scale . . .?" Always, at your service - James
Buzbee
0 Likes