Home > Community > Forums > PCB SKILL > getting the active command

Email

* Required Fields

Recipients email * (separate multiple addresses with commas)

Your name *

Your email *

Message *

Contact Us

* Required Fields
First Name *

Last Name *

Email *

Company / Institution *

Comments: *

 getting the active command 

Last post Tue, May 21 2013 8:02 AM by Ejlersen. 4 replies.
Started by Ejlersen 15 May 2013 10:49 PM. Topic has 4 replies and 772 views
Page 1 of 1 (5 items)
Sort Posts:
  • Wed, May 15 2013 10:49 PM

    • Ejlersen
    • Top 10 Contributor
    • Joined on Mon, Jul 28 2008
    • Aalborg, Copenhagen
    • Posts 569
    • Points 9,965
    getting the active command Reply

    Hi

    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?

    Best regards

    Ole

    Best regards Ole
    • Post Points: 20
  • Thu, May 16 2013 6:17 AM

    • aCraig
    • Top 50 Contributor
    • Joined on Sat, Aug 16 2008
    • Pepperell, MA
    • Posts 132
    • Points 2,070
    Re: getting the active command Reply

    Ole,

    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.

     Craig

    • Post Points: 20
  • Thu, May 16 2013 10:08 AM

    • Ejlersen
    • Top 10 Contributor
    • Joined on Mon, Jul 28 2008
    • Aalborg, Copenhagen
    • Posts 569
    • Points 9,965
    Re: getting the active command Reply

    Hi Craig

    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.

     Best regards

    Ole

    Best regards Ole
    • Post Points: 5
  • Fri, May 17 2013 2:03 AM

    • Ejlersen
    • Top 10 Contributor
    • Joined on Mon, Jul 28 2008
    • Aalborg, Copenhagen
    • Posts 569
    • Points 9,965
    Re: getting the active command Reply

    Hi

    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.

    Best regards

    Ole

    Best regards Ole
    • Post Points: 5
  • Tue, May 21 2013 8:02 AM

    • Ejlersen
    • Top 10 Contributor
    • Joined on Mon, Jul 28 2008
    • Aalborg, Copenhagen
    • Posts 569
    • Points 9,965
    Re: getting the active command Reply

    Hi

    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?

    Best regards

    Ole

    Best regards Ole
    • Post Points: 5
Page 1 of 1 (5 items)
Sort Posts:
Started by Ejlersen at 15 May 2013 10:49 PM. Topic has 4 replies.