@CSM_MAI wrote:
Is there a way to destenguish between a polyline and a revcloud polyline using dxf codes within lisp? I need to select all polyline revclouds on a specific layer but not regular polylines. Any info would be appreciated. Thanks.
Assuming this hasn't changed since I wrote the MakeMore.lsp routine involving this question, long ago, a Revcloud that has not been altered [i.e. Trimmed, Broken, Stretched, grip-edited any arc segments to a different shape] has all bulge factors of its arc segments the same, even of different-length segments.
The following excerpts from MakeMore use 'data' as a variable containing the entity data list of a Polyline. The 'cl' variable comes from earlier in the larger routine, being T if the Polyline is closed or nil if it's open.
The eq42 function is to test whether all bulge factors are equal to a given value:
(defun eq42 (val / pdata); find whether *all* bulge factors [(assoc 42) entries] have specified value
(setq pdata data)
(while (equal (cdr (assoc 42 pdata)) val 1e-6); can be + or -
(setq pdata (cdr (member (assoc 42 pdata) pdata))); remainder after this 42 entry
); while
(not (assoc 42 pdata)); returns T if they were all equal [none left]
); defun - eq42
This (and) function tests whether a Polyline could have been drawn with the Revcloud commmand [it would be a pretty remarkable coincidence if it were drawn otherwise with only arc segments of exactly the right bulge factor]:
(and
(assoc 43 data); global width [this was from before the calligraphic option existed]
(or
(and
cl ; it's closed
(or (eq42 0.520567) (eq42 -0.520567)); all Revcloud-type arc segments, bulging same direction
); and
(and
(not cl) it's open
(setq data (reverse (cddr (reverse data))))
; removes last (42) entry, which is 0 for open Revclouds. Then:
(or (eq42 0.520567) (eq42 -0.520567)); all Revcloud-type remaining
); and
); or
); and
But if you Break/Trim/Stretch/grip-edit/etc. a Revcloud, at least some bulge factor(s) will change, so the above will not recognize it as one.
To find all of what you're looking for, you would have to first find all Polylines on the Layer you want, then step through the selection set and apply the test to each one, (ssdel)-ing those that don't pass to remove them from the selection set.
Kent Cooper, AIA