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

Change in Color of Object

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
Anonymous
435 Views, 3 Replies

Change in Color of Object

Hello Everyone,

 

I read message from Mr. Andrew Ingram regarding change in properties of an object.

 

I tried to change color of one of the entities using those commands  in one of my lisp file.

 

But somehow it is not changing the color.

 

I have got a Layer named LW2 and its bylayer color is Cyan. I want my Mline to be in LAyer LW2 but its color to be 8 (i.e. RGB: 128,128,128).

 

Please help me on this.

 

Here's part of the code:

(setq c1 (getpoint "Pick Start Point: "))
(setq c2 (getpoint "Pick End Point: "))
(command "mline" "j" "t" "s" 100 c1 c2 "")
(command "change" "l" "" "p" "la" "lw2" "")
(command "change" "l" "" "p" "c" "8" "")
(command "explode" "l" "")

 I also tried change command by removing "" for integer value of 8. But still its not working.

So please help.

 

Thanks,

Bhaumik

3 REPLIES 3
Message 2 of 4
hmsilva
in reply to: Anonymous

Untested...

(setq c1 (getpoint "Pick Start Point: "))
(setq c2 (getpoint "Pick End Point: "))
(command "mline" "j" "t" "s" "100" c1 c2 "");; 100 as a string
(command "change" "l" "" "p" "la" "lw2" "")
(command "explode" "l" "")
(command "change" "p" "" "p" "c" "8" "")

 First explode, then change the color using the selection method previous...

 

HTH

Henrique

EESignature

Message 3 of 4
Anonymous
in reply to: hmsilva

Ok, it works. 

 

Thanks a lot for the quick response Mr. Henrique.

 

I am still not able to understand why it doesnt work with Both lines in mline mode. Is there any specific reason?

 

Regards,

 

Bhaumik

 

 

Message 4 of 4
hmsilva
in reply to: Anonymous


@Anonymous wrote:

Ok, it works. 

 

Thanks a lot for the quick response Mr. Henrique.

 

I am still not able to understand why it doesnt work with Both lines in mline mode. Is there any specific reason?

 

Regards,

 

Bhaumik

 

 



You're welcome, Bhaumik

 

Mlines, have a strange behavior in relation to color, neither behave such as blocks, if the color at mline style if is defined as Byblock,  we still can not change the color, so first explode then change the color...


Henrique

EESignature

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

Post to forums  

Autodesk Design & Make Report

”Boost