//private GroupClashesInterface groupClashesInterface;

        public override int Execute(params string[] parameters)
        {
            if (Autodesk.Navisworks.Api.Application.IsAutomated)
            {
                throw new InvalidOperationException("Invalid when running using Automation");
            }

            //Find the plugin
            PluginRecord pr = Application.Plugins.FindPlugin("GroupClashes.GroupClashesPane.BM42");

            if (pr != null && pr is DockPanePluginRecord && pr.IsEnabled)
            {
                //check if it needs loading
                if (pr.LoadedPlugin == null)
                {
                    pr.LoadPlugin();
                }

                DockPanePlugin dpp = pr.LoadedPlugin as DockPanePlugin;
                if (dpp != null)
                {
                    //switch the Visible flag
                    dpp.Visible = !dpp.Visible;
                }
            }

            //groupClashesInterface.ShowDialog();
            return(0);
        }
Exemple #2
0
        public override int ExecuteCommand(string name, params string[] parameters)
        {
            switch (name)
            {
            case "ID_Button_1":
                //Find the plugin
            {
                PluginRecord pr =
                    Autodesk.Navisworks.Api.Application.Plugins.FindPlugin("ENGyn.NW_GP_Dock.ENG");

                if (pr != null && pr is DockPanePluginRecord && pr.IsEnabled)
                {
                    //check if it needs loading
                    if (pr.LoadedPlugin == null)
                    {
                        pr.LoadPlugin();
                    }

                    DockPanePlugin dpp = pr.LoadedPlugin as DockPanePlugin;
                    if (dpp != null)
                    {
                        //switch the Visible flag
                        dpp.Visible = !dpp.Visible;
                    }
                }
            }
            break;
            }

            return(0);
        }
Exemple #3
0
        public override int Execute(params string[] parameters)
        {
            if (Autodesk.Navisworks.Api.Application.IsAutomated)
            {
                throw new InvalidOperationException("Invalid when running using Automation");
            }


            //Find the plugin
            PluginRecord pr =
                Autodesk.Navisworks.Api.Application.Plugins.FindPlugin("Navis2BCF.Plugin.CASE");

            if (pr != null && pr is DockPanePluginRecord && pr.IsEnabled)
            {
                Autodesk.Navisworks.Api.Application.Plugins.AddPluginAssembly(@"C:\Program Files\Autodesk\Navisworks Manage 2014\Plugins\Navis2BCF\Ionic.Zip.dll");

                //check if it needs loading
                if (pr.LoadedPlugin == null)
                {
                    string exeConfigPath = this.GetType().Assembly.Location;

                    pr.LoadPlugin();
                }

                DockPanePlugin dpp = pr.LoadedPlugin as DockPanePlugin;
                if (dpp != null)
                {
                    //switch the Visible flag
                    dpp.Visible = !dpp.Visible;
                }
            }
            return(0);
        }
        //function to remove duplicates and sort
        public static void RemoveDuplicates()
        {
            NoDuplicatesListofSafetyIssues = Result.ListofSafetyIssues.Distinct().ToList();
            ListofSafetyIssues.Clear();
            ListofSafetyIssues.AddRange(NoDuplicatesListofSafetyIssues);

            //sort the list
            ListofSafetyIssues.Sort((s1, s2) => s1.ProtStartDate.CompareTo(s2.ProtStartDate));
            NoDuplicatesListofSafetyIssues.Clear();

            //load the show report user control
            PluginRecord pr = Autodesk.Navisworks.Api.Application.Plugins.FindPlugin("MTechProject.LoadShowReport.SYSR");

            if (pr != null && pr is DockPanePluginRecord && pr.IsEnabled)
            {
                //The plugin might need to be loaded into the system
                if (pr.LoadedPlugin == null)
                {
                    pr.LoadPlugin();
                }
                //The plugin need to be casted into a more specific type
                DockPanePlugin dpp = pr.LoadedPlugin as DockPanePlugin;
                if (dpp != null)
                {
                    dpp.Visible = !dpp.Visible;
                }
            }
        }
        public override int Execute(params string[] parameters)
        {
            #region loadPlugin
            if (Autodesk.Navisworks.Api.Application.IsAutomated)
            {
                throw new InvalidOperationException("Invalid when running using Automation");
            }

            //Find the plugin
            PluginRecord pr = Autodesk.Navisworks.Api.Application.Plugins.FindPlugin("NavisCheckerSener.WPFDocPanePlugin.PML_Sener");

            if (pr != null && pr is DockPanePluginRecord && pr.IsEnabled)
            {
                //checks if it needs loading
                if (pr.LoadedPlugin == null)
                {
                    pr.LoadPlugin();
                }

                DockPanePlugin dpp = pr.LoadedPlugin as DockPanePlugin;
                if (dpp != null)
                {
                    //switch the Visible flag
                    dpp.Visible = !dpp.Visible;
                }
            }
            #endregion


            return(0);
        }
Exemple #6
0
        /// <summary>
        /// Launch
        /// </summary>
        public void LaunchPlugin()
        {
            // Running Navis
            if (Autodesk.Navisworks.Api.Application.IsAutomated)
            {
                throw new InvalidOperationException("Invalid when running using Automation");
            }

#if NAVIS2014
            string versionNumber = "2014";
#elif NAVIS2015
            string versionNumber = "2015";
#elif NAVIS2016
            string versionNumber = "2016";
#elif NAVIS2017
            string versionNumber = "2017";
#elif NAVIS2018
            string versionNumber = "2018";
#elif NAVIS2019
            string versionNumber = "2019";
#endif

            // Version
            if (!Autodesk.Navisworks.Api.Application.Version.RuntimeProductName.Contains(versionNumber))
            {
                MessageBox.Show(string.Format("Incompatible Navisworks Version" +
                                              "\nThis Add-In was built for Navisworks {0}, please go to the Arup Issue Tracker group in Yammer for assistance...", versionNumber),
                                "Cannot Continue!",
                                MessageBoxButtons.OK,
                                MessageBoxIcon.Error);
                return;
            }

            //Find the plugin
            PluginRecord pr = Autodesk.Navisworks.Api.Application.Plugins.FindPlugin("ARUP.IssueTracker.Navisworks.Plugin.CASE");

            if (pr != null && pr is DockPanePluginRecord && pr.IsEnabled)
            {
                if (!File.Exists(Utils.issueTrackerDllPath))
                {
                    MessageBox.Show("Required Issue Tracker Library Not Found");
                    return;
                }

                // check if it needs loading
                if (pr.LoadedPlugin == null)
                {
                    string exeConfigPath = GetType().Assembly.Location;
                    pr.LoadPlugin();
                }

                DockPanePlugin dpp = pr.LoadedPlugin as DockPanePlugin;
                if (dpp != null)
                {
                    //switch the Visible flag
                    dpp.Visible = !dpp.Visible;
                }
            }
        }
Exemple #7
0
        /// <summary>
        /// Launch
        /// </summary>
        public void LaunchPlugin()
        {
            // Running Navis
            if (Autodesk.Navisworks.Api.Application.IsAutomated)
            {
                throw new InvalidOperationException("Invalid when running using Automation");
            }

            // Version
            if (!Autodesk.Navisworks.Api.Application.Version.RuntimeProductName.Contains("2014"))
            {
                MessageBox.Show("Incompatible Navisworks Version" +
                                "\nThis Add-In was built for Navisworks 2014, please contact info@case-inc for assistance...",
                                "Cannot Continue!",
                                MessageBoxButtons.OK,
                                MessageBoxIcon.Error);
                return;
            }

            //Find the plugin
            PluginRecord pr = Autodesk.Navisworks.Api.Application.Plugins.FindPlugin("ARUP.IssueTracker.Navisworks.Plugin.CASE");

            if (pr != null && pr is DockPanePluginRecord && pr.IsEnabled)
            {
                /*
                 * string m_issuetracker = Path.Combine(ProgramFilesx86(), "CASE", "ARUP Issue Tracker", "ARUP.IssueTracker.dll");
                 * if (!File.Exists(m_issuetracker))
                 * {
                 *  MessageBox.Show("Required Issue Tracker Library Not Found");
                 *  return;
                 * }
                 * Assembly.LoadFrom(m_issuetracker);
                 */

                //check if it needs loading
                if (pr.LoadedPlugin == null)
                {
                    string exeConfigPath = GetType().Assembly.Location;
                    pr.LoadPlugin();
                }

                DockPanePlugin dpp = pr.LoadedPlugin as DockPanePlugin;
                if (dpp != null)
                {
                    //switch the Visible flag
                    dpp.Visible = !dpp.Visible;
                }
            }
        }
        public override int Execute(params string[] parameters)
        {
            //MessageBox.Show(Autodesk.Navisworks.Api.Application.Gui.MainWindow, "Chris Chen");

            /*
             * FormNavisworks f = new FormNavisworks();
             *
             * f.oDoc = Autodesk.Navisworks.Api.Application.ActiveDocument;
             * f.Show();
             */
            try
            {
                //Find the plugin
                PluginRecord pr =
                    Autodesk.Navisworks.Api.Application.Plugins.FindPlugin("ClassNavisRoomDFS.BIAD");


                if (pr != null && pr is DockPanePluginRecord && pr.IsEnabled)
                {
                    //check if it needs loading
                    if (pr.LoadedPlugin == null)
                    {
                        pr.LoadPlugin();
                    }

                    DockPanePlugin dpp = pr.LoadedPlugin as DockPanePlugin;
                    if (dpp != null)
                    {
                        //switch the Visible flag
                        dpp.Visible = !dpp.Visible;
                    }
                }
                else
                {
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message, ex.GetType().Name);
            }

            return(0);
        }
        /// <summary>
        /// Launch
        /// </summary>
        public void LaunchPlugin()
        {
            // Running Navis
            if (Autodesk.Navisworks.Api.Application.IsAutomated)
            {
                throw new InvalidOperationException("Invalid when running using Automation");
            }

            // Version
            if (!Autodesk.Navisworks.Api.Application.Version.RuntimeProductName.Contains(NavisVersion))
            {
                MessageBox.Show("Incompatible Navisworks Version" +
                                "\nThis Add-In was built for Navisworks " + NavisVersion + ", please contact info@case-inc for assistance...",
                                "Cannot Continue!",
                                MessageBoxButtons.OK,
                                MessageBoxIcon.Error);
                return;
            }

            //Find the plugin
            PluginRecord pr = Autodesk.Navisworks.Api.Application.Plugins.FindPlugin("Case.IssueTracker.Navisworks.Plugin.CASE");

            if (pr != null && pr is DockPanePluginRecord && pr.IsEnabled)
            {
                string m_issuetracker = "Case.IssueTracker.dll";

                //check if it needs loading
                if (pr.LoadedPlugin == null)
                {
                    pr.LoadPlugin();
                }

                DockPanePlugin dpp = pr.LoadedPlugin as DockPanePlugin;
                if (dpp != null)
                {
                    //switch the Visible flag
                    dpp.Visible = !dpp.Visible;
                }
            }
        }
