Results 1 to 3 of 3

Thread: Block name list

  1. #1
    Member
    Join Date
    2007-10
    Posts
    9
    Login to Give a bone
    0

    Cool Block name list

    I know that (setq ss (ssget "X" (list (cons 0 "INSERT")(cons 66 1)))) gets a ss of all blocks that contain attributes, what i'm wanting to do is get the block names into a list (MYLIST)to use with the "foreach" function.
    Can anyone help? thanks

  2. #2
    100 Club
    Join Date
    2002-08
    Posts
    192
    Login to Give a bone
    0

    Default Re: Block name list

    Hi,

    Try this
    Code:
    ((lambda ( / ss n namblk lst_namblk)
      (setq ss (ssget "X" (list (cons 0 "INSERT")(cons 66 1))))
      (cond
        (ss
          (setq n (sslength ss))
          (repeat n
            (setq namblk (cdr (assoc 2 (entget (ssname ss (setq n (1- n)))))))
            (if (not (member namblk lst_namblk))
              (setq lst_namblk (cons namblk lst_namblk))
            )
          )
          lst_namblk
        )
      )
    ))

  3. #3
    Member
    Join Date
    2007-10
    Posts
    9
    Login to Give a bone
    0

    Default Re: Block name list

    Many thanks Bruno, that did the trick!

Similar Threads

  1. 2015: Mapbook with list of block attribute values
    By brentwride411655 in forum AutoCAD Map 3D - General
    Replies: 0
    Last Post: 2015-06-26, 09:55 PM
  2. 2013: Can't find user block in block list while creating a multi-leader style
    By rsturgeon502669 in forum AutoCAD Annotation
    Replies: 1
    Last Post: 2013-07-08, 07:05 AM
  3. Highlight Last Opened Block in Block Editor Block List
    By autocad.wishlist1734 in forum AutoCAD Wish List
    Replies: 0
    Last Post: 2008-10-11, 09:03 PM
  4. Block List (automated)
    By moosbruggeralex in forum API Wish List
    Replies: 0
    Last Post: 2008-01-04, 03:36 PM
  5. Replies: 10
    Last Post: 2006-12-28, 10:11 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •