Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Reply
Message 1 of 3
Jtgodwin
138 Views, 2 Replies

ssget help

Hi guys,

I need some help, I want to use the ssget command to select a set of lines that are less than .090" long. I can select all the lines but I don't know how to filter out everything that is longer than .090" long.

Here is what I have so far: (setq entx (ssget "X" '((0 . "LINE"))))

I would appreciate any help.

Thanks
Josh
2 REPLIES 2
Message 2 of 3
Anonymous
in reply to: Jtgodwin

You have to step through the sel set and check lengths. (defun get<=0.09_lines (/ ss cnt ent entdata len) (setq ss (ssget "X" '((0 . "line"))) cnt 0 ) (if ss (repeat (sslength ss) (setq ent (ssname ss cnt) entdata (entget ent) len (distance (cdr (assoc 10 entdata)) (cdr (assoc 11 entdata)) ) ) (if (> len 0.09) (ssdel ent ss) (setq cnt (1+ cnt)) ) ) (princ "\nNo lines. ") ) ss ) -- Ken Alexander Acad2004 Windows2000 Prof. "We can't solve problems by using the same kind of thinking we used when we created them." --Albert Einstein "Jtgodwin" wrote in message news:27085718.1077289123195.JavaMail.jive@jiveforum1.autodesk.com... > Hi guys, > > I need some help, I want to use the ssget command to select a set of lines that are less than .090" long. I can select all the lines but I don't know how to filter out everything that is longer than .090" long. > > Here is what I have so far: (setq entx (ssget "X" '((0 . "LINE")))) > > I would appreciate any help. > > Thanks > Josh
Message 3 of 3
Anonymous
in reply to: Jtgodwin

Josh, I might be wrong, but I don't think you can do it with a ssget filter alone. You'll have to post-process the line selection set in some form. Either use the 10 and 11 codes and calculate the distance between those points. Or use vlisp to get the line Length property. I think the latter method is easier, but both will work. Joe Burke "Jtgodwin" wrote in message news:27085718.1077289123195.JavaMail.jive@jiveforum1.autodesk.com... > Hi guys, > > I need some help, I want to use the ssget command to select a set of lines that are less than .090" long. I can select all the lines but I don't know how to filter out everything that is longer than .090" long. > > Here is what I have so far: (setq entx (ssget "X" '((0 . "LINE")))) > > I would appreciate any help. > > Thanks > Josh

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost