Object Selection Filter

Discussion in 'AutoCAD' started by farris, Jul 30, 2003.

  1. farris

    farris Guest

    I’m trying to find a lisp routine or lisp code that will let you select a particular block that is on multiple layers and has different attribute value(s). For example, Enter block Name…"***" On Layer…"****" with attribute value "***". I want to be able to select only the Block with these filters.
    AutoCad’s Object selection filter lets you select the Block name, Layer and Attribute Tag but not the Attribute value.
    Any help would be appreciated.
     
    farris, Jul 30, 2003
    #1
  2. farris

    BillZ Guest

    (setq ss (ssget "x" '((0 . "INSERT")(2 . "BLOCKNAME"))))





    Bill
     
    BillZ, Jul 30, 2003
    #2
  3. farris

    farris Guest

    Is there a group code for attributes?
     
    farris, Jul 30, 2003
    #3
  4. farris

    Mark Guest

    (setq ss (ssget "X" (list (cons 8 layername)
    (cons 0 "INSERT")
    (cons 2 blockname)
    (cons 66 1) ))) ;;; has attributes

    then put the selection inside a (while or a (repeat
    and check each block for the specified attribute
    value, you might have to loop each insert object
    for all its attributes until you encounter a SEQEND


    on multiple layers and has different attribute value(s). For example, Enter block Name."***" On
    Layer."****" with attribute value "***". I want to be able to select only the Block with these
    filters.
     
    Mark, Jul 30, 2003
    #4
  5. farris

    farris Guest

    Sorry, I'm still a little new to lisp routines. I understand how the layer and the block name work to select the objects, but still don't understand how to get the the attribute with a certain text value to be selected.

    I'm basically trying to find all the blocks in the drawing with a certain block name,layer name and a certain attribute text value and change it to a different layer.
     
    farris, Jul 31, 2003
    #5
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.