+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Senior Member
    Using
    AutoCAD 2009
    Join Date
    Mar 2007
    Posts
    475

    Question how can i make 2 commands happen with one click of a toolbar button??

    Registered forum members do not see this ad.

    i need to change the macro in the CUI so that when i click on a button in the toolbar it runs a command prior to the command i want to call up.

  2. #2
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Windows 7 Ultimate (32-bit)
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2013
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    15,816

    Default

    You could call the command and add a line of pauses until the next command, in LISP it looks like this:

    Code:
    (command....)
    (while (> (getvar "cmdactive") 0) (command pause))
    (command....)
    Lee Mac Programming

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

    Just another Swamper

  3. #3
    Senior Member brawleyman's Avatar
    Computer Details
    brawleyman's Computer Details
    Operating System:
    Windows 7
    Computer:
    Dell Precision T3500
    CPU:
    Intel Xeon W3530 (4x2.8Ghz)
    RAM:
    6Gb DDR3
    Graphics:
    Nvidia Quadro 600
    Primary Storage:
    250Gb
    Monitor:
    Asus 20" 1680x1050, Samsung 24" 1920x1080
    Using
    AutoCAD 2010
    Join Date
    Oct 2008
    Location
    Bentonville, AR
    Posts
    100

    Default

    Registered forum members do not see this ad.

    Macro is where I first started in customizing commands, then I moved up to working in LISP (which I am still having a hard time working with). I created several custom macro's that contained over 10 commands in a single button click!

    What commands are you wanting to combine? First, create a new command or copy the command that will be first in your macro. Set up the macro for the first command to do what you want, then at the end, put in ";" which acts like when you type enter which ends the first command, then ^C^C and the name of the second command you want.

    Afterwards, you can create a custom icon or button image for your custom macro. Just remember, you never want to mess with the original macro commands, just copy and manipulate it that way.

    ***EDIT***
    I forgot, when you have more than one command in a macro, if you choose to do it that way, use "+" after the last ";" and before ^C^C. Here is an example:

    ^C^Cselect;\pedit;m;previous;;j;j;a;12";+^C^Cfille t;p;last;
    Guess what? I got a fever! And the only prescription.. is more Cad Lines!

Similar Threads

  1. Flyout toolbar auto open (no mouse click)
    By sloman in forum AutoCAD Beginners' Area
    Replies: 1
    Last Post: 10th Dec 2007, 07:23 am
  2. make ESC key a toolbar button
    By autoadam in forum Tutorials & Tips'n'Tricks
    Replies: 2
    Last Post: 20th Mar 2007, 03:14 am
  3. a toolbar button for an SQL request...
    By najd in forum AutoLISP, Visual LISP & DCL
    Replies: 4
    Last Post: 25th Jul 2006, 09:13 am
  4. Button Commands
    By Teeds in forum AutoLISP, Visual LISP & DCL
    Replies: 5
    Last Post: 16th Aug 2005, 04:05 pm
  5. How to make this custom toolbar button?
    By Cadastrophic in forum AutoLISP, Visual LISP & DCL
    Replies: 3
    Last Post: 30th Oct 2004, 01:23 am

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts