Setting Object as default when measuring areas

Setting Object as default when measuring areas

cjshaw14
Enthusiast Enthusiast
706 Views
18 Replies
Message 1 of 19

Setting Object as default when measuring areas

cjshaw14
Enthusiast
Enthusiast

I have several areas I need to measure of a building. Each area is outlined with a polyline, selecting Measure, Area, the default prompt is Specify first corner. Is there a way to set the prompt as Select object instead?

Thanks

0 Likes
Accepted solutions (1)
707 Views
18 Replies
Replies (18)
Message 2 of 19

imadHabash
Mentor
Mentor

Hi,

@cjshaw14 

  • You can by using the Object option for closed polylines, circles, and regions. Results are displayed in the command line in current drawing units.
  • Also, Enter the LIST command, which will display the area (and other information) on the command line (pressing F2 will show an expanded Command window).
  • Or, press Ctrl+1, which will bring up the Properties palette. The Area will be shown in the Geometry section.

Imad Habash

EESignature

0 Likes
Message 3 of 19

Kent1Cooper
Consultant
Consultant

You can also just select such a Polyline, and see its Area in the Properties palette, with no command involved.  I just keep the Properties palette docked all the time, for just this kind of reason.  Or use the LIST command, which will report the area with mere object selection, not requiring picking of points.

EDIT:  The approach you use may depend on what you want to do with the information.  If you just want to see it, it may not matter how.  The advantage of using an AREA command with the Object option is that the result then goes into the AREA system variable, which you can then pull using (getvar 'area) to use in [for example] calculations or Text content in an AutoLisp routine.  [But keep in mind that the value will be in square drawing units, so if you use Imperial Architectural or Engineering units it will be in square inches, without the square feet variant that you see displayed in Properties or in LIST's reporting.  Or if your drawing unit is a millimeter or centimeter, you will need to do the division if you want it in square meters.]

Kent Cooper, AIA
0 Likes
Message 4 of 19

Kent1Cooper
Consultant
Consultant

@imadHabash wrote:

.... You can by using the Object option for closed polylines, circles, and regions. ....


... and Splines and Ellipses.  Any closed "basic" object type [not MLINEs].

