### Author Topic: Zero SF lwpolyline?  (Read 1160 times)

0 Members and 1 Guest are viewing this topic.

#### V-Man

• Bull Frog
• Posts: 334
• I exist therefore I am!
##### Zero SF lwpolyline?
« on: May 16, 2008, 08:49:36 AM »

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

#### Guest

• Guest
##### Re: Zero SF lwpolyline?
« Reply #1 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.

#### daron

• Guest
##### Re: Zero SF lwpolyline?
« Reply #2 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.

#### daron

• Guest
##### Re: Zero SF lwpolyline?
« Reply #3 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.

#### CAB

• Global Moderator
• Seagull
• Posts: 10377
##### Re: Zero SF lwpolyline?
« Reply #4 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)`
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970

#### V-Man

• Bull Frog
• Posts: 334
• I exist therefore I am!
##### Re: Zero SF lwpolyline?
« Reply #5 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.

#### CAB

• Global Moderator
• Seagull
• Posts: 10377
##### Re: Zero SF lwpolyline?
« Reply #6 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))`
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970