Results 1 to 4 of 4

Thread: Block object with attribute text

  1. #1
    Member
    Join Date
    2011-10
    Posts
    3
    Login to Give a bone
    0

    Question Block object with attribute text

    Dear All,
    I have one dwg with 50nos Layout. All Layouts having one type Block( with attribute text) individually. If i am going to edit the DWG No. and Cont.On Values means , it will take too much time.
    What to do ? Is it possible to automatically change the above attribute values.
    Please refer the clouded area in attached file.
    your concern must be appreciated.
    thanks.
    Attached Files Attached Files

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

    Default Re: Block object with attribute text

    Hope this would help you with it ..

    Code:
    (defun c:TesT (/ *error* blk vla value)
    ;;; Tharwat 16. Oct. 2011 ;;;
      (cond ((not acdoc)
             (setq acdoc (vla-get-ActiveDocument (vlax-get-acad-object)))
            )
      )
      (vl-load-com)
      (defun *error* (msg)
        (or (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*")
            (princ (strcat "\n** Error: " msg " **"))
        )
        (princ)
      )
      (if (setq blk (ssget "_+.:s" '((0 . "INSERT") (66 . 1))))
        (progn
          (vla-StartUndoMark acdoc)
          (setq vla (vlax-ename->vla-object (ssname blk 0)))
          (while
            (foreach x (vlax-invoke vla "GetAttributes")
              (if (not
                    (eq
                      (setq value
                             (getstring T
                               (strcat
                                 "\n Enter string to change or " " " "< hit enter to leave the value > : "
                                 "[ " (vla-get-textstring x)" ]" ))) ""
                      )
                    )
                (vla-put-textstring x value)
              )
            )
          )
          (vla-EndUndoMark acdoc)
        )
        (princ)
      )
      (princ)
    )
    Tharwat

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

    Default Re: Block object with attribute text

    Thanks,
    Actually how to work with this attribute values below mentioned. and also i want to do it automatically.
    In that Cluoded Area i want to put continuation sheet no.(Cont.No.). If Sht No.(Sheet No.) value 001, means that continuation Sheet No. value Will be 002. And also last sheet of the drawing i have to put *END* for continuation sheet no. (Cont. On.).
    please refer the attachment

  4. #4
    AUGI Addict
    Join Date
    2008-02
    Posts
    1,141
    Login to Give a bone
    0

    Default Re: Block object with attribute text

    Tharwat, to make your attribute value prompts more complete, you can get the promptstring by stepping through the block's definition (once).

Similar Threads

  1. Replies: 3
    Last Post: 2015-06-26, 04:55 PM
  2. 2010: Dynamic Block Text Attribute
    By FabriCADed in forum Dynamic Blocks - Technical
    Replies: 2
    Last Post: 2013-07-22, 04:19 PM
  3. 2010: Enter attribute values by selecting text object
    By luuk_siemelink339880 in forum AutoCAD General
    Replies: 2
    Last Post: 2011-10-04, 02:52 PM
  4. Block attribute text size is incorrect when the Block is not selected
    By lwhitney.133796 in forum AutoCAD General
    Replies: 3
    Last Post: 2007-02-16, 10:01 PM
  5. mirroring text attribute in dyn. block
    By bjm in forum Dynamic Blocks - Technical
    Replies: 1
    Last Post: 2005-11-01, 03:20 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
  •