Home > Community > Forums > PCB SKILL > skill program to create shape symbol

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: *

 skill program to create shape symbol 

Last post Fri, Dec 21 2012 4:37 AM by Ejlersen. 11 replies.
Started by Ejlersen 01 Mar 2010 10:43 PM. Topic has 11 replies and 8946 views
Page 1 of 1 (12 items)
Sort Posts:
  • Mon, Mar 1 2010 10:43 PM

    • Ejlersen
    • Top 10 Contributor
    • Joined on Mon, Jul 28 2008
    • Aalborg, Copenhagen
    • Posts 569
    • Points 10,080
    skill program to create shape symbol Reply

    Hi

    Attached, find a small utility to help creating rectangular shapes with rounded corners for shape symbols to be used inside a pad

    Usage: File, New, Shape symbol

    Run the program "ns_spad"

    Add width(x), height(y) and a radius in the dialog shown

    Hit run to create the shape.

    Have fun :-)

    Ole

    Best regards Ole
    • Post Points: 20
  • Tue, Mar 2 2010 12:09 PM

    • SKILLBILL
    • Not Ranked
    • Joined on Tue, Feb 16 2010
    • Gdansk, Poland
    • Posts 5
    • Points 100
    Re: skill program to create shape symbol Reply
    Hi Ole

    Your program is great. It works very nice.
    Funny because lately i made similar one. Only diference between them is that yours is cute and mine is not :)
    Mine tho automaticaly opens allegro shape template and then promts for X Y and R :) then it makes three shapes.
    One for etch
    One for Paste mask
    and one for Solder mask

    Using the oportunity i would like to ask you something Ole.
    Ok we now have the shape generation. What about making pad ? Is it possible to create a padstack like the one I can get from Pad Designer?

    I have been trying to build a pad with the shapes created this way. I found a function that should work axlDBCreatePadStack but I cant generate .pad file
    There is a piece of code to that function in algroskill.pdf
    It may be that I dont understand the example. Am I doing something wrong ?
    Here is a piece of my code:

    Pad_list = cons(make_axlPadStackPad(?layer "TOP", ?type 'REGULAR, ?figure Shape_top_name ?figureSize x:y) nil)
    Pad_list = cons(make_axlPadStackPad(?layer "PASTEMASK_TOP", ?type 'REGULAR, ?figure Shape_pm_name ?figureSize pmX:pmY) Pad_list)
    Pad_list = cons(make_axlPadStackPad(?layer "SOLDERMASK_TOP", ?type 'REGULAR, ?figure Shape_sm_name ?figureSize smX:smY) Pad_list)
    printf("Pad_list = %L\n",Pad_list)
    Padstack = axlDBCreatePadStack("krzyhoo",nil, Pad_list nil)
    printf("axlDBCreatePadStack = %L", Padstack)
    axlPadStackToDisk("krzyhoo")

    with those printfs i know that a dbid was created .. but not a .pad file, and axlPadStackToDisk function doesnt worka at all....

    Do you have any ideas?

    PS. This is my second post... And i dont like the form of it ... why my text is so condensed... no Enters no tabs ... everything so close together ... I made it so hard to read...
    When i wrote it wasnt tlike this..
    • Post Points: 35
  • Tue, Mar 2 2010 9:32 PM

    • vramanan
    • Top 100 Contributor
    • Joined on Fri, Oct 10 2008
    • sunnyvale, CA
    • Posts 66
    • Points 1,110
    Re: skill program to create shape symbol Reply

     Hi Skillbill

    are you using chrome, I find chrome behaving like this

    Use Firefox

    Seach Google or the forum for FPM (Foot Print Make)

    It has all the tools you need to create symbols and padstacks

    regarding surface mount pads yes I see there is a need for a utility to  quickly create padstacks

     I will investigate on this and let you know my findings

    regards

    Venkata

    • Post Points: 5
  • Tue, Mar 2 2010 9:44 PM

    • vramanan
    • Top 100 Contributor
    • Joined on Fri, Oct 10 2008
    • sunnyvale, CA
    • Posts 66
    • Points 1,110
    Re: skill program to create shape symbol Reply

     Hi Skillbill

    the example file 

    %cdsroot%/share/pcb/examples/skill/dbcreate/pad.il

    will create 2 pad files 

    MY_PAD and SMT_PAD

    it will not create a physical PAD file but will create the pad definition inside the allegro database

    to see them go to Tools-> Padstack->Modify Design Padstack

    Now you should see those definitions

    you could either save them by Editing and invoking the padstack editor or File->Export->libraries and chooseonly padstack

    as mentioned in the help doc this will not work in the symbol editor

     

    I can see that using this you could create a quick SMT pad on the fly and replace an existing pad

     

    regards

    Venkata

     

    • Post Points: 20
  • Wed, Mar 3 2010 6:14 PM

    • SKILLBILL
    • Not Ranked
    • Joined on Tue, Feb 16 2010
    • Gdansk, Poland
    • Posts 5
    • Points 100
    Re: skill program to create shape symbol Reply

    Hi vramanan

     

    This is great. Wonderfull. I made it, thx to your idea vramanan. I have created padstack.

    You are 100% right. With the help of axlDBCreatePadStack function padstack is virtualy created in allegro database.

    Export of the padstack allso works.

     

    Right now I am working on a way to automaticaly export this pad.

    Some time ago mr Ejlersen showed me a way to fill forms that pop up in allegro.

    Back then i was filling form that poped after nctape_full command

    and i used this code

    tmp_file = axlDMOpenFile("ALLEGRO_SCRIPT", "tmp", "w")
          fprintf(tmp_file "scriptmode +i +n +w +c\n")
          fprintf(tmp_file "setwindow pcb\n")
          fprintf(tmp_file "nctape_full\n")
          fprintf(tmp_file "setwindow form.nc_drill\n")
          fprintf(tmp_file "FORM nc_drill tape_name NC_Drill_%s.drl\n" filename)
          fprintf(tmp_file "FORM nc_drill auto_tool_select YES\n")
         fprintf(tmp_file "FORM nc_drill separate_tapes NO\n")
          fprintf(tmp_file "FORM nc_drill repeat_codes YES\n")
          fprintf(tmp_file "FORM nc_drill optimize YES\n")
          fprintf(tmp_file "FORM nc_drill execute\n")
          fprintf(tmp_file "FORM nc_drill close\n")
          fprintf(tmp_file "setwindow pcb\n")
          axlDMClose(tmp_file)
          axlShell("replay tmp")
          if( isFile( "tmp.scr") then deleteFile("tmp.scr"))
          printf("NC Drill created succesfully\n")

     

    now i tried to modify it a little but i dont know the name of the form dlib opens.

    This is what I have tried:

    tmp_file = axlDMOpenFile("ALLEGRO_SCRIPT", "tmp", "w")
             fprintf(tmp_file "scriptmode +i +n +w +c\n")
             fprintf(tmp_file "setwindow pcb\n")
             fprintf(tmp_file "dlib\n")    
             fprintf(tmp_file "setwindow form.export_libraries\n") ; this is where i am wrong forms name aint form.export_libraries
             fprintf(tmp_file "FORM export_libraries mechanical_symbols NO\n") ;checkbox set to NO but i am not sure to the name of those checkboxes. I used the names i found in help under "dlib"
             fprintf(tmp_file "FORM export_libraries package_symbols NO\n")
             fprintf(tmp_file "FORM export_libraries format_symbols NO\n")
             fprintf(tmp_file "FORM export_libraries shape_and_flash_symbols NO\n")
             fprintf(tmp_file "FORM export_libraries device_files NO\n")
             fprintf(tmp_file "FORM export_libraries padstacks YES\n")
             fprintf(tmp_file "FORM export_libraries no_library_dependencies NO\n")
             fprintf(tmp_file "FORM export_libraries execute\n")
             fprintf(tmp_file "FORM export_libraries close\n")
             fprintf(tmp_file "setwindow pcb\n")
             axlDMClose(tmp_file)
             axlShell("replay tmp")
            if( isFile( "tmp.scr") then deleteFile("tmp.scr"))

    it doesnt work...tho..

    If you have a clue of those params pls tell me. I feel i am so close :)

    Damn you are good vramanan :D

    I am realy happy and impressed

    Have a nice day

    • Post Points: 20
  • Wed, Mar 3 2010 9:14 PM

    • Ejlersen
    • Top 10 Contributor
    • Joined on Mon, Jul 28 2008
    • Aalborg, Copenhagen
    • Posts 569
    • Points 10,080
    Re: skill program to create shape symbol Reply

    Hi SkillBill

    I'm not sitting in front of PCB Editor at the moment, but when I have difficulties with skill writing script files I normally do the following

    1. Record a new script where I do whatever I want to do.

    2. Carefully check that all my fprintf lines are correct - it only takes a very small spelling or syntax error to fail. Sometimes I even redo the script write commands in my skill program.

    3. Comment out the line "if( isFile( "tmp.scr") then deleteFile("tmp.scr"))" because then I can try running the script "tmp.scr" manually or do a file compare with my previously recorded script.

    4.  Remove +i +n +w +c from the line "fprintf(tmp_file "scriptmode +i +n +w +c\n")" since that may give better warnings as to what the issue could be.

    Hope this helps

    Ole

    Best regards Ole
    • Post Points: 5
  • Wed, Mar 3 2010 9:18 PM

    • Ejlersen
    • Top 10 Contributor
    • Joined on Mon, Jul 28 2008
    • Aalborg, Copenhagen
    • Posts 569
    • Points 10,080
    Re: skill program to create shape symbol Reply

    Hi

    Turns out I could do a remote session and get access to PCB Editor.

    In Release 16.3 the syntax is

    setwindow pcb
    trapsize 205
    etchedit
    dlib
    setwindow form.dlib
    FORM dlib mechanical NO
    FORM dlib package NO
    FORM dlib format NO
    FORM dlib shape NO
    FORM dlib device NO
    FORM dlib pad NO
    FORM dlib pad YES
    FORM dlib nodepend YES
    FORM dlib execute 
    FORM dlib cancel 
    setwindow pcb
    etchedit

    Best regards

    Ole

    Best regards Ole
    • Post Points: 20
  • Thu, Mar 4 2010 4:02 PM

    • SKILLBILL
    • Not Ranked
    • Joined on Tue, Feb 16 2010
    • Gdansk, Poland
    • Posts 5
    • Points 100
    Re: skill program to create shape symbol Reply

    Hi Ejlersen

    I want to thank you very much.

    You have shown me a way to aquire very important information regarding forms inside allegro.

    I am really grateful. This is huge for me.

     

    Many many thanks. Have a nice day Ejlersen.

    PS. One more thing. I dont know what "trapsize 205" does ?

    • Post Points: 20
  • Thu, Mar 4 2010 6:59 PM

    • Ejlersen
    • Top 10 Contributor
    • Joined on Mon, Jul 28 2008
    • Aalborg, Copenhagen
    • Posts 569
    • Points 10,080
    Re: skill program to create shape symbol Reply

    Hi

    Thanks for the kind words. I usually just cut out the trapsize part of my scripts, the online helps says the following about trapsize.

    In Allegro-generated scripts, the tool automatically adds a "trapsize <value>" at the start of a script, after every change in zoom factor, and when opening new databases. If you generate scripts manually, place a "trapsize 0" at the start of a script to ensure that it replays independently of a design's zoom level.

    The value, in design units, describes the trap box size where to find objects when an object pick is encountered in a script. A value of 0 requires a pick on an object.

    Best regards

    Ole

    Best regards Ole
    • Post Points: 20
  • Thu, Feb 9 2012 4:33 AM

    Re: skill program to create shape symbol Reply
    Hi All, I created the shape symbol name is shape_1 for one of the symbol pad and I created another shape symbol for another symbol. When I import the 2nd shape symbol pad, the 1st one is imported. Can anyone suggest me how to import the correct one. Regards, Black Pearl
    Filed under:
    • Post Points: 5
  • Thu, Dec 20 2012 7:21 AM

    • AmyZhang
    • Not Ranked
    • Joined on Thu, Jul 28 2011
    • Beijing, Beijing
    • Posts 13
    • Points 215
    Re: skill program to create shape symbol Reply

    hi,Ejlersen,

    the ns_spad skill is useful,but can  it add to the menu by modify the allegro.men?

    when open the .brd file,it display in the pull-down menu  which i added,but it disable because "program only runs on shape symbols",

    but when i make a new  shape symbol file, the menu that  i added  disappear. i shoud imput "ns_spad" in command line.

      Is there a way to add the skill to the menu?

    sorry for my poor English.

    Thanks!

    • Post Points: 20
  • Fri, Dec 21 2012 4:37 AM

    • Ejlersen
    • Top 10 Contributor
    • Joined on Mon, Jul 28 2008
    • Aalborg, Copenhagen
    • Posts 569
    • Points 10,080
    Re: skill program to create shape symbol Reply

    Hi

    allegro.men controls the menu inside PCB Editor when you work on .brd files.

    For .dra files you need to change pcb_symbol.men instead.

    Best regards

    Ole

    Best regards Ole
    • Post Points: 5
Page 1 of 1 (12 items)
Sort Posts:
Started by Ejlersen at 01 Mar 2010 10:43 PM. Topic has 11 replies.