TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: V-Man on May 16, 2008, 08:49:36 AM

Title: Zero SF lwpolyline?
Post by: V-Man on May 16, 2008, 08:49:36 AM

How can I search a drawing for 0.00 Sqaure Feet lwpolylines?
Title: Re: Zero SF lwpolyline?
Post by: Guest on May 16, 2008, 09:01:28 AM

How can I search a drawing for 0.00 Sqaure Feet lwpolylines?

You can use Quick Select.
Title: Re: Zero SF lwpolyline?
Post by: daron on May 16, 2008, 09:05:23 AM
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.
Title: Re: Zero SF lwpolyline?
Post by: daron on May 16, 2008, 09:06:37 AM

How can I search a drawing for 0.00 Sqaure Feet lwpolylines?

You can use Quick Select.
That would work too.
Title: Re: Zero SF lwpolyline?
Post by: CAB on May 16, 2008, 09:18:26 AM
Here is a quickie.
Code: [Select]
(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
)
Title: Re: Zero SF lwpolyline?
Post by: V-Man on May 16, 2008, 09:24:56 AM

Thanks for the many replies. It's much appreciated. I now know what I need to get started.
Title: Re: Zero SF lwpolyline?
Post by: CAB on May 16, 2008, 09:25:05 AM
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:
Code: [Select]
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))
Title: Re: Zero SF lwpolyline?
Post by: daron on May 16, 2008, 03:15:31 PM
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.