8 Replies Latest reply on Aug 27, 2018 6:32 AM by andrew_french

    Dual Dimension drill chart from layout to drawing


      We do our boards in xpedition and our drawings in the drawing editor.  We have the need for dual hole dimensions on the drawing file.  In order for us to accomplish this we have to manually run ncdrill in english units push it over to the drawing, copy the chart to a user layer. Go run ncdrill again using metric, push over to the drawing and read it in.  So we end up with two drill charts, one in metric and one in english.  Its a pretty annoying processes and prone to error.


      This seems ripe for automation but I keep hitting little road blocks and I'm not sure the best way to approach this now.  At first I thought using the MGCPCBEngines.NCDrill was my answer for creating the drill charts and all but from what I'm taking away is batch engines are for running outside of the Expedition project.  I also ran into licensing issues with the NCdrill engine despite having the xeautoextended license.  Any time I ran the NCDrill.Go command my code would complain of no license and the mentor examples do not show any special license check out for the extended license and they do work which is frustrating.


      Okay so next approach was to try and run NC drill through the App.Gui.ProcessCommand and then grab the nc drill window using App.Gui.FindDialog("NC Drill Generation") which works.  I can then use the button command to push ok, but I want to load my own configurations.  At this point I can't grab any of the other buttons on the window like the machine file format and I can't send the window keyboard commands.


      I feel like there should be a good way to tackle this problem, its just not jumping out at me just yet.

        • 1. Re: Dual Dimension drill chart from layout to drawing



          The engines do run from inside Xpedition (see AATK\vbs\Engines) but they require the AutomationPRO license.  The easy way to see if you have Automation PRO is if you can create an .efm form and run it.  With that said, I have not done anything with NCDrill in years.


          When we had to automate something that was not exposed yet like the GDS engine, we automated the file in the config directory and then the OK on the form just does what you set up in the config.



          • 2. Re: Dual Dimension drill chart from layout to drawing

            When I run the NCDrill example provided in the "Automation Pro Batch Engines Reference" the drill chart does not get updated.  This is why I believe its for being run outside of the tool in batch process just to generate a file.  If you run ncdrill, the chart should at least get updated in the design.


            I know I have the xeautoextended license because I can check it out through pcls_ok and the mentor vbs scripts run.  I know I've seen some others complain about similar issues with this license and the "Go" command in many of the engines but there's no resolution posted with those threads unfortunately.

            • 3. Re: Dual Dimension drill chart from layout to drawing

              Andrew - I seem to recall that there was a defect about this (NCDrill data not being updated when NCDrill is driven from the engine). I'll look and see if I can find the details, but for now I suggest you use the workaround outlined by Kendall...


              1 of 1 people found this helpful
              • 4. Re: Dual Dimension drill chart from layout to drawing

                I'm using the same method Kendall mentioned.  Edit the config file then run via ProcessCommand. 


                I'll take a closer look at the engine and see if I can come up with anything.

                1 of 1 people found this helpful
                • 5. Re: Dual Dimension drill chart from layout to drawing

                  I'm getting it to work now copying the config file I want to the project and then using the code below.  Honestly, its just easier this way than having me mess with all the drill settings.  The designers can provide the config file they want to use and get the chart to look how they want.  And I don't have to worry about an extra license that wasn't working for me anyway!


                       app.Gui.SuppressTrivialDialogs = true;

                       app.Gui.ProcessCommand("Output->NC Drill...");

                       //Wait for the NCDrill window to open and then set the handle for the window

                              MGCPCB.Dialog ncDrillDialog = null;

                              while (ncDrillDialog == null)


                                  ncDrillDialog = app.Gui.FindDialog("NC Drill Generation");



                              //Find the "OK" button on the NCDrill menu

                              MGCPCB.button ncDrillDialog_OK_Btn = ncDrillDialog.FindButton("ok");


                              //Push the "ok" button to run NC Drill



                              //Save the drill file generation


                  • 6. Re: Dual Dimension drill chart from layout to drawing

                    Okay so next problem.  In the Drawing Editor, I need to place the drill chart, one per page per span.  When you go to the "Place Drills..." command you get to select the "Design" (thats the board view on the sheet) and then the span to appear on that sheet.  How do I get the list of the Drill tables?  The objects for MGCPCB.DrillDrawings and MGCPCB.DrillTables (I don't understand the difference between the two either) are both empty until I actually place a chart on the drawing which isn't very useful if I want to automate placing the drill chart.  The tool knows the different spans exist before I place the charts so there should be a way I can get these names.  If I have these names I can build my own config file and run it myself because the doc.PutDrillChart appears to have limitations.


                    My other gripe is that the command doc.PutDrillChart() doesn't take any parameters for which drill chart I want to place.  It appears to only place the through hole drill chart.


                    • 7. Re: Dual Dimension drill chart from layout to drawing

                      Andrew, check out this posting (Improve Drill Table Placement Tool In Drawing Editor ).  You can get the drill table names by opening and canceling the Place Drill Tables dialog to generate the Config\default.dcf file, and then read/edit that file with the same script.

                      1 of 1 people found this helpful
                      • 8. Re: Dual Dimension drill chart from layout to drawing

                        Gotta love the internet, even in a niche topic like this someone else has already had the same problem as me, figured out a solution, and posted about it!  I voted for your idea too, it took us way longer to figure out how to use that dang drill chart placement gui than it should.