4 Replies Latest reply on Apr 24, 2018 4:47 AM by ryohsuke.umeda@denso-ten.com

    The PCB Automation sample for Java

    Satoru

      Hi All,

       

      Do you have a sample for creating PCB Automation by Java?

       

      Satoru

        • 1. Re: The PCB Automation sample for Java
          peter_festesen

          Satoru-san, please check the AATK, there are a few jscript examples in there...

           

          • 2. Re: The PCB Automation sample for Java
            kendall_hiles

            Yes, these are jscript and not Java.  I do have a Java example in AATK\Java\Placement.  It uses spring theory to dynamically place your parts but, it is completely out of process but, it is really cool!  I tried to get a patent on it but, I was denied so I put it in here as Open Source.

             

            -kendall

            2 of 2 people found this helpful
            • 3. Re: The PCB Automation sample for Java
              Satoru

              Hi Kendall-san,

               

              Thank you for your help.

              I was able to take the sample file of java from AATK.

               

              Satoru

              • 4. Re: The PCB Automation sample for Java
                ryohsuke.umeda@denso-ten.com

                Hello, Kendall-san

                 

                Thank you for your help.

                I saw Java example in AATK_1861\Java\Placement and tried to make code myself.

                The code as follows:

                -----------------------

                import MGCPCB.Application;
                import MGCPCB.IMGCPCBDocument;
                import MGCPCB.IMGCPCBEditorControl;

                /**
                *
                * @author ryohsuke.umeda
                */
                public class PCBTest {
                    private Application pcbApp;
                    private IMGCPCBDocument pcbDoc;
                    public int layout() {       
                        pcbApp = new MGCPCB.Application();
                        pcbDoc = pcbApp.IMGCPCBApplication_getActiveDocument();
                        IMGCPCBEditorControl edtrCont;
                        edtrCont = pcbDoc.IMGCPCBDocument_getEditorControl();
                        edtrCont.IMGCPCBEditorControl_setInteractiveDRC(false);
                        return 0;
                    }
                }

                ----------------------

                The dependencies as follows:

                  \ATTK_1861\Java\Java Integration\jip_EXP2005_win32\

                  jacob.jar

                  jip_cmsobjexhcts.jar

                  jip_CommandBarSvr.jar

                  jip_ExpeditionPCB.jar

                  jip_MGCPCBAutomationLicensing.jar

                  jip_viewdraw.jar

                 

                Build was successed, but did not run. Error message as follows:

                ---------------------------------------------------------------------------------

                Exception in thread "main" java.lang.UnsatisfiedLinkError: no mwjloader in java.

                library.path

                        at java.lang.ClassLoader.loadLibrary(Unknown Source)

                        at java.lang.Runtime.loadLibrary0(Unknown Source)

                        at java.lang.System.loadLibrary(Unknown Source)

                        at mwdlload.mwjloader.<clinit>(mwjloader.java:20)

                        at MGCPCB.mwJNIClass247.<clinit>(mwJNIClass247.java:99)

                        at MGCPCB.Application.<init>(Application.java:30)

                        at componentbrowser.PCBTest.layout(PCBTest.java:21)

                        at componentbrowser.Main.main(Main.java:39)

                ---------------------------------------------------------------------------------

                 

                Question:

                • Where is mwjloader.jar?
                • Could you tell me whether the libraries which placed in jip_EXP2005_win32 are supported by Mentor Graphics or not?