Example #1
0
        public void EnvironmentOpening(AssemblyDocument asmDocument)
        {
            blueHighlightSet        = asmDocument.CreateHighlightSet();
            blueHighlightSet.Color  = InventorUtils.GetInventorColor(Color.DodgerBlue);
            greenHighlightSet       = asmDocument.CreateHighlightSet();
            greenHighlightSet.Color = InventorUtils.GetInventorColor(Color.LawnGreen);
            redHighlightSet         = asmDocument.CreateHighlightSet();
            redHighlightSet.Color   = InventorUtils.GetInventorColor(Color.Red);

            jointEditorHighlight       = asmDocument.CreateHighlightSet();
            jointEditorHighlight.Color = InventorUtils.GetInventorColor(RobotExporterAddInServer.Instance.AddInSettingsManager.JointHighlightColor);
        }
Example #2
0
        /// <summary>
        /// Gets the assembly document and makes the <see cref="DockableWindows"/>
        /// </summary>
        private void OpeningExporter()
        {
            //Gets the assembly document and creates dockable windows
            AsmDocument = (AssemblyDocument)MainApplication.ActiveDocument;
            Utilities.CreateDockableWindows(MainApplication);
            ChildHighlight       = AsmDocument.CreateHighlightSet();
            ChildHighlight.Color = Utilities.GetInventorColor(SynthesisGUI.PluginSettings.InventorChildColor);
            WheelHighlight       = AsmDocument.CreateHighlightSet();
            WheelHighlight.Color = Utilities.GetInventorColor(System.Drawing.Color.Green);

            //Sets up events for selecting and deselecting parts in inventor
            Utilities.GUI.jointEditorPane1.SelectedJoint            += SelectNodes;
            PluginSettingsForm.PluginSettingsValues.SettingsChanged += ExporterSettings_SettingsChanged;

            EnvironmentEnabled = true;

            // Load robot skeleton and prepare UI
            if (!Utilities.GUI.LoadRobotSkeleton())
            {
                ForceQuitExporter(AsmDocument);
                return;
            }

            disabledAssemblyOccurences = new List <ComponentOccurrence>();
            disabledAssemblyOccurences.AddRange(DisableUnconnectedComponents(AsmDocument));
            // If fails to load existing data, restart wizard
            if (!Utilities.GUI.LoadRobotData(AsmDocument))
            {
                Wizard.WizardForm wizard = new Wizard.WizardForm();
                wizard.ShowDialog();
                if (Properties.Settings.Default.ShowExportOrAdvancedForm)
                {
                    Form finishDialog = new Wizard.ExportOrAdvancedForm();
                    finishDialog.ShowDialog();
                }
                PendingChanges = true; // Force save button on since no data has been saved to this file
            }
            else
            {
                PendingChanges = false; // No changes are pending if data has been loaded
            }
            // Hide non-jointed components;

            // Reload panels in UI
            Utilities.GUI.ReloadPanels();
            Utilities.ShowDockableWindows();
        }