• 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. Example Skill Tutorial

Stats

  • Replies 6
  • Subscribers 161
  • Views 18011
  • Members are here 0
More Content

Example Skill Tutorial

JuergenWeber
JuergenWeber over 12 years ago

Hi

i have found following code on www.referencedesigner.com/.../allegro_skill_76.php

Is it possible to read the les4.form from the advanceform.il file?

Thanks for your help

 

Jürgen

 

 

 
axlCmdRegister( "advanceform" `advanceform)
; -----------------------------------------------------------------
procedure( advanceform()

	les4_form = axlFormCreate( (gensym) "les4.form" nil 'les4_form_Action t)
	axlFormDisplay(les4_form)

); end of procedure
; -----------------------------------------------------------------
procedure( les4_form_Action(les4_form)
	case( les4_form->curField

		("Close_button"
        	axlFormClose( les4_form )
		 	axlCancelEnterFun( )
      	); --------------------------

 		("Run_button"
			les4_form_run()
      	); --------------------------	
	); end case
	
); end of procedure

; -----------------------------------------------------------------
procedure( les4_form_run()
	; Create output file to write report
	cl_file = outfile("check_list.rpt" "w")

		; ------ Print Header 
		fprintf(cl_file "**********************\n")
		fprintf(cl_file " Check List Report\n")
		fprintf(cl_file "**********************\n\n")
		
		axlUIWPrint(les4_form getCurrentTime())

		; ------  Print CurrentTime
		fprintf(cl_file "CurrentTime : %s \n" getCurrentTime())

		; ------  Print Designer Name
		fprintf(cl_file "PCB Designer Name : %s \n" axlFormGetField( les4_form "name"))

		; ------  Print Design Name
		fprintf(cl_file "Design Name : %s \n" axlCurrentDesign())

		; ------ Print value of check box
		if( axlFormGetField(les4_form "check1") then check = "YES" else check = "NO" ); end if 
		fprintf(cl_file "Do you check DRC? : %s \n" check)		

		; ------ Print	value of popup
		fprintf(cl_file "Exist SMD in this project : %s \n" axlFormGetField( les4_form "pop1"))

		; ------ Print	value of slidebar
		fprintf(cl_file "Layers number : %d \n" axlFormGetField( les4_form "slidebar1"))

		; ------ Print value of group
		if( axlFormGetField(les4_form "both") then 
			silk_side = "Both" 
		else 
			if( axlFormGetField(les4_form "top") then silk_side = "Top" else silk_side = "Bottom" ); end if 
		); end if 
		
		fprintf(cl_file "Silk exist on : %s \n" silk_side)
		; ------
		
	close(cl_file)
			
); end of procedure
; -----------------------------------------------------------------




Now creat another file called les4.form with the following content
 

 FILE_TYPE=FORM_DEFN VERSION=2
FORM
FIXED
PORT 40 40
HEADER "Check List Report"

#=== must define popup before using
POPUP "Yes" "Yes" , "No" "No" .

TILE
#========== using STRFILLIN
TEXT "PCB Designer Name"
FLOC 1 1
ENDTEXT

FIELD name
FLOC 20 1
STRFILLIN 15 20
ENDFIELD
#========== using CHECKLIST
TEXT "Do you checked  DRC?"
FLOC 1 5
ENDTEXT

FIELD check1
FLOC 20 5
CHECKLIST "Yes"
ENDFIELD
#========== using POPUP
TEXT "Exist SMD in this project"
FLOC 1 10
ENDTEXT

FIELD pop1
FLOC 20 10
ENUMSET 6
POP "pop1"
ENDFIELD
#========== using INTSLIDEBAR
TEXT "Layers number"
FLOC 1 15
ENDTEXT

FIELD slidebar1
FLOC 20 15
INTSLIDEBAR 2 2
MIN 2
MAX 30
ENDFIELD
#========== using GROUP
TEXT "Silk exist on"
FLOC 1 20
ENDTEXT

GROUP ""
GLOC 18 18
GSIZE 22 5 
ENDGROUP

FIELD top
FLOC 19 20
CHECKLIST"Top" "grp"
ENDFIELD

FIELD bottom
FLOC 25 20
CHECKLIST "Bottom" "grp"
ENDFIELD

FIELD both
FLOC 33 20
CHECKLIST "Both" "grp"
ENDFIELD
#========== using MENUBUTTON

FIELD Run_button
FLOC 2 27
MENUBUTTON "Run" 7 3
ENDFIELD

FIELD Close_button
FLOC 11 27
MENUBUTTON "Close" 7 3
ENDFIELD

#======================
ENDTILE

ENDFORM
  • Sign in to reply
  • Cancel
  • eDave
    eDave over 12 years ago

    Hi Jurgen,

    I'm not sure I understand the question. You can use the enclosed text to create the form file using a simple copy and paste. 

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Ejlersen
    Ejlersen over 12 years ago

    Hi

     If you're looking at making the form file generation part of the program, then you could do so

     

    (defun _mycreateform ()
    let((form_file myform)
    drain()
    form_file = "./les4.form"
    myform = outfile(form_file "w")

    In here you would have to put fprintf statements to print the above into the form file

     example for first line

    fprintf(myform "FILE_TYPE=FORM_DEFN VERSION=2\n")

     ))

    Best regards

    Ole

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • joma
    joma over 12 years ago

    Hi Jürgen,

     I don't know if you have found it already but there is an example skill form file at
    ...\share\pcb\examples\skill\form\basic\axlform.il

    The last part of this shows how to embed a form file within a skill file. I have not tried to use it yet so I
    can not give any feedback on how it works though.

    Jim O'Mahony

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • JuergenWeber
    JuergenWeber over 12 years ago

    Hi all,

    after my vacation i have found the example and the script for a little readme.doc works now.

    This is not perfect but a little beginning for me.

    One question I have. How can I embed an image file (bitmap) . How can I embed an image file

    Thank for your advice.

     

    Form

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • eDave
    eDave over 12 years ago
    See the documentation for axlGRPDrwBitmap
    • 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