Insert block with attribute button macro

Discussion in 'AutoCAD' started by LynnG, Jan 28, 2005.

  1. LynnG

    LynnG Guest

    I have a toolbar button that inserts a block containing an attribute. This block is used continually but has different values for the attribute text. What do I need to do in the toolbar button macro to automatically enter the attribute text value instead having the dialog box pop-up for the entry?

    ^C^C-layer s EFIRE ^C^C-insert "sqr1=";\\\\^C^Ca0
     
    LynnG, Jan 28, 2005
    #1
  2. LynnG

    Jim Claypool Guest

    ^C^C-layer s EFIRE ^C^C-insert sqr1=
     
    Jim Claypool, Jan 28, 2005
    #2
  3. Lynn,
    you have to diasble diabox
    (setvar "attdia" 0)(command "insert" "bl_name" "0,0" "1" "1" "0"
    "att_value")
    insertion point, scale or rotation you can substitute by pause
    Ursus Uziemblo
    ps afer it good idea to reset attdia to previous state
    uu
     
    Ursus Uziemblo, Jan 28, 2005
    #3
  4. Or macro:
    ^C^Cattdia 0 -insert dd \1 1 0 3;attdia 1
    where you can modify att_value and/or point & scale
    uu
     
    Ursus Uziemblo, Jan 28, 2005
    #4
  5. LynnG

    OLD-CADaver Guest

    Also, you don't need the second set of ^C^C, and extra space or semicolon works just fine to close the layer command.

    Instead of:
    ^C^C-layer s EFIRE ^C^C-insert sqr1=

    try:
    ^C^C-layer s EFIRE;;-insert sqr1=
     
    OLD-CADaver, Jan 28, 2005
    #5
  6. LynnG

    Jim Claypool Guest

    But it will work either way.
     
    Jim Claypool, Jan 28, 2005
    #6
  7. LynnG

    OLD-CADaver Guest

    That's actually a rather new feature. In the past "canceling" the layer command would also cancel any changes made during the command. I'm not sure if all the other commands will function properly if not properly exited, so I would suggest leaving the command with an "enter" (space or semi-coln) rather than two cancels.

    As a side benefit a single space or semi-colon is a lot less typing than ^c^c.
     
    OLD-CADaver, Jan 28, 2005
    #7
  8. LynnG

    Jim Claypool Guest

    I agree, I was just modifying what he had already done. I tested it and it
    worked so I left it alone.
     
    Jim Claypool, Jan 29, 2005
    #8
  9. LynnG

    LynnG Guest

    Thanx to all for their input.

    Here is what I used:
    ^C^C-layer s EAUXL;;attdia 0 -insert "cir1=";\\\ H;attdia 1^C^Ca0

    Where cir1 is the block and H is the attribute value. However, I am not getting a prompt for the rotation of the block.

    I had to use the second set of ^C^C for a lisp routine at the end (it rotates the attribute to 0 degrees); tried using (2) ;'s but it would not execute.
     
    LynnG, Jan 31, 2005
    #9
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.