I want to change a text block size (#16). i run a script recording and get this from the *.scr
setwindow pcbtrapsize 302define text setwindow form.textblockFORM textblock 16 width 0.1000 FORM textblock 16 height 0.1000 FORM textblock 16 line_spacing 0.0200 FORM textblock 16 photoplot_width 0.0100 FORM textblock done setwindow pcb
just wonder what the FORM means in a script file...it is not a valid command in Allegro
is it possible to enclose the FORM statements in skill code?
Either call the script from skill or combine all the statements on a single line and call that line from skill
axlShell(" define text; setwindow form.textblock; FORM textblock 16 width 0.1000; <...>; FORM textblock done")
the ; allows commands to be chained on a single line and the <...> is the rest of your script.
Hello, If you still need some additional help with this, I have included a piece of skill code I wrote to check and change some Text block data for my job. Take a look, maybe you can modify it for your needs.
; vc_SetTxtPlotW.il; Ver. 1.1- 11-25-2008 - VC; ; Written by:; Vincent Canulli Sr.; firstname.lastname@example.org;; This will set all fields of the first four text blocks for you and then check to see that all the remaining; text blocks have the PhotoPlot Width set to our standards. If it is not it will correct it.;axlCmdRegister( "settxtpw" 'vc_SetTextPlotW ) ;register the command with allegro
defun( vc_SetTextPlotW () let(( x p txtBlk_name txtBlk_photo txtBlk_height ) axlMsgPut( " Running vc_SetTxtPlotW" ) axlUIWPrint( nil " Check the allegro journal file for Text Block PhotoPlot Width changes if interested." ) for(i, 1, axlDBControl('maxTextBlock) ; loop from 1 to max text block number sprintf(p, "paramTextBlock:%d", i) ; set p equal to the dbid of the text block number txtBlk_name = axlGetParam(p)->name ; get the name field txtBlk_photo = axlGetParam(p)->photoWidth ; get the photoWidth field txtBlk_height = axlGetParam(p)->height ; get the height filed ; test each case and correct if needed cond( ( equal( txtBlk_name "1" ) x=axlGetParam(p) x->width=0.2540 x->height=0.3810 x->lineSpace=0.5080 x->photoWidth=0 x->charSpace=0.0762 axlSetParam(x) ) ( equal( txtBlk_name "2" ) x=axlGetParam(p) x->width=0.5842 x->height=0.7874 x->lineSpace=0.9906 x->photoWidth=0.1270 x->charSpace=0.1524 axlSetParam(x) ) ( equal( txtBlk_name "3" ) x=axlGetParam(p) x->width=0.9652 x->height=1.2700 x->lineSpace=1.6002 x->photoWidth=0.1524 x->charSpace=0.2032 axlSetParam(x) ) ( equal( txtBlk_name "4" ) x=axlGetParam(p) x->width=0.6096 x->height=1.0160 x->lineSpace=2.0066 x->photoWidth=0.1524 x->charSpace=0.1524 axlSetParam(x) ) ( txtBlk_height <=0 axlMsgPut( "*** Warning Text Block - #%d has an invalid height! ***" i ); axlUIConfirm( sprintf( nil "*** Warning Text Block - #%d has an invalid height! ***" i )) ) ( txtBlk_height <2.540 && atoi( txtBlk_name ) >4 && nequal( txtBlk_photo 0.1524) x=axlGetParam(p) x->photoWidth=0.1524 axlSetParam(x) axlMsgPut( " Text Block %s PhotoPlot Width was changed from %n to 0.1524." txtBlk_name txtBlk_photo )) ( txtBlk_height <3.810 && txtBlk_height >=2.540 && atoi( txtBlk_name ) >4 && nequal( txtBlk_photo 0.2540 ) x=axlGetParam(p) x->photoWidth=0.2540 axlSetParam(x) axlMsgPut( " Text Block %s PhotoPlot Width was changed from %n to 0.2540." txtBlk_name txtBlk_photo )) ( txtBlk_height <5.080 && txtBlk_height >=3.810 && atoi( txtBlk_name ) >4 && nequal( txtBlk_photo 0.3810 ) x=axlGetParam(p) x->photoWidth=0.3810 axlSetParam(x) axlMsgPut( " Text Block %s PhotoPlot Width was changed from %n to 0.3810." txtBlk_name txtBlk_photo )) ( txtBlk_height <6.350 && txtBlk_height >=5.080 && atoi( txtBlk_name ) >4 && nequal( txtBlk_photo 0.5080 ) x=axlGetParam(p) x->photoWidth=0.5080 axlSetParam(x) axlMsgPut( " Text Block %s PhotoPlot Width was changed from %n to 0.5080." txtBlk_name txtBlk_photo )) ( txtBlk_height >=6.350 && atoi( txtBlk_name ) >4 && nequal( txtBlk_photo 0.6350 ) x=axlGetParam(p) x->photoWidth=0.6350 axlSetParam(x) axlMsgPut( " Text Block %s PhotoPlot Width was changed from %n to 0.6350." txtBlk_name txtBlk_photo )) );end cond
);end for axlMsgPut( " Text PhotoPlot Widths have been checked and/or corrected." )
);end let);end vc_SetTextPlotW
In reply to Boardman:
Hi Vincent and fxffxf,
Vincent's code might be a little difficult for me to understand in details,
anyway, thanks for sharing with me the helpful info =)
In reply to skillnewbie:
Hi I hope this helps
In reply to vramanan:
i use the 19 of the text block sizes. I tried running a script to change the sizes but the script gui keeps disappearing. Is there a command to stop playing the script?
In reply to charales:
Check the end of the script file. If you have the following lines you may want to delete them:FORM textblock reset FORM textblock add FORM textblock compact
I use the 19 of the text block sizes. All my parts in my libraries are done with different sizes of text and i would like to try and set these to the same sizes. I need a script or skill file to do this. I tried doing my first script and i'm getting no where. First question, i'm using 16.2 performance, can i do scripts with this? This is how i'm going about doing the script. I open up the text block window. Then in command line i type in "script". A window comes up and i enter a filename then click on record, sometime after this the GUI window dissappears. I go through and edit the 19 text sizes, but when i'm done there is no place to click "stop recording". Can i type in something in the command line to end the script? Is there an easier way to do this? After i'm done i would like to send it to another site so they can can set up the texts to match ours.
any help would be appreciated,
To stop recording a script select File >Script from the menu and then in the Scripting GUI select "Stop"Cadence online support solution 1815913 and 11118650 describes how to create a script that will set all of the text blocks the same size for each drawing.The short version is:
Bring up the text block editorUse "Control" "P" on your keyboard to bring up a GUI that lets you save the form as a script.Edit the file created to remove the last 3 lines which compact, reset, and add blocksSave the fileIn the Allegro editor replay the script
Stop the script by using the menu: file ->script ->stop.
Of course, resetting the text blocks in your library won't help unless those text blocks match your designs. The best method is to reserve and standardise the first 16 (minimum) text blocks across your company. The Cadence defaults might be OK. We use blocks 1, 2 and 3 (customised) for library reference designators (depending on the size of the part) and 17 for silkscreen text.
I have some Skill that might help do what you want. However, running utilities across an entire library isn't for the faint hearted. If you have parts created in older versions of Allegro you will have to run dbdoctor on those parts before you start- easy if they are in one folder - not so easy otherwise. You should take a backup copy of each library before updating it.
Good luck, Dave
Dave Elder, Tait Communications
In reply to eDave:
our board text sizes are all the same, I usually start with a previous board file where everything is already set up, makes life simple. When i get the other sites, brd files then the text sizes are different. I'm trying to get them something other than a screen shot of my "text setup". I'm also trying to sync the parts' text blocks with the boards text blocks. Thanks for your response i'll try the script again.
Are you willing to share your skill code?
In reply to rahays:
See the attached code. It's just been cobbled together from existing code and I haven't tested any part of it. It can be used to run a function on all dra's in your library. It can't be used without modification as, at least, your own library paths will neet to be used.
Running dbDoctorAll will bring all your dra's up to the version you are currently running - use with care.
Note the commented out actionFunction(). This should be used to run whatever command you need to update each symbol.
Thanks very much, Dave! BTW how are things in Christchurch? I know that it has been tough.