Exemple #10
0
        /// <summary>
        /// Launch
        /// </summary>
        public void LaunchPlugin()
        {
            // Running Navis
            if (Autodesk.Navisworks.Api.Application.IsAutomated)
            {
                throw new InvalidOperationException("Invalid when running using Automation");
            }

            // Version
            if (!Autodesk.Navisworks.Api.Application.Version.RuntimeProductName.Contains(NavisVersion))
            {
                MessageBox.Show("This Add - In was built and tested only for Navisworks Manage  " + NavisVersion + ", proceed at your own risk",
                                "Untested Navisworks Version",
                                MessageBoxButtons.OK,
                                MessageBoxIcon.Warning);
            }

            //Find the plugin
            PluginRecord pr = Autodesk.Navisworks.Api.Application.Plugins.FindPlugin("Bcfier.AppMain.Bcfier");

            if (pr != null && pr is DockPanePluginRecord && pr.IsEnabled)
            {
                //string bcfier = "Bcfier.Navisworks.dll";

                //check if it needs loading
                if (pr.LoadedPlugin == null)
                {
                    pr.LoadPlugin();
                }

                DockPanePlugin dpp = pr.LoadedPlugin as DockPanePlugin;
                if (dpp != null)
                {
                    //switch the Visible flag
                    dpp.Visible = !dpp.Visible;
                }
            }
        }
        /// <summary>
        /// Launch Main Command
        /// </summary>
        public void LaunchNavis2Bcf()
        {
            // Don't Support Automation
            if (Autodesk.Navisworks.Api.Application.IsAutomated)
            {
                throw new InvalidOperationException("Invalid when running using Automation");
            }

            //Find the plugin
            PluginRecord m_pr = Autodesk.Navisworks.Api.Application.Plugins.FindPlugin("Navis2BCF.Plugin.CASE");

            if (m_pr != null && m_pr is DockPanePluginRecord && m_pr.IsEnabled)
            {
                //need to load the assebly from here otherwise navis will crash!
                string m_dllfolder = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "Ionic.Zip.dll");
                if (!File.Exists(m_dllfolder))
                {
                    MessageBox.Show("Required Ionic Library Not Found");
                    return;
                }
                Assembly.LoadFrom(m_dllfolder);

                // check if it needs loading
                if (m_pr.LoadedPlugin == null)
                {
                    string exeConfigPath = this.GetType().Assembly.Location;
                    m_pr.LoadPlugin();
                }

                DockPanePlugin m_dpp = m_pr.LoadedPlugin as DockPanePlugin;
                if (m_dpp != null)
                {
                    // switch the Visible flag
                    m_dpp.Visible = !m_dpp.Visible;
                }
            }
        }
Exemple #12
0
        public override int Execute(params string[] parameters)
        {
            if (Autodesk.Navisworks.Api.Application.IsAutomated)
            {
                throw new InvalidOperationException("Invalid when running using Automation");
            }



            //try {
            //       //Find the plugin
            PluginRecord pr =
                Autodesk.Navisworks.Api.Application.Plugins.FindPlugin("NW_GraphicPrograming.NW_GP_Dock.PRD");

            if (pr != null && pr is DockPanePluginRecord && pr.IsEnabled)
            {
                //check if it needs loading
                if (pr.LoadedPlugin == null)
                {
                    pr.LoadPlugin();
                }

                DockPanePlugin dpp = pr.LoadedPlugin as DockPanePlugin;
                if (dpp != null)
                {
                    //switch the Visible flag
                    dpp.Visible = !dpp.Visible;
                }
            }
            //}
            //catch
            //{
            //    MessageBox.Show("Error");

            //}
            return(0);
        }
Exemple #13
0
        public override int Execute(params string[] parameters)
        {
            // Starting new code for DockPanePlugin
            // Find the plugin first using its pluginId
            PluginRecord pr = Autodesk.Navisworks.Api.Application.Plugins.FindPlugin("MTechProject.LoadDockPane.SYPN");

            if (pr != null && pr is DockPanePluginRecord && pr.IsEnabled)
            {
                //The plugin might need to be loaded into the system
                if (pr.LoadedPlugin == null)
                {
                    pr.LoadPlugin();
                }
                //The plugin need to be casted into a more specific type
                DockPanePlugin dpp = pr.LoadedPlugin as DockPanePlugin;
                if (dpp != null)
                {
                    dpp.Visible = !dpp.Visible;
                }
            }
            //End of new code for DockPanePlugin

            return(0);
        }