Hsanon Posted September 25, 2015 Share Posted September 25, 2015 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 Quote Link to comment Share on other sites More sharing options...
BIGAL Posted September 26, 2015 Share Posted September 26, 2015 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. Quote Link to comment Share on other sites More sharing options...
BIGAL Posted September 26, 2015 Share Posted September 26, 2015 Found a lisp "text in pline", will pull out all text inside a pline just a start, it was posted here. Rather than post awaiting Hsanon. Any wants lisp just post. Quote Link to comment Share on other sites More sharing options...
Hsanon Posted September 26, 2015 Author Share Posted September 26, 2015 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.... Quote Link to comment Share on other sites More sharing options...
Dadgad Posted September 26, 2015 Share Posted September 26, 2015 Have you checked on Lee Mac's site, he has a bunch of area related lisps? I am sure you probably have, but if not, you need to. Maybe this one? http://www.lee-mac.com/areastofield.html Thanks Lee! Quote Link to comment Share on other sites More sharing options...
BIGAL Posted September 27, 2015 Share Posted September 27, 2015 Another GP has a auto area label routine that even works out its own centre point. Making a table entry could be added as a step inside one of the code examples posted. Quote Link to comment Share on other sites More sharing options...
Hsanon Posted September 27, 2015 Author Share Posted September 27, 2015 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 ???? Quote Link to comment Share on other sites More sharing options...
BIGAL Posted September 27, 2015 Share Posted September 27, 2015 Sorry search for GP_ as the name of the poster and "label area". He posted again about a month ago for a similar question. Found it http://www.cadtutor.net/forum/showthread.php?76645-Display-hatch-area-as-a-label&p=517683&viewfull=1#post517683 Quote Link to comment Share on other sites More sharing options...
Hsanon Posted September 28, 2015 Author Share Posted September 28, 2015 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... thanks Quote Link to comment Share on other sites More sharing options...
Hsanon Posted September 28, 2015 Author Share Posted September 28, 2015 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 Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted September 28, 2015 Share Posted September 28, 2015 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. Quote Link to comment Share on other sites More sharing options...
Hsanon Posted September 29, 2015 Author Share Posted September 29, 2015 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 Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted September 29, 2015 Share Posted September 29, 2015 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). Quote Link to comment Share on other sites More sharing options...
Hsanon Posted October 4, 2015 Author Share Posted October 4, 2015 Thanks for your response Lee..... Have been travelling .... Will try out your suggestions and revert ..... Quote Link to comment Share on other sites More sharing options...
Hsanon Posted October 5, 2015 Author Share Posted October 5, 2015 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.... Quote Link to comment Share on other sites More sharing options...
Lt Dan's legs Posted October 5, 2015 Share Posted October 5, 2015 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 Quote Link to comment Share on other sites More sharing options...
BIGAL Posted October 6, 2015 Share Posted October 6, 2015 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. Quote Link to comment Share on other sites More sharing options...
Hsanon Posted October 7, 2015 Author Share Posted October 7, 2015 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 !!!! Quote Link to comment Share on other sites More sharing options...
Hsanon Posted October 16, 2015 Author Share Posted October 16, 2015 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 Quote Link to comment Share on other sites More sharing options...
Hsanon Posted October 17, 2015 Author Share Posted October 17, 2015 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! Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.