View Full Version : ssget filter
rken.laws
2008-12-19, 01:54 PM
Is there a way to filter a selection set based on the angle of a line?
ccowgill
2008-12-19, 02:19 PM
I dont believe you can do it as an initial filter, but you can apply it as a secondary filter. After you have your selection set of objects, you can make a new selection set from that one based on the angle of the line. Lines have an angle property, it is expressed in radians, so you could filter based on the angle:
(setq ss (ssget "_X" '((0 . "LINE")))
count 0
sslen (sslength ss))
(ssadd ss2)
(while (< count sslen)
(setq obj (ssname ss count)
vlaobj (vlax-ename->vla-object obj))
(if (= (vla-get-angle vlaobj) myangle))
(ssadd ss2 obj)
)
(setq count (1+ count))
)
I havent tested it.
rken.laws
2008-12-19, 07:41 PM
it should be (vlax-ename->vla-object obj) instead of (vla-ename->vlax-object obj)) but that is what I needed. Thanks!!
ccowgill
2009-01-07, 03:23 PM
it should be (vlax-ename->vla-object obj) instead of (vla-ename->vlax-object obj)) but that is what I needed. Thanks!!
glad you could get it to work.
vBulletin® v3.6.7, Copyright ©2000-2009, Jelsoft Enterprises Ltd.