filtering existing selection set

Discussion in 'AutoCAD' started by ckostecki, Apr 1, 2004.

  1. ckostecki

    ckostecki Guest

    I am attempting to select all viewports and re-filter the list several times performing operations on each refilter, thus not having to reselect again and again..

    Why is this code causing an error?

    (setq SelectionSet (ssget (list '(0 . "VIEWPORT"))))
    (ssget "SelectionSet" '(-4 . "<NOT")'(8 . "PSPLAN_VPORT,PSPROF_VPORT")'(-4 . "NOT>"))
    (command "change" "previous" "" "properties" "Layer" "defpoints" "")


    I must have a syntax incorrect or do I need to use a (list '(-4 . "<NOT")........
    Thanks,
    Curtis
     
    ckostecki, Apr 1, 2004
    #1
  2. ckostecki

    Tom Smith Guest

    I must have a syntax incorrect

    The first one had a good filter list, the second had a series of lists. You
    need to put them in one list:

    (ssget "SelectionSet" '((-4 . "<NOT")'(8 . "PSPLAN_VPORT,PSPROF_VPORT")'(-4
    .. "NOT>")))
     
    Tom Smith, Apr 1, 2004
    #2
  3. ckostecki

    ckostecki Guest

    I copied the exact posting and even tried variations of the lists as one list. to one resolve: " error: bad point argument"

    (setq SelectionSet (ssget (list '(0 . "VIEWPORT"))))
    (ssget "SelectionSet" '((-4 . "<NOT")'(8 . "PSPLAN_VPORT,PSPROF_VPORT")'(-4 . "NOT>")))
    (command "change" "previous" "" "properties" "Layer" "defpoints" "")

    I thought this would be a simple thing, but it keeps eluding me.

    Any help is appreciated.

    Curtis
     
    ckostecki, Apr 1, 2004
    #3
  4. ckostecki

    Jeff Mishler Guest

    Curtis,
    You can't pass a selection set to the (ssget) function. You can use more
    than 1 filter at a time, however.
    Try this:
    (setq SelectionSet (ssget (list '(0 . "VIEWPORT")'(-4 . "<NOT")
    '(8 . "PSPLAN_VPORT,PSPROF_VPORT")'(-4 . "NOT>"))))

    HTH,
    Jeff

    list. to one resolve: " error: bad point argument"
    "PSPLAN_VPORT,PSPROF_VPORT")'(-4 . "NOT>")))
     
    Jeff Mishler, Apr 1, 2004
    #4
  5. ckostecki

    Tom Smith Guest

    I copied the exact posting and even tried variations of the lists as one
    list. to one resolve: " error: bad point argument"

    He's right, you can't pass the sset name as an argument. But you can combine
    all the filters, or use the previous set:

    (setq SelectionSet (ssget (list '(0 . "VIEWPORT"))))
    (setq SelectionSet (ssget "p" '((-4 . "<NOT")(8 .
    "PSPLAN_VPORT,PSPROF_VPORT")(-4 . "NOT>"))))

    Also note that you only need to quote the whole filter list.
     
    Tom Smith, Apr 1, 2004
    #5
  6. ckostecki

    ckostecki Guest

    Thanks everyone for your help,
    Problems all solved

    Curtis
     
    ckostecki, Apr 2, 2004
    #6
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.