Multiple Identical Attributes in Title Block - too much typing!

Discussion in 'AutoCAD' started by Doug, Jan 6, 2005.

  1. Doug

    Doug Guest

    The office where I work uses a title block that has the drawing number and
    revision level in three separate places around the drawing (top, side, and
    bottom). When we insert the title block or change revision level, we have
    to type the same data three times.
    Is there a way to have one "instance" of a text entry, whether as a block
    attribute or something else, appear on the drawing in multiple places? I
    see it as a bit like having formulas in a spreadsheet, copying data from one
    place to another. Maybe RTEXT in attributes? Hmmm, never tried that. I'll
    check it today.

    DougVL
     
    Doug, Jan 6, 2005
    #1
  2. I don't know about attribute-wise, but if those were plain inserted Blocks
    consisting of the appropriate text, REFEDIT on one of them would change them
    all.
     
    Kent Cooper, AIA, Jan 6, 2005
    #2
  3. Doug

    Matt W Guest

    Have you looked at FIELDs??
     
    Matt W, Jan 6, 2005
    #3
  4. Doug

    LARRY Guest

    If you using acad 2005 you could put fields
    in 3 of the attributes and they would be controlled by the fourth.
     
    LARRY, Jan 6, 2005
    #4
  5. Doug

    Doug Guest

    It's 3 attributes all in the same block, but with different tags (top, side,
    bottom).

    Doug
     
    Doug, Jan 6, 2005
    #5
  6. Doug

    Doug Guest

    I should have said A2004.
    No FIELDS available, unfortunately.

    DougVL
     
    Doug, Jan 6, 2005
    #6
  7. Doug

    T.Willey Guest

    You can set up a routine that will put the information in all the correct places.

    Tim
     
    T.Willey, Jan 6, 2005
    #7
  8. If Fields are not available, then try this. Place the text/attribute in
    model space, then use three viewports in paper space to view it. You can
    use Dview/Twist to rotate the viewports if necessary. Now it appears as
    three separate pieces of text, but is actually one. Would this work?
     
    Daniel J. Altamura, R.A., Jan 6, 2005
    #8
  9. Doug

    Doug Guest

    I sure don't think so. That one's hard for me to imagine.

    The block is a combination title block and border for a D size drawing. I
    has about a dozen attributes, including three each for REV LEVEL, SHEET
    NUMBER, and DRAWING NUMBER. Those three items show up at the top of the
    sheet, across the end, and in the main title block in the lower right hand
    corner. A couple of dozen other people also use the same title block, so I
    can't change the block itself.

    I'm just looking for a way to avoid typing the REV LEVEL data 3 times, for
    example, when updating a drawing. And avoid having to enter the values for
    all three "boxes" three times each when inserting a new title block.

    Doug
     
    Doug, Jan 6, 2005
    #9
  10. Doug

    OLD-CADaver Guest

    << I'm just looking for a way to avoid typing the REV LEVEL data 3 times, for example, when updating a drawing. And avoid having to enter the values for all three "boxes" three times each when inserting a new title block. >>


    Try here: http://tinyurl.com/6vk4k
    and Download GATTE.DVB

    Put it on a button in your custom toolbars.
    ^C^C-VBARUN gatte.dvb!gatte.module1.Run_gatte
     
    OLD-CADaver, Jan 6, 2005
    #10
  11. Doug

    RichardG Guest

    Here's another approach:
    -Attedit
    it has a type of search and replace for attributes
    if all 3 of the tags have the same initial value then this will make it easy
    Richard
     
    RichardG, Jan 6, 2005
    #11
  12. Doug

    T.Willey Guest

    See if this will work for you. It is a dialog version, and it seems to work here.

    Tim

    ps. Just change the attached file extension from txt to dcl.

    (defun c:CopyAttValue (/ Ent Obj AttList DiaLoad MasterAtt ChangeAtts)

    (command "_.undo" "_end")
    (command "_.undo" "_group")
    (if (setq Ent (entsel "\n Select block:"))
    (progn
    (setq Obj (vlax-ename->vla-object (car Ent)))
    (setq AttList (tmw:Var->Safe (vla-GetAttributes Obj)))
    (setq AttList (vl-sort AttList '(lambda (a b) (< (vla-get-TagString a) (vla-get-TagString b)))))
    (setq DiaLoad (load_dialog "CopyAtt.dcl"))
    (if (not (new_dialog "CopyAtt" DiaLoad))
    (exit)
    )
    (start_list "MasterList" 3)
    (mapcar '(lambda (x) (add_list (vla-get-TagString x))) AttList)
    (end_list)
    (action_tile "MasterList" "(if (= $reason 4) (ChangeLists (get_tile \"MasterList\")))")
    (action_tile "CopyFrom" "(if (= $reason 4) (sub-Remove (get_tile \"CopyFrom\") \"\"))")
    (action_tile "CopyTo" "(if (= $reason 4) (sub-Remove \"\" (get_tile \"CopyTo\")))")
    (action_tile "Add" "(ChangeLists (get_tile \"MasterList\"))")
    (action_tile "Remove"
    "(progn
    (setq testCpFrom (get_tile \"CopyFrom\"))
    (setq testCpTo (get_tile \"CopyTo\"))
    (sub-Remove testCpFrom testCpTo)
    )"
    )
    (action_tile "Apply" "(UpdateAttributes)")
    (action_tile "Accept"
    "(progn
    (UpdateAttributes)
    (done_dialog 1)
    )"
    )
    (action_tile "Cancel" "(done_dialog 0)")
    (start_dialog)
    )
    )
    (command "_.undo" "_end")
    (princ)
    )

    ;----------------------------------------------------------------------------------

    (defun ChangeLists (IndexNum / Att2Move)

    (setq Att2Move (nth (atoi IndexNum) AttList))
    (setq AttList (vl-remove Att2Move AttList))
    (if MasterAtt
    (progn
    (setq ChangeAtts (cons Att2Move ChangeAtts))
    (start_list "CopyTo" 3)
    (mapcar '(lambda (x) (add_list (vla-get-TagString x))) ChangeAtts)
    (end_list)
    )
    (progn
    (setq MasterAtt Att2Move)
    (start_list "CopyFrom" 3)
    (add_list (vla-get-TagString MasterAtt))
    (end_list)
    )
    )
    (start_list "MasterList" 3)
    (mapcar '(lambda (x) (add_list (vla-get-TagString x))) AttList)
    (end_list)
    (start_list "CopyTo" 3)
    (mapcar '(lambda (x) (add_list (vla-get-TagString x))) ChangeAtts)
    (end_list)
    )

    ;--------------------------------------------------------------------------------

    (defun UpdateAttributes (/ AttValue)

    (if MasterAtt
    (progn
    (setq AttValue (vla-get-TextString MasterAtt))
    (foreach item ChangeAtts
    (vla-put-TextString item AttValue)
    )
    (start_list "CopyFrom" 3)
    (end_list)
    (start_list "copyTo" 3)
    (end_list)
    (setq MasterAtt nil)
    (setq ChangeAtts nil)
    )
    )
    )

    ;---------------------------------------------------------------------------------

    (defun sub-Remove (CpFromVal CpToVal / temp1 cnt1 RmList)

    (cond
    ((and MasterAtt (/= CpFromVal ""))
    (setq AttList (cons MasterAtt Attlist))
    (start_list "CopyFrom" 3)
    (end_list)
    (setq MasterAtt nil)
    )
    ((and ChangeAtts (> (length ChangeAtts) 0) (/= CpToVal ""))
    (setq RmList (read (strcat "(" CpToVal ")")))
    (foreach item RmList
    (setq AttList (cons (nth item ChangeAtts) Attlist))
    )
    (setq cnt1 0)
    (while (< cnt1 (length ChangeAtts))
    (if (not (member cnt1 RmList))
    (setq temp1 (cons (nth cnt1 ChangeAtts) temp1))
    )
    (setq cnt1 (1+ cnt1))
    )
    (setq ChangeAtts (reverse temp1))
    (if ChangeAtts
    (progn
    (start_list "CopyTo" 3)
    (mapcar '(lambda (x) (add_list (vla-get-TagString x))) ChangeAtts)
    (end_list)
    )
    (progn
    (start_list "CopyTo" 3)
    (end_list)
    )
    )
    )
    )
    (setq AttList (vl-sort AttList '(lambda (a b) (< (vla-get-TagString a) (vla-get-TagString b)))))
    (start_list "MasterList" 3)
    (mapcar '(lambda (x) (add_list (vla-get-TagString x))) AttList)
    (end_list)
    )

    ;------------------------------------------------------------------

    (defun tmw:Var->Safe (VariantValue /)

    (if (= (type VariantValue) 'variant)
    (safearray-value (variant-value VariantValue))
    )
    )
     
    T.Willey, Jan 6, 2005
    #12
  13. Doug

    GaryDF Guest

    Nothing shows up in the dialog box....where are the values?

    Gary
     
    GaryDF, Jan 6, 2005
    #13
  14. Doug

    GaryDF Guest

    Never mind....got it to work...my bad.

    Gary

     
    GaryDF, Jan 6, 2005
    #14
  15. Doug

    T.Willey Guest

    Once you select a block, it read the attributes... oh.. maybe add a (vl-load-com). But it is supposed to read the attributes from the block, then it popultes the left side with all the tag names for the block. If it doesn't work for you still, maybe post the block, and I will see what is wrong.

    Tim
     
    T.Willey, Jan 6, 2005
    #15
  16. Doug

    GaryDF Guest

    Works fine, I was selecting an xref file when I tested it....before....without
    knowing it

    Gary

    (vl-load-com). But it is supposed to read the attributes from the block, then it
    popultes the left side with all the tag names for the block. If it doesn't work
    for you still, maybe post the block, and I will see what is wrong.
     
    GaryDF, Jan 6, 2005
    #16
  17. Doug

    T.Willey Guest

    I guess I could put some tests into it, but don't have as much time for it as I would like, so I put it out as is.

    Tim
     
    T.Willey, Jan 6, 2005
    #17
  18. Doug

    Doug Guest

    I tried it but couldn't load it, either by "dragging" it in like I can with
    LSP, or by using Tools, Load Application.

    Doug
     
    Doug, Jan 7, 2005
    #18
  19. Doug

    OLD-CADaver Guest

    What are you're trying to do that GATTE from express tools won't do??
     
    OLD-CADaver, Jan 7, 2005
    #19
  20. Doug

    Adam Dew Guest

    I xref my title block info, except for the data which is pertinent only to
    that sheet...
     
    Adam Dew, Jan 7, 2005
    #20
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.