HotKey in a Macro ?


Joe_Carrick
 Share

Recommended Posts

No, the F5 hotkey will just refresh the view, not the Global Variables

 

Most of my new macros are using a hash so the elements are named (layer name).  I'm also using a timer so that the hash is recreated after a few seconds.  This ensures that the Global data is current.  That happens whenever the screen is refreshed by a Pan/Zoom or F5.

Link to comment
Share on other sites

20 minutes ago, Joe_Carrick said:

After thinking about this, I don't think it would work anyway.  If the macro isn't executed by a screen refresh, the Hotkey wouldn't be produced, so it's not going to work as I wished.

Exactly -- But also exactly one of the reasons for asking for the ability to tie macro(s) execution to a icon similar to the "place library feature" or to a custom menu. -- One click -- one execution.

 

This has a couple of benefits:

1. you can control the sequence of execution.

2. The program isn't bogged down with unnecessary executions.

3. per a previous request, if a macro could insert into the keyboard buffer, one could mimic all of the hotkeys and therefore most of Chief's commands. Add in mouse control and number/text input and you have a rudimentary SDK.

 

I doubt that it will ever happen. As to a screen refresh- I found that all that is needed is to wiggle the scroll button to slightly zoom in/out -- All ways works. I expect you know that.

I agree that execution of macros which are only tied to labels and/or text is a poor and burdensome scheme but WHOSE LISTENING - not Chief?

Link to comment
Share on other sites

This discussion reminds me of the scripting language that Generic CAD had way back when.

It basically used the hot keys (or the native command) strung together along with operands to create very powerful scripts including things like user input. eg:

; Separates the commands in a script. Scripts must end with a semi-colon (;) as well.

@ Tells Visual CADD to wait for you to type the coordinates of a point or for a click on the drawing screen.

@@ Tells Visual CADD to wait for a Pen Up command to finish a continuous tool before moving to the next command.

$ Retrieves the current value of the variable it precedes.

=;@ Matches the entity you select.

UIoff Closes the specified speed bar.

UIon Opens the specified speed bar.

exename; <path to external application>; run;  Tells Visual CADD to run an external application from within Visual CADD.

dllname;<dll filename>; dllfunname;<functionname within the dll>;dllrun; Runs a function defined in a .dll file.

NOTE: Scripts never contain quotation marks (“).

 

You could do things like this:

CS;SX;@;@;CO; Copies objects you first select using a crossing window.

MulLineStyle;1;MultiLine; Sets the Style to 1 and starts the MultiLine command.

SYMROT;$SYMROT+15; Sets Symbol angle to 15° more than current angle.

CS;SB;@;LE;NP; Prompts to select a leader and flips the text of the Leader.

TextRot;=;TL;@; Sets text angle to the angle of an object you pick in the drawing and then starts the Text Line command.

SetLayer;3;SetColor;12;SetType; 6;SetWidth;1;

Sets the properties for layer, color, linetype and linewidth. The next object you draw will take on these properties.

 

Each one of these scripts can then be assigned to it's own shortcut, toolbar or menu item.

 

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
 Share