4 Replies Latest reply on Dec 10, 2018 12:16 PM by christianwagner

    Problem with automation pro license

    pedro_franca_costa

      I had a script written in C# working in the past with xpedition vx.1.

       

      "

      objExtendedPrint = new MGCPCBEngines.ExtendedPrint();

       

      objExtendedPrint.DesignFileName = "xxxx";

      objExtendedPrint.SetupFileName = "xxxx"";

      objExtendedPrint.BasicConfigurationFile = "xxxx"";

      objExtendedPrint.OutputFileName = outf;

             

      objExtendedPrint.Go();

       

      "

       

      Now when objExtendedPrint.Go(); runs it throws me an exeception and says that "No license was found for Automation Pro"

       

      Someone had this problem before. It was working, but now it just gives me this error..

       

      Thanks!

        • 1. Re: Problem with automation pro license
          pedro_franca_costa

          So i define the path in another way in C# code.

          Tried to update Xpedition with update V14 and i still have the same problem.

           

          "

                          String SddHome = System.Environment.GetEnvironmentVariable("SDD_HOME");

           

           

                          if(SddHome==null)

                          {

                          var vxEnv= new MGCPCBReleaseEnvironmentLib.MGCPCBReleaseEnvServer();

                          vxEnv.SetEnvironment();

                          String VxVersion = vxEnv.sddVersion;

           

           

                          SddHome = vxEnv.sddHome;

                          int idx = SddHome.IndexOf("SDD_HOME");

                          SddHome = SddHome.Substring(0, idx).Replace("\\", "\\\\") + "SDD_HOME";

                          vxEnv.SetEnvironment(SddHome);

           

           

           

           

                          MessageBox.Show(SddHome);

          }

          "Untitled.jpg

          • 2. Re: Problem with automation pro license
            andrew_french

            Did you do anything to configure your developer environment to get this to run properly for you?  I have no idea what I'm doing wrong and have tried using the exact same code you have here in C# to set the SDD environment.

             

            I always crash on the line

            var vxEnv= new MGCPCBReleaseEnvironmentLib.MGCPCBReleaseEnvServer();

             

            An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in mscorlib.dll

            • 3. Re: Problem with automation pro license
              christianwagner

              Hello,

               

              I have the same problem with the ODBPPOutputEngine:

               

                          ExpeditionPCBApplication app = (ExpeditionPCBApplication)Marshal.GetActiveObject("MGCPCB.ExpeditionPCBApplication");

                          if (app != null)

                          {

                              IMGCPCBDocument doc = app.ActiveDocument;

                              int key = doc.Validate(0);

                              MGCPCBAutomationLicensing.Application licenseServer = new MGCPCBAutomationLicensing.Application();

                              int token = licenseServer.GetToken(key);

                              licenseServer = null;

                              int res = doc.Validate((int)token);

               

                              ODBPPOutputEngine oDBPPOutputEngine = new ODBPPOutputEngine();

                              oDBPPOutputEngine.DesignFileName = doc.FullName;

                              oDBPPOutputEngine.SetupFileName = @"C:\Temp\ODBSetup.ocf";

                              oDBPPOutputEngine.OutputJobName = "abc";

                              oDBPPOutputEngine.LogFileDirectory = @"C:\Temp\LogFile";

                              oDBPPOutputEngine.OutputPath = @"C:\temp\";

                              oDBPPOutputEngine.Go(); // here, i get the error message

                          }

               

              In the last code line I get the error message : "No license was found for Automation Pro".

               

              Can anybody help?

               

              Christian

              • 4. Re: Problem with automation pro license
                christianwagner

                We found the solution.

                 

                1. The message "No license was found for Automation Pro" had something nothing to do with the license.

                2. It is not recommended to install two versions of xpedition (on my side 2.1 and 2.3) and reference the lib. I think this was the reason for the error message.

                3. It´s very important to reference and set the mentor environment:

                            var envServerType = Type.GetTypeFromProgID("MGCPCBReleaseEnvironmentLib.MGCPCBReleaseEnvServer");

                            var envServer = Activator.CreateInstance(envServerType) as MGCPCBReleaseEnvServer;

                            envServer.SetEnvironment("C:\\MentorGraphics\\EEVX.2.3\\SDD_HOME");

                 

                And now the odb++ export is working.  (Thank you Peter :-) )