Jump to content

area in boxes


Hsanon

Recommended Posts

Hi guys,

another query : Is there a routine where a closed polyline gets subdivided into rectangles (and triangles / quads as the case may be)....

and then charted out in a table.....

as per the drawing & jpg attached.....

 

thanks guys.....

areaboxes.dwg

areaboxes.jpg

Link to comment
Share on other sites

  • Replies 20
  • Created
  • Last Reply

Top Posters In This Topic

  • Hsanon

    12

  • BIGAL

    5

  • Lee Mac

    2

  • Dadgad

    1

Top Posters In This Topic

Posted Images

A few problems the lables are not associated with the plines so there is no "Auto" way to associate which pline is picked.

 

In saying that there are a couple of work arounds.

 

If you make the labels blocks then it can be done easy. Erase all recreate handy for deletes or add 1.

As you label the area wether block or text you can add to a table at the time of creation.

A 2 pick, pline, number then add to table is another method, simplest to do right now.

Make the number a block and you can find it within a pline automatically.

Like above maybe pick all text within pline automatically and use the top max y to return the number.

Extra thinking again grab all text look for area match, then pull out number.

 

Lots of choices, how automated are you prepeared to accept ? You may be lucky and some one may have something. I know there was a post similar problem I posted some code will see if it does what you want it maybe a year ago.

 

Others speak up.

Link to comment
Share on other sites

I may have been a bit confusing in my thread write up.

The external outline pline is existing..... I need to populate it with the rectangles for the sole purpose of explaining areas to the statutory authorities.... I normally manually make out the rectangles and then pull out the areas, text it with small lisp routines. Add them all and subtract the boxes that need to be subtracted.

And text them out for the authorities to understand.

But is a painstaking donkey work

I was hoping to,use fields to automatically extract the areas of the boxes and text them and tabulate them in some way....

Link to comment
Share on other sites

Thanks guys.... With try and put together a routine with Lee's programs, some research, and some plain vanilla lisp (which is all I can barely do) ..

 

What GP bigal ??? Which routine are you referring to ????

Link to comment
Share on other sites

Have been trying out Lee's Area label, which works fantastic....

 

However the animated jpg indicates that the areas update as the boxes are stretched / gripedited ...... but this does not happen with me...

that link of area number and area amount just doesn't take place. I dont know where i am going wrong.... please help if anyone knows...

 

was also wondering if :

 

1. Can we select the entities (rectangles) individually (or all together) and also get their dimensions (length & breadth) and put it in columns before the areas

