Jump to content

Use Area in an equation for block, lisp, or macro


Scott B

Recommended Posts

I use the are of different floors of a building to determine accessory quantities for concrete placing. I calculate using: ((sqrt(area))-4')/4'*sqrt(area). this lets me know linear feet of material at 4' spacing the full length of a (square) room. i use a similar formula for differing accessories. I'd like a tool that can get the info in as few clicks as possible.

 

I experimented with a table that works... ok.

A1 -lable

A2 -field=get area (sqr inches)

A3 -convert to feet =A2/144

A4 -=sqrt(A3) (qet the length of 1 side of a square)

A5 -=(A4-4)/4 (to divide the length by spacing of 4')

A6 -=A4*A5 (total length of runs at 4')

 

this will work as a block, just have to explode & update the area field for every area it is used on.

 

My IT will have to evaluate any lisp as our AutoCad 2012 is piggybacked by RebarCAD, and lisp files can cause problems. (simplest is best)

let me know if there is a better way. Thank you very much!!!

Link to comment
Share on other sites

Are you looking for a lisp where you can type in the area and it does the math? What exactly are you looking to do?

Link to comment
Share on other sites

Welcom to cadtutor.

 

here is a drawing that uses dynamic dimensions and fields, just change the red dimension and type in the command "regen"

I'm not 100% on your formulas but this should get you started.

Dynamic Area.dwg

Link to comment
Share on other sites

I would like to have a lisp or macro that gets the area of a selected object. i am calculating supports for mesh in a slab with an irregular outline.

 

how do i move this to the lisp section?

Link to comment
Share on other sites

how do i move this to the lisp section?

 

Don't worry, a mod will come around and move it soon. Next time start it in that section if you are requesting a lisp.

Link to comment
Share on other sites

Not sure what you plan with the data is, but here's the math

 

(defun c:areaequation ( / ONEWALL ROOMAREA ROOMENT ROOMSS SPACINGBY4FEET TOTALLENGTHAT4FEET)
 (if (setq roomSS (ssget "_+.:E:S" (list (cons 0 "LWPOLYLINE"))))
   (progn
     (setq roomEnt (vlax-ename->vla-object (cadar (ssnamex roomSS))))
     (setq roomArea (/ (vla-get-area roomEnt) 144))
     (setq oneWall (sqrt roomArea))
     (setq spacingBy4Feet (/ (- oneWall 4) 4))
     (setq totalLengthat4Feet (* oneWall spacingBy4Feet))))    
     
     
 )

Link to comment
Share on other sites

Thank you Commandobill! I will use it to figure accessories used in placing reinforcing in irregular slabs and walls.

Link to comment
Share on other sites

I could have the data be printed to your command line or put as MTEXT. Just let me know and I'll finish the code for you.

Link to comment
Share on other sites

You can attach a FIELD to a mtext that is area it took me about 1 minute to do including scale factor, your conversion factor. Pretty sure Lee-mac has a lisp to do this. If you change shape just regen to update. Only setback is it does not take into account your 4' strip. Not sure if this can be added to field calc distance between two points. A dynamic block can not be used as you implied irregular shape.

 

ScreenShot039.jpg

Edited by BIGAL
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...