Example #1
0
 public int OnDocChange()
 {
     currentRobot = null;
         currentDoc = null;
         ModelDoc2 activeDoc = iSwApp.ActiveDoc;
         if (activeDoc.GetType() == (int)swDocumentTypes_e.swDocASSEMBLY)
         {
             currentDoc = (AssemblyDoc)activeDoc;
             currentDoc.DestroyNotify2 += new DAssemblyDocEvents_DestroyNotify2EventHandler(OnDocClose);
             currentRobot = new RobotModel(currentDoc, iSwApp);
             if (manager != null && manager.Visible == true)
             {
                 manager.Close();
             }
             if (settings!= null && settings.Visible == true)
             {
                 settings.Close();
             }
             if (exporter != null && !exporter.IsClosed())
             {
                 exporter.CloseExporter();
                 exporter = null;
             }
             manager = new ManageRobot(currentRobot);
             settings = new SettingsForm(manager);
         }
     RobotInfo.WriteToLogFile("Doc changed (SwAddin)");
     return 0;
 }
Example #2
0
        public int OnDocClose(int destroyType)
        {
            if (manager != null && manager.Visible == true)
            {
                manager.Close();
                manager = null;
            }
            if (settings.Visible == true)
            {
                settings.Close();
                settings = null;
            }
            if (exporter != null && !exporter.IsClosed())
            {
                exporter.CloseExporter();
                exporter = null;
            }
            currentRobot = null;

            RobotInfo.WriteToLogFile("Doc closed (SwAddin)\n");
            return 0;
        }
Example #3
0
 /// <summary>
 /// This method is called when the Export button is clicked by the user.
 /// </summary>
 public void exportCB()
 {
     RobotInfo.WriteToLogFile("\nExport Button Pressed (SwAddin)");
     if (exporter == null || exporter.IsClosed())
     {
         exporter = new Exporter(currentRobot);
         exporter.RunExportSequence();
     }
     else
         exporter.BringToFront();
 }