Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Adding a "color" DXF code to an object

4 REPLIES 4
Reply
Message 1 of 5
mgorecki
692 Views, 4 Replies

Adding a "color" DXF code to an object

I have selected a polyline and I want to change it's current color. I know that the DXF color code is 62, but I don't know how add it to it's definition. Here is the current definition (there is no current "62" because it's color is BYLAYER.
((-1 . ) (0 . "LWPOLYLINE") (330 .
7ef65d08>) (5 . "C90D") (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 .
"WIRE_TIER_2") (100 . "AcDbPolyline") (90 . 2) (70 . 0) (43 . 0.0254) (38 .
0.0) (39 . 0.0) (10 -4.0153 2.195) (40 . 0.0254) (41 . 0.0254) (42 . 0.0) (10
-6.37341 3.36553) (40 . 0.0254) (41 . 0.0254) (42 . 0.0) (210 0.0 0.0 1.0))

I read an earlier post that tells me to use append, but I'm not sure how to do that. Can someone help me out?

Thanks,
Mark
4 REPLIES 4
Message 2 of 5
mgorecki
in reply to: mgorecki

Hi Gang,
Never mind I finally figured it out.
(setq wire_ent1 (append wire_ent1 (list '(62 . 123))))

Really not that hard when you think about it I guess.
Thanks anyway.
Mark
Message 3 of 5
Anonymous
in reply to: mgorecki

(setq datalist '((-1 . ) (0 . "LWPOLYLINE") (330 .
78d49cc0>) (5 . "A0F") (100 . "AcDbEntity") (67 . 0) (410 . "Model") (8 .
"WIRE_TIER_2") (100 . "AcDbPolyline") (90 . 2) (70 . 0) (43 . 0.0254) (38 .
0.0) (39 . 0.0) (10 -4.0153 2.195) (40 . 0.0254) (41 . 0.0254) (42 . 0.0) (10
-6.37341 3.36553) (40 . 0.0254) (41 . 0.0254) (42 . 0.0) (210 0.0 0.0 1.0)))

(entmod (append datalist '((62 . 1))))
Message 4 of 5
Anonymous
in reply to: mgorecki

>(list '(62 . 123))

Note that you could also quote the nested list '((62 . 123))
Message 5 of 5
scot-65
in reply to: mgorecki

MG,

Good, looks like you question has been answered.
Color and linetype DFX's are not part of the entity definition when these are bylayer conditions. When you expand your menu system, you might encounter this problem down the road...
Check to see if the DFX's exist and if so, construct the new value, otherwise append the entity.
When you want to restore back to bylayer, I have found that using the CHPROP command does this most efficiently.

Good Luck!

Scot-65

Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.


Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost