Jump to content

Recommended Posts

Posted

I'm trying to get the area of a particular hatch, but I don't see the area in the properties window. Does anyone know why "Area" isn't showing in my properties window. I've attached a screen shot of my properties window after selecting the hatch.

 

I'm using Autocad 2009....

 

Thanks,

 

kc

hatch area.jpg

Posted

Hmm, I just tried that on my computer at home (Acad 2006), and I tried making hatch that was not associative, but I was able to still see the area in the properties window (I'll attach a screen shot of this). So, I don't think associativity is the cause of this. Any other suggestions as to why the hatch in ACAD Civil 3d 2009 didn't display the area in the properties window for me?

 

Thanks for any help.

 

kc

hatch not associative.JPG

Posted

I've seen it before. It may have to do with the hatch boundary used to define the hatch actually has some glitches, like crossing lines or overlapping segment.

Posted

just hatchedit (HE) the object, recreate the boundary, then pick the created pline with "area" "object". come to think of it, i'm pretty sure you can just area object and pick the hatch entity itself and have it return the area in square feet. don't have access to cad right now to test though.

go here: http://www.jtbworld.com

he has a routine posted called "hatchb.lsp" that will create the boundary (closed pline) of a picked hatch entity.

Posted

That's a neat lisp. Up until now, I had to recreate the boundaries and join the line segments to form a polyline.

 

The problem is that my specific hatch has several pieces, so I would need to click on each polyline seperately and add up the areas manually.

 

I suppose I could re-create the hatch with those created polylines from the lisp and then see if it displays the area. I actually wasn't the one who created the hatch in the first place, so I just wish there was a way to have it show the area in the properties window. I appreciate all your help. Let me know if you can think of another way to try.

 

kc

Posted

you can get the area of multiple areas whith this lisp:

 

;;POLYAREA.LSP - (c) 1998 Tee Square Graphics
;;
;;  Calculates the area of one or more closed polylines and
;;  displays the result in an AutoCAD Alert Window.
;;
(defun C:POLYAREA (/ a ss n du)
 (setq a 0
       du (getvar "dimunit")
       ss (ssget '((-4 . "<OR")(0 . "LWPOLYLINE")
                   (0 . "POLYLINE")(-4 . "OR>"))))
 (if ss
   (progn
     (setq n (1- (sslength ss)))
     (while (>= n 0)
       (command "_.area" "_o" (ssname ss n))
       (setq a (+ a (getvar "area"))
             n (1- n)))
     (alert
       (strcat "The total area of the selected\nobject(s) is "
               (if (or (= du 3)(= du 4)(= du 6))
;
;The following 2 lines translate the area to square inches and feet
;for users using US engineering or architectural units:
;
                 (strcat (rtos a 2 2) " square inches,\nor "
                         (rtos (/ a 144.0) 2 3) " square feet.")
;
;In the following line, change the word "units" to whatever units
;you are using - meters, millimeters, feet, etc.
;
                 (strcat (rtos a 2 3) " square units.")))))
   (alert "\nNo Polylines selected!"))
 (princ)
)
(alert
 (strcat "POLYAREA.LSP  (c) 1997 Tee Square Graphics"
         "\n\n          Type POLYAREA to start"))
(princ)

Posted

Thank you. That's a pretty sweet lisp too.

 

kc

Posted

i use this to calc areas of plines & aecc_contours. it will give you sq. ft., ac., sq. yd. and ln. ft. you can select as many plines as you want, it will just add them up.

 

(defun c:CTA (/ a ss n du)
(setq a 0
      b 0
      ;du (getvar "dimunit")
      ss (ssget '((0 . "*POLYLINE,AECC_CONTOUR")))
)
(if ss
  (progn
    (setq n (1- (sslength ss)))
    (while (>= n 0)
      (command "_.area" "_o" (ssname ss n))
      (setq a (+ a (getvar "area"))
          b (+ b (getvar "perimeter"))
            n (1- n)
      )
    )
    (setq SQFT (strcat (rtos a 2 2) "  Sq. Ft.")
          SQYD (strcat (rtos (/ a 9) 2 2) "  Sq. Yd.")
          ACRE (strcat (rtos (/ a 43560) 2 2) "  Acres")
       PERI (strcat (rtos b 2 2) "  Ln. Ft.")
    )
(TEXTSCR)
    (princ "\nThe total area:  ")(princ SQFT) (terpri)
    (princ "                 ")(princ SQYD) (terpri)
    (princ "                 ")(princ ACRE) (terpri)
   (princ "                 ")(princ PERI) (terpri)
  )
  (alert "\nNo Polylines or AECC_CONTOURs selected!")
)
(princ)
)

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