Ejemplo n.º 1
0
        public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
        {
            mainForm = new MainForm(commandData);
            Process process = Process.GetCurrentProcess();

            RevitManagement.SetCurrentDocument(commandData.Application.ActiveUIDocument.Document);
            RevitManagement.SetCurrentUIDocument(commandData.Application.ActiveUIDocument);

            IntPtr h = process.MainWindowHandle;

            mainForm.Topmost = true;
            mainForm.Show(); //Changed to modeless
            return(Result.Succeeded);
        }
Ejemplo n.º 2
0
        public void Execute(UIApplication app)
        {
            var _doc = app.ActiveUIDocument.Document;

            RevitManagement.SetCurrentDocument(_doc);
            RevitManagement.SetCurrentUIDocument(app.ActiveUIDocument);
            var changes = RevitManagement.ProcessLocalChanges();


            RevitManagement.changedElements = new List <ElementId>();
            MainForm.ClearChangedItems();

            if (changes == null)
            {
                return;
            }
            FireBaseConnection.SendChangesToDB(changes, null);
        }
Ejemplo n.º 3
0
        public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
        {
            _doc = commandData.Application.ActiveUIDocument.Document;
            RevitManagement.SetCurrentDocument(_doc);
            RevitManagement.SetCurrentUIDocument(commandData.Application.ActiveUIDocument);

            if (_doc.ActiveView.ViewType != ViewType.ThreeD)
            {
                var td = new TaskDialog("Wrong view type");
                td.MainInstruction = "Select a 3D View to start the app";
                td.Show();
                return(Result.Cancelled);
            }

            RevitManagement.SetView3D((View3D)_doc.ActiveView);
            ConnectToDB();
            App.ExportModelExternalEvent.Raise();
            return(Result.Succeeded);
        }
Ejemplo n.º 4
0
        public void Execute(UIApplication app)
        {
            var _doc = app.ActiveUIDocument.Document;

            RevitManagement.SetCurrentDocument(_doc);
            RevitManagement.SetCurrentUIDocument(app.ActiveUIDocument);

            if (_doc.ActiveView.ViewType != ViewType.ThreeD)
            {
                var td = new TaskDialog("Wrong view type");
                td.MainInstruction = "Select a 3D View to start the app";
                td.Show();
                return;
            }

            RevitManagement.SetView3D(_doc.ActiveView as View3D);
            var CurrentRootObject = RevitManagement.ProcessAllModel();

            FireBaseConnection.SendModelToDB(CurrentRootObject, "models", _doc.Title);
        }