ssget help

Discussion in 'AutoCAD' started by Jtgodwin, Feb 20, 2004.

  1. Jtgodwin

    Jtgodwin Guest

    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
     
    Jtgodwin, Feb 20, 2004
    #1
  2. 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

    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.
     
    Ken Alexander, Feb 20, 2004
    #2
  3. Jtgodwin

    Joe Burke Guest

    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


    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.
     
    Joe Burke, Feb 20, 2004
    #3
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.