/// <summary>
        /// Constructor
        /// </summary>
        /// <param name="commandData">Revit command data</param>
        /// <param name="importFormat">Format to import</param>
        public ImportImageData(ExternalCommandData commandData, ImportFormat importFormat)
            : base(commandData, importFormat)
        {
            if (OptionalFunctionalityUtils.IsPDFImportAvailable())
            {
                m_filter = "All Image Files (*.bmp, *.gif, *.jpg, *.jpeg, *.pdf, *.png, *.tif)|*.bmp;*.gif;*.jpg;*.jpeg;*.pdf;*.png;*.tif";
            }
            else
            {
                m_filter = "All Image Files (*.bmp, *.gif, *.jpg, *.jpeg, *.png, *.tif)|*.bmp;*.gif;*.jpg;*.jpeg;*.png;*.tif";
            }

            m_title = "Import Image";
        }
Example #2
0
        public Result Execute(
            ExternalCommandData commandData,
            ref string message,
            ElementSet elements)
        {
#if !VERSION2014
            Debug.Print("Version 2013");
#else
            Debug.Print("Version 2014");
#endif // VERSION2014
            UIApplication uiapp = commandData.Application;
            UIDocument    uidoc = uiapp.ActiveUIDocument;
            Application   app   = uiapp.Application;
            Document      doc   = uidoc.Document;

            bool isNavisAvailable = OptionalFunctionalityUtils.IsNavisworksExporterAvailable();
            if (isNavisAvailable)
            {
                _default3dView = new FilteredElementCollector(doc).OfClass(typeof(View3D)).FirstElement() as View3D;

                NavisworksExportOptions neo = new NavisworksExportOptions();
                m_neo                      = neo;
                m_neo.ExportScope          = NavisworksExportScope.View;
                m_neo.FindMissingMaterials = false;

                Form1 formDialog = new Form1(doc, m_neo);
                System.Windows.Forms.DialogResult dr = formDialog.ShowDialog();

                if (dr == System.Windows.Forms.DialogResult.OK)
                {
                    return(Result.Succeeded);
                }
                else
                {
                    return(Result.Cancelled);
                }
            }
            else
            {
                TaskDialog.Show("Error", "No Compatible Navisworks plugins found. Please install a compatible Navisworks exporter to use with Revit.");
                return(Result.Failed);
            }
        }
Example #3
0
        public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
        {
            UIApplication uiapp = commandData.Application;
            UIDocument    uidoc = uiapp.ActiveUIDocument;
            Application   app   = uiapp.Application;
            Document      doc   = uidoc.Document;

            if (OptionalFunctionalityUtils.IsNavisworksExporterAvailable() == false)
            {
                TaskDialog.Show("Error", "No Compatible Navisworks plugins found. Please install a compatible Navisworks exporter to use with Revit.");
                return(Result.Failed);
            }
            else
            {
                doc.DocumentSaved += new EventHandler <DocumentSavedEventArgs>(Helpers.OnDocumentSaved);
                app.DocumentSynchronizedWithCentral += new EventHandler <DocumentSynchronizedWithCentralEventArgs>(Helpers.OnDocumentSynchronized);

                List <RibbonPanel> ribbons = uiapp.GetRibbonPanels();
                foreach (RibbonPanel p in ribbons)
                {
                    if (p.Name == "NWC View Exporter")
                    {
                        IList <RibbonItem> items = p.GetItems();
                        foreach (PushButton pb in items)
                        {
                            if (pb.Name == "Subscribe")
                            {
                                pb.Enabled = false;
                            }
                            if (pb.Name == "Unsubscribe")
                            {
                                pb.Enabled = true;
                            }
                        }
                    }
                }


                return(Result.Succeeded);
            }
        }