Jump to content

Recommended Posts

Posted

Is this possible couse I would want to avoid hatching.

Also maybe this tool to be accumulative.

  • Replies 36
  • Created
  • Last Reply

Top Posters In This Topic

  • Lee Mac

    10

  • Butch

    5

  • Ringis

    3

  • dpaulku

    3

Top Posters In This Topic

Posted Images

Posted

have you tried area Object?

Posted

There is probably a LISP routine that will do just that.

Posted

i'VE ALWAYS BEEN A STRONG SUPPORTER OF THE OFT-FORGOTTEN LIST COMMAND.

Posted

And for firing quick comments while adding note to my drawings...sorry for the caps.

Posted

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

Posted

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?

2009-07-17_134139.png

Posted
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? :roll:

Posted

It should only be one line up... :huh:

 

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

Posted
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? :roll:

 

You could use F2 to bring up more of the command line too.

Posted
You could use F2 to bring up more of the command line too.

 

True, or even include the (textscr) function to show the display. :thumbsup:

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

Posted

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 :lol:

 

Just to tell it again: a quick forum search will fire up some great tools

 

regards

Wolfgang

Posted

LeeMacs lisp works perfect!

Mac any chance you could make this tool to behave accumulative?

Posted

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

Posted

...and you are what...The Matrix of Autocad?

:-)

Posted
...and you are what...The Matrix of Autocad?

:-)

 

Haha, no these aren't too hard to master :)

Posted

Maybe not hard to you but are very very needed in Autocad!

  • 6 months later...
Posted

Is it possible to make it write the area inside each closed polyline ? :P

If its possible within 1 hour from posting id be great. :P (deadlines)

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