• 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. NC Drill

Stats

  • Replies 4
  • Subscribers 160
  • Views 13446
  • Members are here 0
More Content

NC Drill

SKILLBILL
SKILLBILL over 15 years ago
Hello First post on this forum :) So far i was learning from your experience searching everything in this forum wiithout asking a single question. I want to thank all who share information on this forum, especially eDave, Ole, Oldmoudy and vramanan. You are my gurus. You probably dont know it but you helped me a lot =D Ok back to the point. I am facing dificulty. Basicly i am stuck with nc drill. What I have to do: I need to generate NC Drill (Exactly i need .drl file) Manualy there is no problem to make this file. I go to Manufacture >> NC >> NC Drill and click Drill Question is how to do it with a script. I tried with nctape_full function but no luck. Have anyone used this function before, and can show an example ? Can anyone give me an idea how to use this function and execute this Drill command. There must be a way. If it can be done manualy there has to be a way to automate it. Help please I read in this presentation www.cadence.com/.../5.4_presentationIndia.pdf that there is a way to execute multiiple commands ("Single stroke with multiple commands" section) for example alias
  • Sign in to reply
  • Cancel
  • djhutchi
    djhutchi over 15 years ago

    There are a couple of different ways of doing this; you could use axlRunBatchDBProgram() to run the nctape external command:

         axlRunBatchDBProgram("nctape" "nctape -$" ?logfile "ncdrill.log")

    or use a block of axlShell commands to emulate the interactive menu picks:

                    axlShell("nctape_full ")
                    axlShell("setwindow form.nc_drill")
                    axlShell("FORM nc_drill tape_name ncdrill.drl")
                    axlShell("FORM nc_drill scale 1.00")
                    axlShell("FORM nc_drill parameters")
                    axlShell("setwindow form.nc_parameters")
                    (status = car((axlDBGetDesignUnits)))
                    if( equal(status "mils") || equal(status "inches") then
                        axlShell("FORM nc_parameters integer_places 2")
                        (status = EPG_GetAccuracy())
                        if( greaterp(status 4) then
                            if( lessp(status 7) then
                                sprintf(status "FORM nc_parameters decimal_places %d" status)
                                axlShell(status)
                            else
                                axlMsgPut("  reduced output format accuracy from %d to 6" status)
                                axlShell("FORM nc_parameters decimal_places 6")
                            )
                        else
                            axlShell("FORM nc_parameters decimal_places 4")
                        )
                        axlShell("FORM nc_parameters english_units YES")
                    else
                        axlShell("FORM nc_parameters integer_places 3")
                        (status = EPG_GetAccuracy())
                        if( greaterp(status 4) then
                            if( lessp(status 7) then
                                sprintf(status "FORM nc_parameters decimal_places %d" status)
                                axlShell(status)
                            else
                                axlMsgPut("  reduced output format accuracy from %d to 6" status)
                                axlShell("FORM nc_parameters decimal_places 6")
                            )
                        else
                            axlShell("FORM nc_parameters decimal_places 4")
                        )
                        axlShell("FORM nc_parameters metric_units YES")
                    )
                    axlShell("FORM nc_parameters suppress_lead_zeroes YES")
                    axlShell("FORM nc_parameters suppress_trail_zeroes NO")
                    axlShell("FORM nc_parameters suppress_equal NO")
                    axlShell("FORM nc_parameters enhanced_format YES")
                    axlShell("FORM nc_parameters done")
                    axlShell("setwindow form.nc_drill")
                    axlShell("FORM nc_drill repeat_codes NO")
                    axlShell("FORM nc_drill auto_tool_select YES")
                    axlShell("FORM nc_drill execute")
                    axlShell("setwindow form.nc_drill")
                    axlShell("FORM nc_drill close")
                    axlShell("setwindow pcb")

     

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

    Hi

    Thank you for the kind words.

    I've done this succesfully creating scripts inside a skill program and using axlShell command.

    procedure( _ns_pp_CreateDrillData()
      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 %s.drl\n" filename)
      fprintf(tmp_file "FORM nc_drill auto_tool_select YES\n")
      fprintf(tmp_file "FORM nc_drill separate_tapes YES\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"))
    )

    Best regards

    Ole

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

     Hi Very kind words indeed

     Both methods mentioned will work

    This is my way of doing

    save the following as a nc.scr and type replay nc.scr

     

    setwindow pcb

    ncdrill param
    setwindow form.nc_parameters
    FORM nc_parameters decimal_places 5
    FORM nc_parameters suppress_lead_zeroes YES
    FORM nc_parameters suppress_equal YES
    FORM nc_parameters done 
    setwindow pcb
    nctape_full
    setwindow form.nc_drill
    FORM nc_drill tape_name nctape.drl
    FORM nc_drill scale 1.000
    FORM nc_drill separate_tapes YES
    FORM nc_drill auto_tool_select YES
    FORM nc_drill repeat_codes NO
    FORM nc_drill repeat_codes YES
    FORM nc_drill execute 
    FORM nc_drill close 
    setwindow pcb

     

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • SKILLBILL
    SKILLBILL over 15 years ago
    Thank you very much =) This is exactly what i needed. Thank you for all three methods. Best Regards Chris
    • 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