Home > Community > Forums > PCB SKILL > Change text block size, Allegro script and skill

Email

* Required Fields

Recipients email * (separate multiple addresses with commas)

Your name *

Your email *

Message *

Contact Us

* Required Fields
First Name *

Last Name *

Email *

Company / Institution *

Comments: *

 Change text block size, Allegro script and skill 

Last post Sun, Apr 8 2012 5:17 PM by N i z e. 17 replies.
Started by skillnewbie 20 Feb 2009 12:29 AM. Topic has 17 replies and 13923 views
Page 1 of 2 (18 items) 1 2 Next >
Sort Posts:
  • Fri, Feb 20 2009 12:29 AM

    Change text block size, Allegro script and skill Reply

    hi,

    I want to change a text block size (#16). i run a script recording and get this from the *.scr 

     setwindow pcb
    trapsize 302
    define text
    setwindow form.textblock
    FORM 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?

    • Post Points: 50
  • Fri, Feb 20 2009 5:47 AM

    • fxffxf
    • Top 25 Contributor
    • Joined on Thu, Jul 17 2008
    • ., AK
    • Posts 290
    • Points 4,620
    Re: Change text block size, Allegro script and skill Reply

     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.

    • Post Points: 5
  • Wed, Feb 25 2009 9:35 AM

    • Boardman
    • Not Ranked
    • Joined on Thu, Jul 17 2008
    • Posts 4
    • Points 50
    Re: Change text block size, Allegro script and skill Reply

    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.
    ;  boardman0@lycos.com
    ;
    ; 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

    ;Globals

    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

     

    • Post Points: 35
  • Thu, Feb 26 2009 7:44 PM

    Re: Change text block size, Allegro script and skill Reply

    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 =)

    • Post Points: 20
  • Fri, Jan 1 2010 7:42 AM

    • vramanan
    • Top 100 Contributor
    • Joined on Fri, Oct 10 2008
    • sunnyvale, CA
    • Posts 66
    • Points 1,110
    Re: Change text block size, Allegro script and skill Reply

     Hi I hope this helps

     

    p=axlGetParam("paramTextBlock:16")
    p->width=100
    p->height=75
    p->photoWidth=18
    p->charSpace=25

    p->lineSpace=20

    axlSetParam(p)

     

    regards

    Venkata

    • Post Points: 20
  • Fri, Jan 1 2010 9:33 PM

    • Boardman
    • Not Ranked
    • Joined on Thu, Jul 17 2008
    • Posts 4
    • Points 50
    RE: Change text block size, Allegro script and skill Reply
    Hi Venkata,

    I solved the problem right after making the post to the forum.

    I guess I forgot to go back and remove the post.

    What I really wanted was to check the 1st 4 text blocks and set them if they were not what I expected.

    Then I wanted to make sure all the photoplot widths had a value.

    Here is what I used in case someone else would want it.

    ; vc_SetTxtPlotW.il

    ; Ver. 1.1- 11-25-2008 - VC

    ;

    ; Written by:

    ;      Vincent Canulli Sr.

    ;                       boardman0@lycos.com

    ;

    ; 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 IXIA standards. If it is not it will correct it.

    ;

    axlCmdRegister( "settxtpw" 'vc_SetTextPlotW )                            ;register the command with allegro

     

    ;Globals


    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

                           

    Thank you,

    Vince

    Vincent Canulli Sr.
    Principal CAD Engineer I
    • Post Points: 5
  • Mon, Jan 25 2010 8:53 PM

    • charales
    • Not Ranked
    • Joined on Thu, Jul 17 2008
    • Posts 11
    • Points 235
    Re: Change text block size, Allegro script and skill Reply

    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?

    • Post Points: 20
  • Mon, Jan 25 2010 8:59 PM

    • Rik Lee
    • Top 50 Contributor
    • Joined on Tue, Dec 2 2008
    • HOME, SC
    • Posts 166
    • Points 2,730
    Re: Change text block size, Allegro script and skill Reply

     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

    • Post Points: 5
  • Mon, Jan 25 2010 10:30 PM

    • charales
    • Not Ranked
    • Joined on Thu, Jul 17 2008
    • Posts 11
    • Points 235
    Re: Change text block size, Allegro script and skill Reply

    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,

    Sam 

    • Post Points: 50
  • Mon, Jan 25 2010 10:43 PM

    • Rik Lee
    • Top 50 Contributor
    • Joined on Tue, Dec 2 2008
    • HOME, SC
    • Posts 166
    • Points 2,730
    Re: Change text block size, Allegro script and skill Reply

    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 editor
    Use "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 blocks
    Save the file

    In the Allegro editor replay the script


    • Post Points: 5
  • Mon, Jan 25 2010 11:13 PM

    • Boardman
    • Not Ranked
    • Joined on Thu, Jul 17 2008
    • Posts 4
    • Points 50
    RE: Change text block size, Allegro script and skill Reply
    Hi Sam,

    You are doing it correctly to generate a script.

    After you are finished with the recording just type script again and the GUI will put up and you can select STOP.

     
    Vince

    Vincent Canulli Sr.
    Principal CAD Engineer I
    vcanulli@ixiacom.com
    • Post Points: 5
  • Mon, Jan 25 2010 11:19 PM

    • eDave
    • Top 10 Contributor
    • Joined on Sun, Jul 13 2008
    • Christchurch, 00-NZ
    • Posts 707
    • Points 15,395
    Re: Change text block size, Allegro script and skill Reply

    Hi Sam,

    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
    • Post Points: 50
  • Tue, Jan 26 2010 12:04 AM

    • charales
    • Not Ranked
    • Joined on Thu, Jul 17 2008
    • Posts 11
    • Points 235
    Re: Change text block size, Allegro script and skill Reply

    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.

    • Post Points: 5
  • Wed, May 4 2011 7:50 AM

    • rahays
    • Not Ranked
    • Joined on Mon, Jul 28 2008
    • Posts 7
    • Points 110
    Re: Change text block size, Allegro script and skill Reply

    Dave,

    Are you willing to share your skill code?

     

    Thanks,

    Robert Hays

    • Post Points: 20
  • Wed, May 4 2011 1:09 PM

    • eDave
    • Top 10 Contributor
    • Joined on Sun, Jul 13 2008
    • Christchurch, 00-NZ
    • Posts 707
    • Points 15,395
    Re: Change text block size, Allegro script and skill Reply

    Hi Robert,

    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.

    Regards,

    Dave

    Dave Elder, Tait Communications
    • Post Points: 20
Page 1 of 2 (18 items) 1 2 Next >
Sort Posts:
Started by skillnewbie at 20 Feb 2009 12:29 AM. Topic has 17 replies.