button customization -- inserting block

Discussion in 'AutoCAD' started by WILLIE, Jan 16, 2004.

  1. WILLIE

    WILLIE Guest

    I am trying to create a button that will insert a specific block. here is
    what I have so far, keep in mind that this doesn't work.



    ^C^C_INSERT \slope;



    I want to insert the block that is already in the drawing. This block is
    called slope. I will jsut change the m\name of the block for different
    needs once the button is working. In this case teh block is called slope I
    don't want to have to enter the rotation angle or the scale. I want it to
    skip ahead and ask for the insertion point and then wala the block is
    inserted. Any help would be appreciated.
     
    WILLIE, Jan 16, 2004
    #1
  2. WILLIE

    ECCAD Guest

    To insert in (0) rotation and scale at 1=1:
    ^c^c_insert;scale;\1;1;0;


    Bob
     
    ECCAD, Jan 16, 2004
    #2
  3. WILLIE

    ECCAD Guest

    ^c^c_insert;slope;\1;1;0;
    (had scale, rather than slope)..
     
    ECCAD, Jan 16, 2004
    #3
  4. WILLIE

    WILLIE Guest

    this doesn't do it bob. I am trying to have it initiate the insert command
    and then choose the block "slope" and then just ask me for an insertion
    point. the block slope isn't in your button text.
     
    WILLIE, Jan 16, 2004
    #4
  5. WILLIE

    ECCAD Guest

    ^c^c_insert;slope;_drag;\1;;;
    Will drag your block and insert it.
    Bob
     
    ECCAD, Jan 16, 2004
    #5
  6. WILLIE

    WILLIE Guest

    this still isn't working. I am using autocad 2002 with land desktop and
    civil design. I appreciate your help, the only thing that happens when I
    click on the button is it opens the insert dialogue box.
     
    WILLIE, Jan 16, 2004
    #6
  7. WILLIE

    ECCAD Guest

    Ok,
    Do this one then.
    ^c^c(command "_-insert" "slope" pause "" "" "");
    rather than:
    ^c^c_insert;slope;_drag;\1;;;
    Bob
     
    ECCAD, Jan 16, 2004
    #7
  8. WILLIE

    WILLIE Guest

    here is what I have come up with thanks to your help.

    ^C^C-insert;slope;ps;10;10\;10;

    this inserts the block at the desired scale "10" and then lets me choose a
    rotation angle. If I could get the button to insert the block at the scale
    of the drawing then I would be really excited. Where do you find
    information on syntax for writing button commands? Do you have a list of
    operators and their uses that I could see? Your first few buttons were
    using the _insert instead of the -insert. Thank you for your help so far
    and any help to come in the future.
     
    WILLIE, Jan 16, 2004
    #8
  9. By the "scale of the drawing" do you mean the current DimScale?

    ^C^C._-Insert;Slope;_s;(getvar "DimScale")

    BTW, don't use the preset scale option, use the scale option as I did above.
    For more information on customizing menu macros, look in the Customization
    Guide in the Developer's help.


    --
    R. Robert Bell, MCSE
    www.AcadX.com


    | here is what I have come up with thanks to your help.
    |
    | ^C^C-insert;slope;ps;10;10\;10;
    |
    | this inserts the block at the desired scale "10" and then lets me choose a
    | rotation angle. If I could get the button to insert the block at the
    scale
    | of the drawing then I would be really excited. Where do you find
    | information on syntax for writing button commands? Do you have a list of
    | operators and their uses that I could see? Your first few buttons were
    | using the _insert instead of the -insert. Thank you for your help so far
    | and any help to come in the future.
    |
    |
    | | > Ok,
    | > Do this one then.
    | > ^c^c(command "_-insert" "slope" pause "" "" "");
    | > rather than:
    | > ^c^c_insert;slope;_drag;\1;;;
    | > Bob
    |
    |
     
    R. Robert Bell, Jan 17, 2004
    #9
  10. This is all on one line
    [_Button("SquareOpenCircleSolid", "SOCS.bmp",
    "SOCS1.bmp")]^C^C-la;m;E-SURVEY-FOUND;co;164;;;-insert;SURVEY/socs;\(* 12
    (getvar "dimscale"));;

    1. creates or sets current E-SURVEY-CONTROL with color 164
    2, inserts a block socs.dwg at 12 times the dimscale

    More examples here:
    http://www.thegrafixshop.com/civildrafter/administration/mcustom.htm

    KRK
     
    Kevin R. Knox, Jan 18, 2004
    #10
  11. WILLIE

    WILLIE Guest

    I was wanting to set the scale to the current drawing scale. I use land
    development desktop and their is a drawing scale that can be changed. I
    would like the block to come in at the drawing scale. the dim scale might
    work though I'll give it a try. thanks everyone for your help.

    willie


     
    WILLIE, Jan 19, 2004
    #11
  12. WILLIE

    WILLIE Guest

    If I insert the scale as I did in my button code then I can see the block as
    I rotate it into the angle that I desire. with your I can't see the block.
    This isn't a big deal, but it is a nice feature.
     
    WILLIE, Jan 19, 2004
    #12
  13. Did you try it? Mine uses the Scale option to set the scale of the block
    _before_ the insertion point is picked. It displays the scaled block, let's
    you pick the insertion point, and rotation angle.

    --
    R. Robert Bell, MCSE
    www.AcadX.com


    | If I insert the scale as I did in my button code then I can see the block
    as
    | I rotate it into the angle that I desire. with your I can't see the
    block.
    | This isn't a big deal, but it is a nice feature.
    |
    | | > By the "scale of the drawing" do you mean the current DimScale?
    | >
    | > ^C^C._-Insert;Slope;_s;(getvar "DimScale")
    | >
    | > BTW, don't use the preset scale option, use the scale option as I did
    | above.
    | > For more information on customizing menu macros, look in the
    Customization
    | > Guide in the Developer's help.
    | >
    | >
     
    R. Robert Bell, Jan 20, 2004
    #13
  14. How is that scale stored? I don't have LDD to check.

    --
    R. Robert Bell, MCSE
    www.AcadX.com


    | I was wanting to set the scale to the current drawing scale. I use land
    | development desktop and their is a drawing scale that can be changed. I
    | would like the block to come in at the drawing scale. the dim scale might
    | work though I'll give it a try. thanks everyone for your help.
    |
    | willie
    |
    |
    | | > This is all on one line
    | > [_Button("SquareOpenCircleSolid", "SOCS.bmp",
    | > "SOCS1.bmp")]^C^C-la;m;E-SURVEY-FOUND;co;164;;;-insert;SURVEY/socs;\(*
    12
    | > (getvar "dimscale"));;
    | >
    | > 1. creates or sets current E-SURVEY-CONTROL with color 164
    | > 2, inserts a block socs.dwg at 12 times the dimscale
    | >
    | > More examples here:
    | > http://www.thegrafixshop.com/civildrafter/administration/mcustom.htm
    | >
    | > KRK
    | >
    | >
    | >
    | > | > > By the "scale of the drawing" do you mean the current DimScale?
    | > >
    | > > ^C^C._-Insert;Slope;_s;(getvar "DimScale")
    | > >
    | > > BTW, don't use the preset scale option, use the scale option as I did
    | > above.
    | > > For more information on customizing menu macros, look in the
    | Customization
    | > > Guide in the Developer's help.
    | > >
    | > >
    | > > --
    | > > R. Robert Bell, MCSE
    | > > www.AcadX.com
    | > >
    | > >
    | > > | > > | here is what I have come up with thanks to your help.
    | > > |
    | > > | ^C^C-insert;slope;ps;10;10\;10;
    | > > |
    | > > | this inserts the block at the desired scale "10" and then lets me
    | choose
    | > a
    | > > | rotation angle. If I could get the button to insert the block at
    the
    | > > scale
    | > > | of the drawing then I would be really excited. Where do you find
    | > > | information on syntax for writing button commands? Do you have a
    list
    | > of
    | > > | operators and their uses that I could see? Your first few buttons
    | were
    | > > | using the _insert instead of the -insert. Thank you for your help
    so
    | > far
    | > > | and any help to come in the future.
    | > > |
    | > > |
    | > > | | > > | > Ok,
    | > > | > Do this one then.
    | > > | > ^c^c(command "_-insert" "slope" pause "" "" "");
    | > > | > rather than:
    | > > | > ^c^c_insert;slope;_drag;\1;;;
    | > > | > Bob
    | > > |
    | > > |
    | > >
    | > >
    | >
    | >
    |
    |
     
    R. Robert Bell, Jan 20, 2004
    #14
  15. WILLIE

    WILLIE Guest

    I thought I was posting to the last guy when I posted to you. Sorry about
    the confusion, your button code works perfectly. where can I get a list of
    operators for the button commands. e.g.. (getvar "DimScale")
    Is their a library of commands or what?
    any help would be appreciated.
    TIA
     
    WILLIE, Jan 20, 2004
    #15
  16. That (getvar ...) is a Visual LISP (AutoLISP) expression. There are lots of
    docs in the Developer's Guide under <F1>.

    --
    R. Robert Bell, MCSE
    www.AcadX.com


    | I thought I was posting to the last guy when I posted to you. Sorry about
    | the confusion, your button code works perfectly. where can I get a list
    of
    | operators for the button commands. e.g.. (getvar "DimScale")
    | Is their a library of commands or what?
    | any help would be appreciated.
    | TIA
    |
    |
     
    R. Robert Bell, Jan 20, 2004
    #16
  17. WILLIE

    ECCAD Guest

    Willie,
    You can see a 'list' of system variables by typing:
    setvar
    ?
    *

    at the Command: prompt.
    All of the var's can be read into local variable(s);
    like:
    (setq LP (getvar "LASTPOINT")); sets LP to value of Lastpoint
    (setq DS (getvar "DIMSCALE")); sets DS to value of Dimscale
    Some cannot be 'set' - those with (read only) markings.
    Like CDATE, or such.
    Do Help: AutoLisp, Commands for on-line help.
    Bob
     
    ECCAD, Jan 20, 2004
    #17
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.