Results 1 to 4 of 4

Thread: Extracting Attribute Value from Title Block

  1. #1
    Member
    Join Date
    2015-11
    Posts
    3
    Login to Give a bone
    0

    Default Extracting Attribute Value from Title Block

    Hi,

    I'm trying to edit a lisp file and not having much luck.

    I need to extract an attribute value from a block and recall it later in the lisp.

    The block is called DAA-Title-Rev, the attribute tag is called REV and the value should be called lat_rev.

    I'd be really grateful if someone could point me in the right direction with this.

    May thanks in advance.

  2. #2
    All AUGI, all the time
    Join Date
    2010-06
    Posts
    962
    Login to Give a bone
    0

    Default Re: Extracting Attribute Value from Title Block

    Try this UNTESTED codes and after that you should have the text string values in the global variable *lst* and to check that out , after invoking the program type at the command line !*lst* then hit enter to see the string(s) if available.

    Code:
    (defun c:Test (/ ss i sn)
      (princ "\nSelect attributed block(s) :")
      (if (setq ss (ssget '((0 . "INSERT") (66 . 1))))
        (repeat (setq i (sslength ss))
          (setq sn (ssname ss (setq i (1- i))))
          (vl-some '(lambda (x)
                      (if (eq (strcase (vla-get-tagstring x)) "REV")
                        (setq *lst* (cons (vla-get-textstring x) *lst*))
                      )
                    )
                   (vlax-invoke (vlax-ename->vla-object sn) 'Getattributes)
          )
        )
      )
      (princ)
    )
    (vl-load-com)

  3. #3
    Member
    Join Date
    2015-11
    Posts
    3
    Login to Give a bone
    0

    Default Re: Extracting Attribute Value from Title Block

    Thanks for the help, much appreciated.

  4. #4
    All AUGI, all the time
    Join Date
    2010-06
    Posts
    962
    Login to Give a bone
    0

    Default Re: Extracting Attribute Value from Title Block

    Quote Originally Posted by cad675189 View Post
    Thanks for the help, much appreciated.
    You're welcome . happy to help.

Similar Threads

  1. Extract Title Block Attribute Data to Excel
    By bzrqmy in forum AutoCAD Customization
    Replies: 7
    Last Post: 2017-04-26, 06:26 AM
  2. Replies: 2
    Last Post: 2009-06-15, 03:51 AM
  3. Title Block attribute change
    By jerry.smirl in forum AutoLISP
    Replies: 8
    Last Post: 2008-03-24, 03:22 PM
  4. Title Block Attribute Extraction?
    By mcoffman in forum VBA/COM Interop
    Replies: 8
    Last Post: 2006-03-14, 08:18 PM
  5. Creating An Attribute Block For Revision or Title Block
    By fnguyen05 in forum AutoCAD General
    Replies: 2
    Last Post: 2005-12-22, 03:14 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
  •