• 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. Create a simple form with SKILL code

Stats

  • Replies 1
  • Subscribers 161
  • Views 15779
  • Members are here 0
More Content

Create a simple form with SKILL code

Alice
Alice over 16 years ago

Hi,

I am trying to understand how the form works in SKILL. Hence, I read thru the agroskill.pdf and tried to run the 2 sample skill, myExtractViews.il and formpop.il. However, I got those errors:-

Skill > load "myExtractViews.il "
function myExtractViews redefined
function _extract redefined
function _formAction redefined
function myExtract redefined
t
Skill > myExtract()
E- *Error* axlFormTitle: argument #1 should be any user-defined (other) type (type template = "ot") - nil
ERROR
Skill >

------------------------------------------------------------------------------------------ 

Skill > load "formpop.il"
function _popAction redefined
function myPop redefined
t
Skill > myPop()
"Error! Could not create form."
E- *Error* axlFormTitle: argument #1 should be any user-defined (other) type (type template = "ot") - nil
ERROR

Can anyone help? how to solve the error? also, any sample of the skill using form for me to learn ?

Thanks a lot =)

Regards,

Alice

I cannot fine the attach icon, so I am copying the skill code as below:-

; myExtractViews.il
; -- Displays a form with a selection list of
; the available extract definition files
; -- Lets the user select any of the files on
; the list as the “View file”
; -- Starts Allegro extract process with the
; user-selected View file when
; the user picks Done from the form.
; Function to extract user selected view to the output file.

(defun myExtractViews (viewFile outFile)
axlExtractToFile( viewFile outFile)
); defun myExtractViews
; Function to start the view extraction

(defun _extract ()
myExtractViews(
buildString(list(cadr(parseString(
axlGetVariable("TEXTPATH"))) selectedFile) "/")
"myextract.dat")
); defun _extract
; Form callback function to respond
(defun _formAction (form)
(case form->curField
("done"
(axlFormClose form)
(axlCancelEnterFun)
(_extract)
t)
("cancel"
(axlFormClose form)
(axlCancelEnterFun)
nil)
("view_file"
(if form->curValue
(progn
; Accept user input only if on list
if(member( form->curValue fileList)
then axlFormSetField( form
"view_file" form->curValue)
else axlFormRestoreField(
form "view_file"))))
t)
("file_list"
(axlFormSetField form "view_file"
form->curValue)
selectedFile = form->curValue
t)); case
); defun _formAction
; User-callable function to set up and
; display the Extract Selector form

(defun myExtract ()
fileList = (cdr (cdr (getDirFiles
cadr( parseString( axlGetVariable("TEXTPATH"))))))
form = axlFormCreate( (gensym)
"extract_selector.form" '("E" "OUTER")
'_formAction t)
axlFormTitle( form "Extract Selector")
axlFormSetField( form "view_file" (car fileList))
selectedFile = (car fileList)
foreach( fileName fileList
axlFormSetField( form "file_list" fileName))
axlFormDisplay( form)
); defun myExtract

--------------------------------------------------------------------------------------------------

; formpop.il - Create and display a form with a popup
; Form call back function to respond to user selection of any field in the form
(defun _popAction (form)
  (case form->curField
        ("done"
          (axlFormClose form)
          (axlCancelEnterFun)
          t)
        ("change_pop"
          (case already_changed
              (0;Use display/dispatch string pairs
                  axlFormBuildPopup(form "my_popup"
                  list(
                  list("NewPopup A" "mynewpopup_a")
                  list("NewPopup B" "mynewpopup_b")))
                axlFormSetField(form "my_popup"
                    "My First Popups")
                )
              (1;Display string/dispatch integer pairs
                  axlFormBuildPopup(form "my_popup"
                    list( list("NewPopup 12" 12)
                    list("NewPopup 5" 5)))
                    axlFormSetField(form "my_popup"
                        "My Second Popups")
                )
                  (t;String is both display and dispatch
                      axlFormBuildPopup(form "my_popup"
                      list( "MyPopNValue1"
                              "MyPopNValue2"))
                      axlFormSetField(form "my_popup"
                               "My Third Popups")
                      )
                      )
                      already_changed++
                      t)
          ("my_popup"
              printf( "Got my_popup event:
                  form->curValue %s", form->curValue)
              if( form->curValue
                (progn
                 axlFormSetField( form "my_popup"
                      form->curValue)))
           t)
      ); case
    )
; defun _popAction
; User-callable function to set up and
; display the Extract Selector form

(defun myPop ()
  form = axlFormCreate( (gensym) "popup.form"
          '("E" "OUTER") '_popAction t)
         if( axlIsFormType(form)
            then (print "Created form successfully.")
              else (print "Error! Could not create form."))
        axlFormTitle( form "Try My Popup")
        mypopvalue = "my_start_popup"
        axlFormSetField( form "my_popup" mypopvalue)
        axlFormDisplay( form)
        already_changed = 0
); defun myPop

  • Sign in to reply
  • Cancel
  • aCraig
    aCraig over 16 years ago

     Alice,

     It looks like you should execute  "myExtract()" not "myExtractViews()" . Make sure you have the .form file in your FORMPATH or the current working directory.

    There are other form examples at $CDSROOT/share/pcb/examples/skill/form. One of my favorites is "axlform" in the basic directory. It has an example of all the basic form features. 

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

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

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