• Industries
  • Products
  • Buy
  • Services & Support
  • Communities
  • Discussion Groups

    Visual LISP, AutoLISP and General Customization

    Reply
    Valued Contributor
    Posts: 99
    Registered: ‎06-16-2002

    change entities layers in deep nesting blocks

    59 Views, 3 Replies
    06-05-2007 02:45 AM
    something like below:
    level 1 block consists of
    level 2 block y1
    level 2 block y2
    level 3 block z1
    level 3 block z2
    level 2 block y3
    what kind of algorithm should i use? i'm kind of lost in lisp coding, need a clear hint from you guys, many thanks!
    Please use plain text.
    Valued Contributor
    Posts: 99
    Registered: ‎06-16-2002

    Re: change entities layers in deep nesting blocks

    06-05-2007 03:01 AM in reply to: superjoe
    to be more specific, only one instance of level 1 block existed in drawing, which cannot be selected using (setq ss (ssget "x" (list (cons 0 "insert") (cons 66 1)))), but it's OK if using (setq ss (ssget "x" (list (cons 0 "insert"))))
    Please use plain text.
    Distinguished Contributor
    Posts: 169
    Registered: ‎11-24-2003

    Re: change entities layers in deep nesting blocks

    06-05-2007 04:27 AM in reply to: superjoe
    If the block does not have any attributes it can't be selected with the (cons 66 1)

    have you tried using "nentsel" refer to the acad help.
    B
    Please use plain text.
    Valued Contributor
    Posts: 99
    Registered: ‎06-16-2002

    Re: change entities layers in deep nesting blocks

    06-05-2007 06:38 PM in reply to: superjoe
    thanks B.
    better not have any user selections, i find the way out, use (tblobjname "block" blockname) instead of (tblsearch "block" blockname), the only thing now is to make recursive subroutine to step through nesting blocks no matter how deep it is.
    Please use plain text.