Block Description

Discussion in 'AutoCAD' started by Matt W, Jun 7, 2004.

  1. Matt W

    Matt W Guest

    Is it possible to access a block's description?? If so, how?!?

    Thanks in advance!
     
    Matt W, Jun 7, 2004
    #1
  2. Matt W

    Jürg Menzi Guest

    Hi Matt

    If you wanna access the entities in a block reference use something like this:

    (setq BlkTbl (tblobjname "BLOCK" "MyBlockName")
    CurEnt (cdr (assoc -2 (entget BlkTbl)))
    )
    (while (setq CurEnt (entnext CurEnt))
    (setq EntLst (entget CurEnt))
    ;Do your thingis with each block entity
    )

    Cheers
     
    Jürg Menzi, Jun 7, 2004
    #2
  3. Entget returns the insert object, not the block definition.
    You may have to use tblobjectname to get the block definition data.

    (defun C:GetDesc ( / )
    (setq ent (entget (car (entsel "\n Select a block... "))))
    (setq bent (entget (tblobjname "BLOCK" (cdr (assoc 2 ent)))))
    (setq lay (cdr (assoc 8 ent)))
    (setq desc (cdr (assoc 4 bent)))
    (princ lay)
    (princ desc)
    (princ)
    )
     
    Allen Johnson, Jun 7, 2004
    #3
  4. Matt W

    Matt W Guest

    Thanks guys.... It was staring me in the face the whole time, mocking me.


    --
    Matt W

    There are 3 kinds of people:
    Those who can count, and those who can't.

    | Entget returns the insert object, not the block definition.
    | You may have to use tblobjectname to get the block definition data.
    |
    | (defun C:GetDesc ( / )
    | (setq ent (entget (car (entsel "\n Select a block... "))))
    | (setq bent (entget (tblobjname "BLOCK" (cdr (assoc 2 ent)))))
    | (setq lay (cdr (assoc 8 ent)))
    | (setq desc (cdr (assoc 4 bent)))
    | (princ lay)
    | (princ desc)
    | (princ)
    | )
    |
    |
     
    Matt W, Jun 7, 2004
    #4
  5. Matt W

    Jürg Menzi Guest

    Hi Matt

    Didn't recognize that you are looking for the *Description* of a Block.
    Allen has the answer...

    Cheers
     
    Jürg Menzi, Jun 7, 2004
    #5
  6. Matt W

    Joe Burke Guest

    Matt,

    I'm not familiar with this DBViewer thing. Did a few web searches, but found nothing
    useful. A link or a company name would help.

    Thanks
    Joe Burke
     
    Joe Burke, Jun 9, 2004
    #6
  7. Matt W

    Matt W Guest

    Check the Customer Files news group.
    I've posted two files there; one for 2002 and one for 2004.
    It's an ARX file.


    --
    Matt W

    There are 3 kinds of people:
    Those who can count, and those who can't.

    | Matt,
    |
    | I'm not familiar with this DBViewer thing. Did a few web searches, but
    found nothing
    | useful. A link or a company name would help.
    |
    | Thanks
    | Joe Burke
    |
    |
     
    Matt W, Jun 11, 2004
    #7
  8. Matt W

    Joe Burke Guest

    Many thanks, Matt. Looks interesting.

    Joe Burke
     
    Joe Burke, Jun 13, 2004
    #8
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.