Home
  • Products
  • Solutions
  • Support
  • Company
  • Products
  • Solutions
  • Support
  • Company
Community PCB Design Allegro PCB Editor and PCB SKILL Searching for undocumented commands/symbols

Stats

  • Replies 3
  • Subscribers 149
  • Views 25729
  • Members are here 0
More Content

Searching for undocumented commands/symbols

eDave
eDave over 12 years ago
Generally undocumented commands are risky to use - they may (and often do) disappear between releases. If you do find one that you regard as being necessary you should raise an enhancement request to get it made "public". Of course, because they are undocumented, you will have to guess the command syntax. Easy for some commands but not others. However, using the command: arglist usually helps. The trick for finding them is to search the symbols used in the lisp symbol list: oblist. This code is useful for seaching for axl commands: defun( AxlSearch (txt @optional caseSensitive) let(((chktxt "")) if(caseSensitive then chktxt = txt else foreach(ch, parseString(txt, ""), chktxt = strcat(chktxt, "[", lowerCase(ch), upperCase(ch), "]"))) setof(n, rexMatchList(strcat("axl.*", chktxt, ".*"), oblist), isCallable(n)); oblist is a system variable )) eg: AxlSearch("gridget") => (axlFormGridGetCell axlDBGridGet) arglist('axlDBGridGet) => (g_general "g")
  • Reply
  • Cancel
  • Cancel
  • aCraig
    aCraig over 12 years ago

    Another useful command for searching for SKILL commands in general (even what you've wrote) is:

    listFunctions(  t_pattern  )

    t_pattern is similar to rexCompile

    Craig

    • Cancel
    • Up 0 Down
    • Reply
    • Cancel
  • EvanShultz
    EvanShultz over 12 years ago

     Very interesting! Thanks guys!

     

    I expanded a bit on what you sent, Dave, and included Craig's code to get:

    ; Courtesy of Dave Elder and Craig Lewis at http://www.cadence.com/community/forums/T/15760.aspx
    ; Find functions containing keyword passed as argument, e.g. AxlSearch("Shape") or AxlSearch("") for all functions
    ; use arglist() to find arguments of function, e.g. arglist('axlDBCreateOpenShape)
    procedure(AxlSearch(txt @optional caseSensitive)
        let(((chktxt "") funcFile)
            if(caseSensitive then chktxt = txt
            else
                foreach(ch parseString(txt "")
                    chktxt = strcat(chktxt "[" lowerCase(ch) upperCase(ch) "]")
                )
            )
            funcFile = axlDMOpenFile("ALLEGRO_REPORT" "funcList" "w")
            fprintf(funcFile "Complete list of Allegro functions in %s\n" axlVersion('fullVersion))
            foreach(func listFunctions(chktxt) fprintf(funcFile "%L\n" func))
            axlDMClose(funcFile)
            setof(n rexMatchList(strcat("axl.*" chktxt ".*") oblist), isCallable(n)); oblist is a system variable
        )
    )

    There are certainly other ways to get functions that what I put above, but this is what I want becuse in addition to returning functions to the Command Window, a funcList.rpt file will be written which works well for comparison with the function list files included in the SKILL documentation like $CDSROOT\share\pcb\examples\skill\DOC\16.3.txt. I can easily find undocumented AXL functions by comparing (using diff file comparison) 16.3.txt with the funcList.rpt created when running AxlSearch("axl").

     

    Using them I discovered axlCursorGet and axlCursorWarp. Seems interesting, although this issue is apparently resolved thanks to the brilliant code http://www.cadence.com/community/forums/T/13997.aspx. Nonetheless, let's use it as an example. If I enter arglist('axlCursorWarp) into the Command Window, I get (g_general g_general "gg"). I assume this means there are 2 arguments: the first is t/nil and the other is a text string? Even better, try arglist('axlWizFormCreate), which returns (s_symbol t_string l_list g_general \@optional l_list "stlgl"). How does one interpret the results of arglist() to figure out how to use undocumented functions?

     

    FYI, since I mentioned the cursor location above, axlCursorGet(t) returns some XY coordinate I can't totally figure out, but axlCursorGet(nil) seems to return the cursor's correct location on the schematic canvas, same as reported in Allegro's status bar. Yay! Then again, as you said Dave, who knows if these functions will stay around in the future or have the same functionality.

    • Cancel
    • Up 0 Down
    • Reply
    • Cancel
  • TDurenk
    TDurenk 11 days ago in reply to EvanShultz
    Although an old thread, I recently found the way to get axlCursorWarp working. 
    from the help function 17.2

    axlCursorWarp (
    g_pixel
    l_xy
    ) ==> t/nil

    from the help:

    g_pixel
    If t return xy in pixels else return cursor position where it stands in current design.
    l_xy
    The xy values may be specified in pixel (g_pixel=t) or design units (g_pixel=nil)

    After a bit of trial and error, the first paramator sets the type of coordinate, and the second one is ...*drumroll:
    a list of coordinates!  ( hence the l_...) so instead of 0,0 you make a list with `(x y) 

    example:

    axlCursorWarp(nil '(0 0 ))

    -> the cursor jumps to 0,0, but only if coordinate 0,0 is in the current view

    -> returns 1 if succeeded.

    axlCursorWarp(t  '(20 20 ))

    -> jumps from top left of the view -20 in x and -20 y direction.

    • Cancel
    • Up 0 Down
    • Reply
    • Cancel
Cadence Guidelines

Community Guidelines

The Cadence Design Communities support Cadence users and technologists interacting to exchange ideas, news, technical information, and best practices to solve problems and get the most from Cadence technology. The community is open to everyone, and to provide the most value, we require participants to follow our Community Guidelines that facilitate a quality exchange of ideas and information. By accessing, contributing, using or downloading any materials from the site, you agree to be bound by the full Community Guidelines.

© 2023 Cadence Design Systems, Inc. All Rights Reserved.

  • Terms of Use
  • Privacy
  • Cookie Policy
  • US Trademarks
  • Do Not Sell or Share My Personal Information