Area calculation LISP routine changes text color option to BYCOLOR.

Area calculation LISP routine changes text color option to BYCOLOR.

CAD-UTT
Participant Participant
855 Views
3 Replies
Message 1 of 4

Area calculation LISP routine changes text color option to BYCOLOR.

CAD-UTT
Participant
Participant

Hello,

I found a great LISP routine, related to area calculation.
After selecting an internal point or the corners of the polygon, select the text that will label the calculated area.
The problem it presents is that it changes the text color to BYCOLOR (80) and I cannot deduce what is the sequence that executes this action.

1) It would be ideal if this could acquire the BYLAYER color.
2) I would like the routine to include the suffix of M² to the text by default.

(I attach the * .lsp file).
Thank you all very much for your valuable contributions.

0 Likes
Accepted solutions (2)
856 Views
3 Replies
Replies (3)
Message 2 of 4

hak_vz
Advisor
Advisor
Accepted solution

I hope this is what you asked for.

Miljenko Hatlak

EESignature

Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
0 Likes
Message 3 of 4

Kent1Cooper
Consultant
Consultant
Accepted solution

@CAD-UTT wrote:

.... It would be ideal if this could acquire the BYLAYER color.....


As @hak_vz edited it, the replacement of the 80's with 256's would do that.  It can actually be done a little more simply -- if there's more than one entry in an entity data list for the same control [such as the 62-code entry for color], the last one "wins" over any earlier one.  So this much:

 

(if (assoc 62 elst)
  (setq elst (subst (cons 62 256) (assoc 62 elst) elst)); then
  (setq elst (append elst (list (cons 62 256)))); else
); if

 

can be replaced with only the red line.

 

By the way, 80 is just another color number, not "BYCOLOR" [which is a plotting-style term, not an entity color term].

Kent Cooper, AIA
0 Likes
Message 4 of 4

CAD-UTT
Participant
Participant

THANKS A LOT hak_vz, THE ROUTINE GOES VERY WELL !!!