Toolbar button customization

Discussion in 'AutoCAD' started by ghiggins457, Mar 3, 2004.

  1. ghiggins457

    ghiggins457 Guest

    I am creating a new toolbar with new buttons that will insert a block. I am, however, not quite sure how to write the macros so that the button pulls the right block into the drawing. Does anybody know how to do this?
    Thanks,
    Greg
     
    ghiggins457, Mar 3, 2004
    #1
  2. ghiggins457

    ECCAD Guest

    Greg,
    Sample button macro.

    [outputs(resistor)]^c^c_-insert; "c:/ec/elec/other/resistor";_drag;\1;;;

    Bob
     
    ECCAD, Mar 3, 2004
    #2
  3. ghiggins457

    ghiggins457 Guest

    Bob,
    I did as you say, but it is making me verify scale, rotation, blah blah blah...Is there a way to skip all of that?

    Thanks
    Greg
     
    ghiggins457, Mar 3, 2004
    #3
  4. ghiggins457

    ECCAD Guest

    The macro, as I posted should not ask for rotation, scale, etc.,
    should just drag and insert at 1,1,0. Are you sure that it is asking for scale and rotation ? or is it that the 'block' inserted has attributes that are defined as 'V' for verify ?

    Bob
     
    ECCAD, Mar 3, 2004
    #4
  5. ghiggins457

    ghiggins457 Guest

    Bob,
    As you probably suspected the question on the Verify is for the same blocks that I am trying to insert here. So, will the macro on the other one fix this problem too? Thanks.

    Greg
     
    ghiggins457, Mar 3, 2004
    #5
  6. ghiggins457

    ghiggins457 Guest

    Bob,
    One more thing. Do the blocks need to be put somewhere special. I still can't get them to come in to the drawing. Sometimes they come in, and sometimes they don't. Any suggestions?

    Greg
    (If you would like we can just email back and forth since you seem to be the only one that answers my questions.)
     
    ghiggins457, Mar 3, 2004
    #6
  7. This is a bit better if you are going to do a scaled insert, as it drags at
    scale:

    ^C^C._-Insert;"C:/Temp/MyCoolBlock";_s;(getvar "DimScale");

    or, for a forced rotation of 0 also:

    ^C^C._-Insert;"C:/Temp/MyCoolBlock";_s;(getvar "DimScale");_r;0;


    P.S. Why the exploded block? Did the original poster want that?

    --
    R. Robert Bell


    Something like this:
    ..-insert;*blockname;\(getvar "dimscale");;

    Notes:
    + the asterisk explodes the block upon insertion
    + the (getvar "dimscale") is in response to the scale factor
    + the "\" is a pause so that the user can pick an insertion point



    am, however, not quite sure how to write the macros so that the button pulls
    the right block into the drawing. Does anybody know how to do this?
     
    R. Robert Bell, Mar 3, 2004
    #7
  8. ghiggins457

    ECCAD Guest

    Do the blocks need to be put somewhere special..
    No. But you need the (full path & blockname).
    For example:
    If your block named 'myblock.dwg' is in say,, J:\acad\blocks,
    then,
    -insert;"j:/acad/blocks/myblock".... would insert it from there.

    Notice (2) things. 1). double quote around the formal path & blockname. 2) don't put in the '.dwg' - not needed.

    My E-Mail is:


    Cheers

    Bob Shaw
     
    ECCAD, Mar 3, 2004
    #8
  9. ghiggins457

    ECCAD Guest

    Also,
    note the use of "/" instead of "\" in the path portion.
    IF you would desire, you can do "J:\\acad\\blocks\\" instead,
    either will work.

    Bob
     
    ECCAD, Mar 3, 2004
    #9
  10. Also,
    note the use of "/" instead of "\" in the path portion.
    IF you would desire, you can do "J:\\acad\\blocks\\" instead,
    either will work.

    Not in a menu/toolbar macro. \\ is just two pauses.
     
    R. Robert Bell, Mar 3, 2004
    #10
  11. ghiggins457

    ECCAD Guest

    Even when inclosed in double quotes ?
    Bob
     
    ECCAD, Mar 3, 2004
    #11
  12. ghiggins457

    R.K. McSwain Guest

    No reason, I just picked one from a handy menu file, and thought it would help if I explained what the "*" did.
     
    R.K. McSwain, Mar 4, 2004
    #12
  13. Yes.

    --
    R. Robert Bell


    Even when inclosed in double quotes ?
    Bob
     
    R. Robert Bell, Mar 4, 2004
    #13
  14. Well, it did! <vbg>

    --
    R. Robert Bell


    No reason, I just picked one from a handy menu file, and thought it would
    help if I explained what the "*" did.
     
    R. Robert Bell, Mar 4, 2004
    #14
  15. ghiggins457

    ECCAD Guest

    Robert,
    As usual, you are correct. You would need to do:
    -insert;(strcat "c:\\path\\blockname" "")..
    in order to pass the entire string..DA.
    Bob
     
    ECCAD, Mar 4, 2004
    #15
  16. You can put them in any location that is included in the Support File Search
    Path listing in the Files tab of the Options dialog box. Then it will find
    them without having to include the path in the programming.

    Kent Cooper
    can't get them to come in to the drawing. Sometimes they come in, and
    sometimes they don't. Any suggestions?
     
    Kent Cooper, AIA, Mar 4, 2004
    #16
  17. That won't work either.

    --
    R. Robert Bell


    Robert,
    As usual, you are correct. You would need to do:
    -insert;(strcat "c:\\path\\blockname" "")..
    in order to pass the entire string..DA.
    Bob
     
    R. Robert Bell, Mar 4, 2004
    #17
  18. ghiggins457

    ECCAD Guest

    Robert,
    I'll just stick with the "/path/path/" stuff then.
    Bob
     
    ECCAD, Mar 4, 2004
    #18
  19. Whatever works, right? ;^)


    Robert,
    I'll just stick with the "/path/path/" stuff then.
    Bob
     
    R. Robert Bell, Mar 4, 2004
    #19
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.