TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: V-Man on May 16, 2008, 08:49:36 AM
-
How can I search a drawing for 0.00 Sqaure Feet lwpolylines?
-
How can I search a drawing for 0.00 Sqaure Feet lwpolylines?
You can use Quick Select.
-
Take a selection set of all polylines and cycle through their (assoc 10 ...) values and comparing their equality. Remove from the set those that are not equal and you will have a selection set that is containing only 0.0 sq ft plines.
-
How can I search a drawing for 0.00 Sqaure Feet lwpolylines?
You can use Quick Select.
That would work too.
-
Here is a quickie.
(defun c:test (/ ss vlalst)
(setq ss (ssget "X" '((0 . "LWPOLYLINE"))))
(setq vlalst (mapcar 'vlax-ename->vla-object
(vl-remove-if 'listp (mapcar 'cadr (ssnamex ss)))
)
)
(mapcar '(lambda (x)
(if (and (vlax-property-available-p x 'area)
(zerop (setq area (vla-get-area x)))
)
(setq zeroLst (cons x ZeroLst))
)
)
vlalst
)
ZeroLst
)
-
Thanks for the many replies. It's much appreciated. I now know what I need to get started.
-
Unfortunatelly the vertex doesn't help because any stright pline has a zero area.
So it may have two or more vertex and still be zero area like this pline:
Select entity to list.((-1 . <Entity name: 1cacb78>) (0 . "LWPOLYLINE") (330 .
<Entity name: 1cac810>) (5 . "8F") (100 . "AcDbEntity") (67 . 0) (410 .
"Model") (8 . "TestLayer01") (100 . "AcDbPolyline") (90 . 4) (70 . 0) (43 .
0.0) (38 . 0.0) (39 . 0.0) (10 0.0 0.0) (40 . 0.0) (41 . 0.0) (42 . 0.0) (10
0.0 6.0) (40 . 0.0) (41 . 0.0) (42 . 0.0) (10 0.0 12.0) (40 . 0.0) (41 . 0.0)
(42 . 0.0) (10 0.0 15.0) (40 . 0.0) (41 . 0.0) (42 . 0.0) (210 0.0 0.0 1.0))
-
Yeah, I realized that after the fact. I just hope he's not needing this for the ACAD 14 software otherwise none of our suggestions will work.