• 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. Change text block size, Allegro script and skill

Stats

  • Replies 17
  • Subscribers 164
  • Views 23744
  • Members are here 0
More Content

Change text block size, Allegro script and skill

skillnewbie
skillnewbie over 16 years ago

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?

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

     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.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Boardman
    Boardman over 16 years ago

    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

     

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • skillnewbie
    skillnewbie over 16 years ago

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

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • vramanan
    vramanan over 15 years ago

     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

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Boardman
    Boardman over 15 years ago
    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
    • 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