Modify the code by Lee Mac to include the AREA instead of just the polygon number

Modify the code by Lee Mac to include the AREA instead of just the polygon number

jemeripol
Observer Observer
463 Views
6 Replies
Message 1 of 7

Modify the code by Lee Mac to include the AREA instead of just the polygon number

jemeripol
Observer
Observer

Hello all,

 

I stumbled upon this code by Lee Mac (Lee Mac Programming: Custom Programs for AutoCAD) that generates the area of the polygon and puts them on the table for reporting.

 

The code and the visualization is found here in his website: Area Label | Lee Mac Programming

 

I would like to modify the output in the model view during selection of the polygons to include the area of that polygon instead of just the polygon number, that is:

 

Old Output:  

    1

 

New Output

    1                      -->>> polygon number

  (100)                 -->>> Area of the polygon

 

where the area is rounded off to the nearest whole number.

 

The tabulation and all other function can remain the same. I will appreciate your help. Thank you so much.

0 Likes
Accepted solutions (1)
464 Views
6 Replies
  • Lisp
Replies (6)
Message 2 of 7

vladimir_michl
Advisor
Advisor

On the commandline? Like this?
(the added lines are not indented)

 

Vladimir Michl, www.arkance.world  -  www.cadforum.cz

 

0 Likes
Message 3 of 7

jemeripol
Observer
Observer

Hello Mr. Vladimir,

 

This is not like this. I would like the output to be the same as the one shown attached.

 

Possible things to do:

1. Change the type of output from TEXT to MTEXT (centered)
2. Add the area as shown along with the polygon number in the centroid of the polygon.

 

Thank you.

 

Jem

 

0 Likes
Message 4 of 7

vladimir_michl
Advisor
Advisor

The label is linked with the table, so it cannot be done over a single MText lable. But maybe like this:

 

Vladimir Michl, www.arkance.world  -  www.cadforum.cz

 

0 Likes
Message 5 of 7

jemeripol
Observer
Observer

Hello sir,

 

This seems a good workaround to it. Would it be possible to add the parenthesis on the area text? 

You are of great help to me. Thank you very much.

 

Jem

0 Likes
Message 6 of 7

vladimir_michl
Advisor
Advisor
Accepted solution

These formal changes are then quite simple - you can experiment with the code. See the added "(" and ")":

 

Vladimir Michl, www.arkance.world  -  www.cadforum.cz

 

0 Likes
Message 7 of 7

jemeripol
Observer
Observer

Perfect sir, it works as intended already. I will study this code and will implement changes by myself in the future.

Thank you.

 

Jem