[Interestingly, the Properties palette will even show you an Area for an Arc, the same as if it were a Polyline with a line segment chord closing it.  But neither AREA nor LIST will give you an Arc's area -- they both complain that the object has no area.  The AREA command with Object option also reports the area of an open Polyline or Spline or Ellipse; LIST does for an open Polyline but not a Spline or Ellipse.  The Properties palette shows it for an open Polyline or Ellipse but not an open Spline.]

Kent Cooper, AIA
0 Likes
Message 5 of 19

autoid374ceb4990
Collaborator
Collaborator

Assuming that you want to find the area of several PLINES  with the AREA command in sequence without having to enter the 'O', on the command line type (command "area" "O") and press Enter.  Select the PLINE which will display the area and perimeter.  Then Press Enter to repeat.

0 Likes
Message 6 of 19

chriscowgill7373
Mentor
Mentor

AREA is on one side of the keyboard, if you type AREA then hit the spacebar twice it will go straight to select objects.


Christopher T. Cowgill, P.E.

AutoCAD Certified Professional
Civil 3D Certified Professional
Civil 3D 2026 on Windows 11

Please select the Accept as Solution button if my post solves your issue or answers your question.

0 Likes
Message 7 of 19

autoid374ceb4990
Collaborator
Collaborator

Hitting the space bar twice in the AREA command does not work on my old version of AutoCAD.

0 Likes
Message 8 of 19

chriscowgill7373
Mentor
Mentor

@autoid374ceb4990 wrote:

Hitting the space bar twice in the AREA command does not work on my old version of AutoCAD.


What version of AutoCAD are you using?  Spacebar has always, to my knowledge,  acted the same, similar to pressing enter.  Can you show a screenshot of your command line after typing AREA and hitting the spacebar?


Christopher T. Cowgill, P.E.

AutoCAD Certified Professional
Civil 3D Certified Professional
Civil 3D 2026 on Windows 11

Please select the Accept as Solution button if my post solves your issue or answers your question.

0 Likes
Message 9 of 19

autoid374ceb4990
Collaborator
Collaborator

Granted that I am using R14 and, as you stated, normally Space Bar or Enter usually act the same, but for this particular command pressing either key does nothing but terminate the command.  Entering 'O' (for object) allows the selection of an entity.  Text in red was added to the screen shot.

 

area_command.jpg

0 Likes
Message 10 of 19

Kent1Cooper
Consultant
Consultant

So older versions like that don't yet have a default offered as in newer versions:

Kent1Cooper_0-1777987799590.png

which one gets by hitting Enter/space.

It would be easy to make a little custom command definition that would invoke the Object option for you, regardless of version.

EDiT:  For example:

(defun C:AO () (command "_.area" "_object") (prin1))

Kent Cooper, AIA
0 Likes
Message 11 of 19

autoid374ceb4990
Collaborator
Collaborator

(defun C:AO () (command "_.area" "_object") (prin1))

Yes, that works just like my suggestion in post #5.

0 Likes
Message 12 of 19

Kent1Cooper
Consultant
Consultant

@autoid374ceb4990 wrote:

....

Yes, that works just like my suggestion in post #5.


Except that when I follow your suggestion in Message 5, the first pass works fine, but when I "Press Enter to repeat", it recalls only the basic Area command with its standard prompt, without automatic selection of the Object option built in as on the first pass.  Defining it into a custom command name does get it with the built-in Object option, when repeated with Enter.

Kent Cooper, AIA
0 Likes
Message 13 of 19

cjshaw14
Enthusiast
Enthusiast

Thank you, for doing a few area measurements these are all great suggestions. However, on the dwg I am working on, there are over one hundred areas to measure, then type each number into a text field for that area. Back to the original question, is it possible to have the prompt set as Select Object or even better, which I am researching, can a one button shortcut (macro) be created and added to the panel. 

Similar to the CUI, I’ve customized the mouse right click and a pulldown menus to only the items used most often like Clipboard, Copy Basepoint, Paste As Block, etc.  

0 Likes
Message 14 of 19

Kent1Cooper
Consultant
Consultant
Accepted solution

There are surely routines you can Search for [more likely in the Customization Forum] that will create and fill in such a Field for the area of any selected object [that has area], so that all you need to do is call the command, select the object, and maybe tell it where you want the text Field if that's not automatically centered on the object or something.  Some may let you pick multiple objects at once if their Field text part is positioned in some standard way.  There should be no need to read what is reported and then type it into text content yourself.  Search for terms like "label area" or variants including "field" and/or "text."

If you find such a command definition that works for you, getting it automatically loaded into every drawing is easy, and a keyboard shortcut can be made to call it, or you can put it into a Tool Palette button, and maybe a few other approaches.

Kent Cooper, AIA
0 Likes
Message 15 of 19

pendean
Community Legend
Community Legend

@cjshaw14 wrote:

.... Similar to the CUI, I’ve customized the mouse right click and a pulldown menus to only the items used most often like Clipboard, Copy Basepoint, Paste As Block, etc.  


In old R0014, you will need to find and edit your active in use MNU/MNR files, and enter your LISP/Code there. Then reload, test, probably open it again to tweak.

How familiar are you with all of that? There is nothing "graphic interface" in R0014.

0 Likes
Message 16 of 19

chriscowgill7373
Mentor
Mentor

@cjshaw14 wrote:

Thank you, for doing a few area measurements these are all great suggestions. However, on the dwg I am working on, there are over one hundred areas to measure, then type each number into a text field for that area. Back to the original question, is it possible to have the prompt set as Select Object or even better, which I am researching, can a one button shortcut (macro) be created and added to the panel. 

Similar to the CUI, I’ve customized the mouse right click and a pulldown menus to only the items used most often like Clipboard, Copy Basepoint, Paste As Block, etc.  


So what you are really looking for is a way to place text in the drawing that displays the area of a bunch of objects?

That task vould be automated with a LISP routine that has you select the object, and it adds a piece of text with a field linked to the object.

Ive got one, but wont have access to get it for about an hour.

 

(defun LinkedArea (ent pt / obj objID ip width str)
  (setq obj   (vlax-ename->vla-object ent)
        objID (vla-get-objectid obj)
        ip    (vlax-3D-Point pt)
        width 0.0
        str   (strcat
                "%<\\AcObjProp Object(%<\\_ObjId " (itoa objID) ">%).Area \\f \"%lu2%pr2\">%"
              )
  )
  (setq tobj (vla-addMText (vla-get-modelspace (vla-get-activedocument (vlax-get-acad-object))) ip width str))
)
(defun c:QTA (/ a b)
(setq a (car (entsel)) b (getpoint "\n Select Point: "))
(linkedarea a b)
)

Christopher T. Cowgill, P.E.

AutoCAD Certified Professional
Civil 3D Certified Professional
Civil 3D 2026 on Windows 11

Please select the Accept as Solution button if my post solves your issue or answers your question.

0 Likes
Message 17 of 19

autoid374ceb4990
Collaborator
Collaborator

Attached is an AI generated (old) LISP program that will label the area of closed POLYLINEs.  Works only with closed POLYLINEs.

0 Likes
Message 18 of 19

pkomatlapalli
Community Manager
Community Manager

Hello, @cjshaw14 ,

Just checking in—did the responses shared by @autoid374ceb4990 @Kent1Cooper @chriscowgill7373  help clarify your question?

If so, please consider clicking the "Accept Solution" button. Doing so helps others in the community find answers to similar issues.

If your question still needs more attention, feel free to reply here with an update. This way, other members can jump in with further suggestions or guidance to help you move forward.
 

Pavan Kumar | Community Manager
0 Likes
Message 19 of 19

cjshaw14
Enthusiast
Enthusiast

Sorry for the delayed response, I've moved on and ended up doing the original extra steps. I’ll look into Kent1 suggestion of customized.  Thanks!

0 Likes