I'm working on a small skill program that should only be available during "add connect", but I've not figured out a way to get the active command in skill
Using axlGetCmdSupplementalData() will show "add connect" as the command using pre-selection mode, but if the user selects
Route->Connect then it will return nil as the command. This is also in alignment with the description for axlGetCmdSupplementalData()
But does anyone know if there's a way to get the name of the active command?
I don't believe you can do that. When you are in an interactive command such as Route->Connect you can't run another interactive command or a skill command.
In reply to aCraig:
This is possible, just register the program as "general" - that will coexist with other general and interactive commands.
I've already got my program running nicely, will share the code when I'm back at work tomorrow, so this is possible, I would just like to aboid confusing missing form warnings if executed within another command.
In reply to Ejlersen:
As promised an example to make a command that can be used to change line width during add connect.
axlCmdRegister("ns_clwidth", 'ns_clwidth, ?cmdType "general")
defun( ns_clwidth (clwidth)when(atof(clwidth) axlShell(sprintf(nil "setwindow form.mini;FORM mini acon_line_width %f; setwindow pcb" atof(clwidth)))))
now a funckey can be made like funckey l ns_clwidth
during add connect the user can write "l .1" (remember the space between l and the paramter which in the example is .1) and it will change the line width to 0.1 design units.
if not using l as a funckey for anything a series of shortcuts could be made like
funckey l1 ns_clwidth 0.1
funckey l2 ns_clwidth 0.2
funckey l3 ns_clwidth 0.3
now during add connect press l2 to change the line width to 0.2 design units.
Anyone with any ideas/workarounds to get the active command?
Provided that I know the path to the current jrl file I supposed that could be passed in order to figure out if the last active command is add connect?