5 Replies Latest reply on Aug 14, 2018 6:28 AM by andrew_french

    Dual Dimension drill chart from layout to drawing

    andrew_french

      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
          kendall_hiles

          Andrew;

           

          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.

           

          -kendall

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

            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
              peter_festesen

              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...

              /Peter

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

                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
                  andrew_french

                  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

                              ncDrillDialog_OK_Btn.Click();

                   

                              //Save the drill file generation

                              doc.Save();