Assign a task to a button

Assign a task to a button

Anonymous
Not applicable
964 Views
6 Replies
Message 1 of 7

Assign a task to a button

Anonymous
Not applicable

Hello, Forum,

 

I have managed to create a button and even put it among the other buttons on my Autocad, but still I cannot assign a task to it. The button is easy to create:

 

type "cui"->

create new command->

edit to draw the icon->

save->

put the 

ok->

right click on the buttons->

customize->

find your button->

drag and drop it

 

How can I assign an activity to my newly created button? If it is needed to mention, I want to make a button that generates a table, so this is the task, that I want to assign to this button.

 

Best regards!

0 Likes
Accepted solutions (3)
965 Views
6 Replies
Replies (6)
Message 2 of 7

Ed__Jobe
Mentor
Mentor

In the CUI, down below where you edited your button, there is a Macro property. This is the macro for the TABLE command: "^C^C_table ". "^C" performs a {Cancel} and the space at the end performs and {Enter}.

Ed


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.
How to post your code.

EESignature

Message 3 of 7

Kent1Cooper
Consultant
Consultant

If it's a Tool Palette  button, you can just right-click on the button itself, and pick Properties, where there's a line for macro code.

Kent Cooper, AIA
Message 4 of 7

Anonymous
Not applicable

@Ed__Jobe @Kent1Cooper you for your effort to resolve my issue. Your solutions are really helpful, but I didn't express my problem accurately enough. I want to create a specific table, with pre-given cells, rows, and values of the cell.

0 Likes
Message 5 of 7

pendean
Community Legend
Community Legend
Accepted solution
>>>...I want to create a specific table, with pre-given cells, rows, and values of the cell....<<<
Create the table.
Turn it into a block with BLOCK command, or WBLOCK to an external block.
Then use INSERT command (followed by EXPLODE) to use in in other files.
Message 6 of 7

gotphish001
Advisor
Advisor
Accepted solution

Could you use the manage>record to do all the steps for the table settings to set the table up and then make that macro the button? 

 

Edit: Didn't see dean's post until after I posted. You could definitely record a macro that inserted the table block then exploded it. Then you could just set it up so you type the name of the table and it's inserted.



Nick DiPietro
Cad Manager/Monkey

Message 7 of 7

Anonymous
Not applicable
Accepted solution

@gotphish001 and @pendean, thank you for your efforts to answer my question. It is what you suggested and additionally I made some extra stuff to solve my problem. Kudoed and accepted as a solution. The rest of my solution is to add in the macro section:

 

 

*^C^C_-insert;BlockName;\;;\

 

If exploding it is afterwards needed (like in my case, but I realized it after I made the button in the above manner), there is the code that explodes the inserted block, in my case a pre-determined table:

 

 

^C^C^P(setvar"ATTREQ" 0) (command "_.INSERT" "*drawing" pause 1.0 0.0)(setvar "ATTREQ" 1)

 

Source for the last one:

 

https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/exploding-blocks-on-insert/m-p/60578...

0 Likes