CAD Forums > CAD General

Select Similar Hatch for Gross Area

(1/4) > >>

MSTG007:
I was looking if there is a easy way to get the gross areas of these hatches if I select similar. I am not having any luck.

I know the long way of doing it with Re-associating a boundary with it on each one and then delete the hatch. . .

Is there a routine that I could select all of them and converts them over to a hatch that gives me the area with the same source hatch pattern? Just brainstorming around.

Thanks for any ideas.

Rob...:
That sounds like something Lee Mac would have.

ronjonp:
I've been using THIS for years.

cadtag:
FILTER will let you select by Hatch Pattern Name.  Note that it is case-sensitive

ronjonp:
This will place boundaries on a layer named the same as the pattern name. Then you can tally the areas by layer name.


--- Code - Auto/Visual Lisp: ---(defun c:hbound (/ *error* i p s v x)  (defun *error* (msg)    (mapcar '(lambda (x) (setvar (car x) (cdr x))) v)    (if (not (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*"))      (princ (strcat "\nError: " msg))    )    (princ)  )  (setq i 0)  ;; Tested in AutoCAD 2018 - RJP 6.20.2018  ;; Creates boundaries on layers that match the hatch pattern name  (if (setq s (ssget '((0 . "hatch"))))    (progn (setq             v (mapcar '(lambda (x) (cons x (getvar x))) '("clayer" "cmdecho" "hpseparate" "hpbound"))           )           (setvar 'cmdecho 0)           (setvar 'hpseparate 1)           (setvar 'hpbound 1)           (foreach x (vl-remove-if 'listp (mapcar 'cadr (ssnamex s)))             (if (null (tblobjname "layer" (setq p (cdr (assoc 2 (entget x))))))               (entmakex (list '(0 . "LAYER")                               '(100 . "AcDbSymbolTableRecord")                               '(100 . "AcDbLayerTableRecord")                               '(70 . 0)                               (cons 2 p)                               '(6 . "Continuous")                               (cons 62 (setq i (1+ i)))                         )               )             )             (setvar 'clayer p)             (command "_hatchgenerateboundary" x "")           )           (mapcar '(lambda (x) (setvar (car x) (cdr x))) v)    )  )  (princ))

Navigation

[0] Message Index

[#] Next page

Go to full version