Example #1
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);
        }
Example #2
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);
        }