Butch Posted July 16, 2009 Posted July 16, 2009 Is this possible couse I would want to avoid hatching. Also maybe this tool to be accumulative. Quote
ReMark Posted July 16, 2009 Posted July 16, 2009 There is probably a LISP routine that will do just that. Quote
lpseifert Posted July 16, 2009 Posted July 16, 2009 Here's one, I'm sure there are plenty more if you search... look for PolyArea.lsp http://www.turvill.com/t2/free_stuff/index.htm BTW... if you need the area of 1 polyline, select it and look in Properties Quote
MaxwellEdison Posted July 16, 2009 Posted July 16, 2009 i'VE ALWAYS BEEN A STRONG SUPPORTER OF THE OFT-FORGOTTEN LIST COMMAND. Quote
MaxwellEdison Posted July 16, 2009 Posted July 16, 2009 And for firing quick comments while adding note to my drawings...sorry for the caps. Quote
Lee Mac Posted July 16, 2009 Posted July 16, 2009 Polylines (and most other objects) have the VL area property, so area calculation is pretty easy* in LISP - even for open polylines: (defun c:oarea (/ ent Obj) (vl-load-com) (if (and (setq ent (car (entsel "\nSelect Object: "))) (vlax-property-available-p (setq Obj (vlax-ename->vla-object ent)) 'Area)) (princ (strcat"\n<< Area: " (vl-princ-to-string (vla-get-Area Obj)) " >>"))) (princ)) *not meaning to sound pretentious... Quote
DVDM Posted July 17, 2009 Posted July 17, 2009 In Autocad 2010 it's simply part of the Properties in the Geometry section. It has Area and Length. This isn't available in Autocad 2007? Quote
Butch Posted July 21, 2009 Author Posted July 21, 2009 Polylines (and most other objects) have the VL area property, so area calculation is pretty easy* in LISP - even for open polylines: (defun c:oarea (/ ent Obj) (vl-load-com) (if (and (setq ent (car (entsel "\nSelect Object: "))) (vlax-property-available-p (setq Obj (vlax-ename->vla-object ent)) 'Area)) (princ (strcat"\n<< Area: " (vl-princ-to-string (vla-get-Area Obj)) " >>"))) (princ)) *not meaning to sound pretentious... Lee Mac againg great only one tiny tiny problem is that the area results stays hidden and you must scroll back on the command line to see it. Could you make it visible so you dont have to scroll? Quote
Lee Mac Posted July 21, 2009 Posted July 21, 2009 It should only be one line up... But, if you insist: (defun c:oarea (/ ent Obj) (vl-load-com) (if (and (setq ent (car (entsel "\nSelect Object: "))) (vlax-property-available-p (setq Obj (vlax-ename->vla-object ent)) 'Area)) (alert (strcat"\n<< Area: " (vl-princ-to-string (vla-get-Area Obj)) " >>"))) (princ)) Quote
GE13579 Posted July 21, 2009 Posted July 21, 2009 Lee Mac againg great only one tiny tiny problem is that the area results stays hidden and you must scroll back on the command line to see it. Could you make it visible so you dont have to scroll? You could use F2 to bring up more of the command line too. Quote
Lee Mac Posted July 21, 2009 Posted July 21, 2009 You could use F2 to bring up more of the command line too. True, or even include the (textscr) function to show the display. Quote
Coosbaylumber Posted July 22, 2009 Posted July 22, 2009 i'VE ALWAYS BEEN A STRONG SUPPORTER OF THE OFT-FORGOTTEN LIST COMMAND. Works for me too. Just type in LIST on your keyboard, and there is..... Takes too long to go the other routes for an area. But,.... the figure must be closed or you get a phoney area in units. Wm. Quote
wkplan Posted July 22, 2009 Posted July 22, 2009 Hello all, you are right, a simple list/properties/area command will allow verry quick access to the area information. IMHO there are many cases, where this information has to displayed on the drawing permanently, therefore this simple workaround will fail. There are many lisps around here, which will place a single text ore parse the area value into a block attribute. Just do a quick forum search here: polyline + area + lisp shows up 59 results, there are even more here... ... room + area will show 83 results Looking at the results: Some of these routines only place a single text on a selected polyline, others will work a bunch of given polylines. Other routines work with fields, ore reactors; the advantage: if the polyline changes, the value will be automaticly updated. And last but not least, there are some great lisps around here, which place the area information into a block attribute. This is for me personaly the best way to deal with informations, because I am now able to work with this values. (In my work, I do floor plans/office layouts and the area is allows an importand information) For a beginner, it might be hard stuff understanding the block concept and all around data extraction, but compared to autocad R12 for DOS... ...It is nowadays verry easy Just to tell it again: a quick forum search will fire up some great tools regards Wolfgang Quote
Butch Posted July 22, 2009 Author Posted July 22, 2009 LeeMacs lisp works perfect! Mac any chance you could make this tool to behave accumulative? Quote
Lee Mac Posted July 22, 2009 Posted July 22, 2009 Something like this? (defun c:oarea (/ ss lst) (vl-load-com) (if (setq ss (ssget)) (progn (vlax-for Obj (vla-get-ActiveSelectionSet (vla-get-ActiveDocument (vlax-get-acad-object))) (if (vlax-property-available-p Obj 'Area) (setq lst (cons (vla-get-Area Obj) lst)))) (if lst (alert (strcat"\n<< Area: " (rtos (apply '+ lst)) " >>"))))) (princ)) Quote
Butch Posted July 22, 2009 Author Posted July 22, 2009 ...and you are what...The Matrix of Autocad? :-) Quote
Lee Mac Posted July 22, 2009 Posted July 22, 2009 ...and you are what...The Matrix of Autocad?:-) Haha, no these aren't too hard to master Quote
Butch Posted July 23, 2009 Author Posted July 23, 2009 Maybe not hard to you but are very very needed in Autocad! Quote
ezealor Posted February 8, 2010 Posted February 8, 2010 Is it possible to make it write the area inside each closed polyline ? If its possible within 1 hour from posting id be great. (deadlines) Quote
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.