• Skip to main content
  • Skip to search
  • Skip to footer
Cadence Home
  • This search text may be transcribed, used, stored, or accessed by our third-party service providers per our Cookie Policy and Privacy Policy.

  1. Community Forums
  2. Allegro X PCB Editor
  3. Problem creating an inline form

Stats

  • State Verified Answer
  • Replies 2
  • Subscribers 159
  • Views 4477
  • Members are here 0
More Content

Problem creating an inline form

SOT23
SOT23 over 1 year ago

Hello,

2 years ago I created an inline form that worked pretty well. You can find it here : github

I am trying to create another skill program using an inline form base on the code from the example above, but it doesn't work well .

Here is the code : 

; skill load "EasyDD.il"
axlCmdRegister("easydd" 'EasyDD)
unless(boundp('formHandle) formHandle = nil)

inLineForm = '("
FILE_TYPE=FORM_DEFN VERSION=2
FORM
FIXED
PORT 61 300
HEADER \"EasyDD\"

TILE

TEXT \"Numero CIU :\"
TLOC 3 3
ENDTEXT

FIELD ciuNumberFillin
TLOC 22 3
STRFILLIN 35 200
ENDFIELD

FIELD close
FLOC 20 40
MENUBUTTON \"Close\" 10 3
ENDFIELD

ENDTILE
ENDFORM
")

procedure( EasyDD()
let(()
; CREATE AND DISPLAY THE FORM
eddForm = axlFormCreate('formHandle list("myform" inLineForm) list("center") 'EasyDDCallback t nil)
axlFormDisplay(eddForm)
axlFormSetField(eddForm "ciuNumberFillin" "tt")
))

procedure( EasyDDCallback(eddForm)
let(()
case( eddForm->curField
( "close"
printf("EasyDD closed.")
axlClearSelSet()
axlFormClose(eddForm)
axlShell("done")
) ;case "close"
)
))


;EasyDD()

The STRFILLIN object I use is not displayed. I have tryied moving it to the right. I have tried pre-filling it using axlFormSetField, but it just does not appear.

I have set a window size of 61x300, but the window just doesn't have this size, it is much smaller... What is the point of specifying a size ? If I put the "close" button at x400, it does not limit the size of the window to x61...

I don't understand how this function work : eddForm = axlFormCreate('formHandle list("myform" inLineForm) list("center") 'EasyDDCallback t nil).
I have read the manual (algroskill.pdf) but it is not very clear. What does 'formHandle means ? The manual says it is a "Global SKILL symbol used to reference form". What is a symbol ? Can I put whatever I want here ? If I open my other form program after loading this one, it does not use the correct form (it is using the one from the previously loaded .il file). I suspect it to be due to this formHandle thing. But even if I change formHandle to, let's say, formHandle2, the form used is the same... What are the list used for ? What is "myform" ? Why list("center") ? So much questions :D

Thank you in advance :)

By the way, I am using OrCAD PCB Editor Pro 17.4

  • Sign in to reply
  • Cancel
  • DavidJHutchins
    +1 DavidJHutchins over 1 year ago

    When I try running your code it crashes Allegro, I haven't been able to isolate the cause yet, but below are a few answers to your basic questions...

    I would recommend you spend more time reviewing the 'Cadence SKILL Language User Guide' and the 'Cadence SKILL Language Reference' documentation;

    What is a symbol? page 97 of 'Cadence SKILL Language User Guide' states "Symbols in SKILL correspond to variables in C."

    In your code the entry at the top of the file initializes that symbol: unless(boundp('formHandle) formHandle = nil)

    However to avoid name clashes I have found using gensym() to create a unique symbol name reduces errors, an example is shown below:

    (LBRN_WriteEDIF_Form = (axlFormCreate gensym() LBRN_outFormFile list(e outer) 'LBRN_WriteEDIF_Form_Action_Routine t))

    What is "myform"? It's the name of the form file to load, however the inLineForm data provides the data without loading an external form file.

    The 'list("CENTER") is the Optional form placement. Allegro uses its default placement if this argument is nil.

    in my example shown above it's list(e outer)

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • Verify Answer
    • Reject Answer
    • Cancel
  • SOT23
    0 SOT23 over 1 year ago in reply to DavidJHutchins
    DavidJHutchins said:
    When I try running your code it crashes Allegro, I haven't been able to isolate the cause yet, but below are a few answers to your basic questions...

    Thank you very much for trying to run it ! After you wrote that I asked myself what could have made it crash on your computer when it runs on mine. I remembered that rule from the algroskill.pdf Form Interface chapter : "every non-blank line must have a tab character". I followed that while writing the code but I just realized that I have this option set up in notepad++ that convertes tabs as spaces... I disabled the option and now my form is displayed properly ! I feel so dumb now...

    I had extensively read the Skill Language User Guide 2 years ago when I first started writing SKILL code, but I guess I have forgotten too much. I will do that before continuing to bother people.

    DavidJHutchins said:

    In your code the entry at the top of the file initializes that symbol: unless(boundp('formHandle) formHandle = nil)

    However to avoid name clashes I have found using gensym() to create a unique symbol name reduces errors, an example is shown below:

    This is something I don't really understand. Here is the form creation : 

    eddForm = axlFormCreate('formHandle list("myform" inLineForm) list("center") 'EasyDDCallback t nil)

    Shouldn't the symbol be eddForm in this example ? What is the formHandle symbol used for ? 

    I replaced it with gensym() but don't really see a difference. I understand that gensym() creates a symbol with an unused name. Yet, if i try to run my inlineform SKILL programs one after the other (whithout reloading the .il file), it still only display the first form that I loaded.

    Thank you for the explanation of the other arguments of axlFormCreate(). I had read the description of the function but didn't really get it. Now I get it.

    Thanks a lot !

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • 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.

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

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