Ssget looking inside Blocks

Discussion in 'AutoCAD' started by Y. Gauthier, Apr 15, 2004.

  1. Y. Gauthier

    Y. Gauthier Guest

    Hi to all,

    I have a drawing with a few copy of a block.
    The blocks are on layer "BLK"
    The block contains lines on layer "A" and "B"

    Is it possible to make a selection set (ssget) with the
    lines on layer "A" in it, without exploding
    all the blocks?

    Yves
     
    Y. Gauthier, Apr 15, 2004
    #1
  2. Y. Gauthier

    bestafor Guest

    HiHo;
    Yes, but it's easier to use the FILTER command and then us P for
    previous.
     
    bestafor, Apr 16, 2004
    #2
  3. Y. Gauthier

    Randy Jones Guest

    SSX will NOT find nested objects (and neither will filter).
     
    Randy Jones, Apr 16, 2004
    #3
  4. Y. Gauthier

    bob.at Guest

    Hi Yves,

    your "copy of a block" in the drawing are not really copies but only
    references to th block tabel, call "inserts". So it is not possible to
    select single lines of such an insert.
    If you want to change something within the bolck you must search the
    block definition in the block tabel and change the elements which
    build the block. Take a lock to the following code. It searches a
    block "test", steps through all elements of this block and changes the
    layer of those elements wich are on layer "a" to layer "0"; then
    regens the drawing to rebuild all inserts in the drawing.
    Feel free to use this code sniplet. Hope it helps you

    bob.at

    (setq a (tblsearch "BLOCK" "test")) ; gets the block header
    (setq b (cdr (assoc -2 a))) ; gets Object name of first element in
    block
    (while b
    (setq be (entget b)) ; gets entity list of element
    (if (= (cdr (assoc 8 be)) "a")
    (progn
    (setq ce (subst (cons 8 "0") (assoc 8 be) be))
    (entmod ce)
    )
    )
    (setq b (entnext b))
    )
    (command "_.regen")
     
    bob.at, Apr 16, 2004
    #4
  5. No. But if you look at it you may not have asked the question that you think
    you did.
    What do you want to do, assuming making a selection set is just a means to
    another end?
     
    Michael Bulatovich, Apr 16, 2004
    #5
  6. Y. Gauthier

    Y. Gauthier Guest

    No. But if you look at it you may not have asked the question that you think
    Ok: I need to detect if there is any line on layer "A".
    But of course a block inserted on layer "B" may contain
    line on layer "A"... I still not allowed to explode the drawing.

    Futhermore, I realised that I have to write this function
    in C++ instead of lisp (into an ARX file),
    so I'll try to convert Bob`s suggestion to C++.

    The new thread name should now be: "Ads_ssget looking into Blocks"...

    Thanks!
     
    Y. Gauthier, Apr 27, 2004
    #6
  7. Y. Gauthier

    Y. Gauthier Guest

    Oops:
    Just to be consistent with my previous posts:
    "But of course a block inserted on layer "BLK" may contain
    line on layer `A`..."
     
    Y. Gauthier, Apr 27, 2004
    #7
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.