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

Is it possible to create a macro that would add up areas of polyline shapes?

5 REPLIES 5
Reply
Message 1 of 6
powellk00
380 Views, 5 Replies

Is it possible to create a macro that would add up areas of polyline shapes?

Hi All,

 

What I am trying to do is write an AutoCAD macro that will work in AutoCAD lt that will allow me to click on two or more poly lined shapes and add the areas and then once i am finished clicking on shapes, it will perform a division operation and then insert the solution in mtext format.  

 

I already have thanks to this forum, a macro that will allow me to click on a single shape and enter text of the square feet of a polylined shape.  Is it possible to add something to the existing macro to accomplish what i am looking for?

 

Here is a copy of the macro that i currently use:

 

*^C^C_area;_o;\_-mtext;$M=$(getvar,viewctr);@;$m=$(rtos,$(/,$(getvar,area),144),2,2)';;_move;_l;;@;\

 

 

Thanks in advance for any help in coming up with a solution to this need.

 

Kevin Powell

5 REPLIES 5
Message 2 of 6
Kent1Cooper
in reply to: powellk00


@powellk00 wrote:

.... 

What I am trying to do is write an AutoCAD macro that will work in AutoCAD lt that will allow me to click on two or more poly lined shapes and add the areas and then once i am finished clicking on shapes, it will perform a division operation and then insert the solution in mtext format.  

....


Can you use AutoLISP functions?  [That is, are you in a "full" version of AutoCAD, rather than a "Lite" version?]  I can imagine a couple of ways to allow selection of any indeterminate number of Polylines using Lisp functions, but I'm not sure whether it can be done without them.  You could still have a menu button to call the Lisp routine.

Kent Cooper, AIA
Message 3 of 6
powellk00
in reply to: Kent1Cooper

I do have the full version of AutoCAD but my co workers only have the LT version, so that is why i am trying to figure out macros to use.

 

Thanks for the reply.

 

Kevin

Message 4 of 6
dbroad
in reply to: powellk00

I really don't like the asterisk at the beginning of the macro and the lack of true prompting with these kind of macros but this would work for two objects.  The problem is that with these macros you can't include the logic for varying numbers of objects selected.  It would probably be better to have two macros, one to start the area command with the add option and another to report the last area.

 

*^C^C_area;_a;_o;\\;;_-mtext;$M=$(getvar,viewctr);@;$m=$(rtos,$(/,$(getvar,area),144),2,2)';;_move;_l;;@;\

Architect, Registered NC, VA, SC, & GA.
Message 5 of 6
powellk00
in reply to: dbroad

Thank you for posting the macro.

 

I see the autocad function with using the area command and add mode.  Is there a way to put the "\" for multiple user input but tell it that your finished inputting?  For example if i put in there 100 "\" but i only need 30 for example how do i put it in there to stop asking for more and returning the total area?

 

 

Thanks,

 

Kevin

Message 6 of 6
dbroad
in reply to: powellk00

You can't.  If you need more functionality, you need to upgrade from LT to full and write a new command.

Architect, Registered NC, VA, SC, & GA.

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

Post to forums  

Autodesk Design & Make Report

”Boost