2. if the area figure in the table could be upto 2 decimal places.. (haven't been able to figure it out in the program due to my lack of knowledge)

thanks guys.... Thanks Lee... :D

 

thanks

Link to comment
Share on other sites

another thing... (not very important in the lineup) was if we could have a choice of ABC in some cases along with 123..... (since we have to show additions in 123... and deductions in ABC....) .... thanks

Link to comment
Share on other sites

However the animated jpg indicates that the areas update as the boxes are stretched / gripedited ...... but this does not happen with me...

that link of area number and area amount just doesn't take place.

 

Please note that the area shown in the table can only be represented using a Field (and hence updated automatically) if an object has been selected to obtain the area:

Pick Area [[color="red"]Object[/color]] <Exit>: 

This restriction is because an area selected using an internal point may be bounded by the edges of several objects.

Link to comment
Share on other sites

Got it.... many many thanks Lee.... i was wondering what was going wrong....

However, when i pick the object, the area comes as a long string (probably in square mm)

when we do The internal pick point, it is fine...

i couldn't figure out where in your code was the relevant multiplying factor cf in the object selection.

 

Is it possible to add dimensions (L x B) in the table if we have rectangles ???

And, can the area figure in the table could be upto 2 decimal places.. (haven't been able to figure it out in the program due to my lack of knowledge)

 

thanks

Link to comment
Share on other sites

Got it.... many many thanks Lee.... i was wondering what was going wrong....

However, when i pick the object, the area comes as a long string (probably in square mm)

when we do The internal pick point, it is fine...

i couldn't figure out where in your code was the relevant multiplying factor cf in the object selection.

 

You're welcome.

 

If the program is set to use fields (fd=t), the formatting of the field will be dependent on the field formatting parameter (fo="%lu6%qf1").

 

To determine the appropriate field formatting string to use, please follow the instructions found on the lower half of this page.

 

Is it possible to add dimensions (L x B) in the table if we have rectangles ???

 

Yes, though not with the current version of the program.

 

And, can the area figure in the table could be upto 2 decimal places.. (haven't been able to figure it out in the program due to my lack of knowledge)

 

Yes, this will be dependent on the field formatting (described above).

Link to comment
Share on other sites

brilliant Lee..... understood & updated the code as per your instructions... works just fine.

Thanks so much.

 

Was checking.... if we have boxes, we can extract length... but the area polyline is a continuous box.. so it just pulls out the perimeter.

How is it possible to extract length x breadth which updates when we stretch them ???? If we explode the lines we lose the areas......

it will be fantastic to have our architectural room sizes as fields which are "intelligent" and can automatically update as we pull and push....

Link to comment
Share on other sites

don't explode the lines.

 

This is only If you must explode the lines

(defun RB:GetArea ( pts / nextpoint n l )
 (defun nextpoint nil
   (if (minusp (1- n))
     (last pts) (nth (1- n) pts)
   )
 )
 (repeat (setq n (length pts))
   (setq l
     (cons
       (-
         (* (car (nth (setq n (1- n)) pts))
           (cadr (nextpoint))
         )
         (* (car (nextpoint))
           (cadr (nth n pts))
         )
       ) l
     )
   )
 )
 (
   (lambda ( x )
     (if (minusp x)
       (- x) x
     )
   ) (/ (apply (function +)(reverse l)) 2)
 )
)

 

 

returns sq in

Link to comment
Share on other sites

Hsanon rotate a room so true XY is no longer valid for lengths, but if you stick with 4 sided parallel rooms then you can get length as 1st pt-2nd pt is X and 2nd-3rd pt is Y, again maybe a field of the length between 2 pts or a associative aligned dimension only displaying distance.

Link to comment
Share on other sites

Thanks Lt Dan and Bigal...... Yes. Sometimes In the heat of lisp and automation you forget that Autocad and basic auto lisp has some simple commands which can do the job...... Have worked out a step by step routine with three routines including Lee's (not one complete automated one) which does the job in hand ..... It's speedier that the way we used to do it earlier..... Thanks for all help !!!!

Link to comment
Share on other sites

  • 2 weeks later...

Hi Guys,

one issue :

whenever i run Lee's program for Area to Field, it works just fine..... I have formatted Lee's areas in his program as SQM. (even though our drawings are in millimeters)

Then i manually add rows to add the individual areas as a Total sum.

The totals come in as sq millimetres.

 

I format these totals individually into sq Metres...... not an issue

But whenever i save and re open the drawing, the totals (only.... not Lee's areas) revert back to sq millimeters.....

and i have to reformat them into sqM once again.....

 

any suggestions to stop this revert to sq mm and keep the totals as sq M ???

 

thanks

Link to comment
Share on other sites

FOUND THIS IN ANOTHER FORUM http://forums.augi.com/showthread.php?136634-Custom-Field-Save-additional-format

.... havent tried this as yet, so not sure if it works....

hope this helps someone.....

 

To solve this, you need to add some code to acfields.fdc.

 

First, close Autocad completely.

 

This file can be found at (windows 7) C:\Users\xxx\AppData\Roaming\Autodesk\AutoCAD yyy\R17\enu\Support

You'll have to open it with notepad and search for the following code:

 

After the second line you have to copy-paste the following text:

 

Square meters

%lu2%ps[,SM]%ct8[1e-006]

 

When you open Autocad again, you'll find your custom user field that will always be visible.

 

Good luck!

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...