public DynamoController_Revit(FSchemeInterop.ExecutionEnvironment env, DynamoUpdater updater, Type viewModelType, string context, IUnitsManager units)
            : base(env, viewModelType, context, new UpdateManager.UpdateManager(), units, new RevitWatchHandler(), Dynamo.PreferenceSettings.Load())
        {
            Updater = updater;

            dynRevitSettings.Controller = this;

            Predicate<NodeModel> requiresTransactionPredicate = node => node is RevitTransactionNode;
            CheckRequiresTransaction = new PredicateTraverser(requiresTransactionPredicate);

            Predicate<NodeModel> manualTransactionPredicate = node => node is Transaction;
            CheckManualTransaction = new PredicateTraverser(manualTransactionPredicate);

            dynSettings.Controller.DynamoViewModel.RequestAuthentication += RegisterSingleSignOn;

            AddPythonBindings();

            dynRevitSettings.Revit.Application.DocumentClosed += Application_DocumentClosed;
            dynRevitSettings.Revit.Application.DocumentOpened += Application_DocumentOpened;
            dynRevitSettings.Revit.ViewActivated += Revit_ViewActivated;

            //allow the showing of elements in context
            dynSettings.Controller.DynamoViewModel.CurrentSpaceViewModel.CanFindNodesFromElements = true;
            dynSettings.Controller.DynamoViewModel.CurrentSpaceViewModel.FindNodesFromElements = FindNodesFromSelection;

            MigrationManager.Instance.MigrationTargets.Add(typeof(WorkspaceMigrationsRevit));
            ElementNameStore = new Dictionary<ElementId, string>();
        }
        public DynamoController_Revit(FSchemeInterop.ExecutionEnvironment env, DynamoUpdater updater, Type viewModelType, string context)
            : base(env, viewModelType, context)
        {
            Updater = updater;

            dynRevitSettings.Controller = this;

            Predicate<NodeModel> requiresTransactionPredicate = node => node is RevitTransactionNode;
            CheckRequiresTransaction = new PredicateTraverser(requiresTransactionPredicate);

            Predicate<NodeModel> manualTransactionPredicate = node => node is Transaction;
            CheckManualTransaction = new PredicateTraverser(manualTransactionPredicate);

            dynSettings.Controller.DynamoViewModel.RequestAuthentication += RegisterSingleSignOn;

            AddPythonBindings();
            AddWatchNodeHandler();

            dynRevitSettings.Revit.Application.DocumentClosed += Application_DocumentClosed;
            dynRevitSettings.Revit.Application.DocumentOpened += Application_DocumentOpened;
            dynRevitSettings.Revit.ViewActivated += Revit_ViewActivated;

            //allow the showing of elements in context
            dynSettings.Controller.DynamoViewModel.CurrentSpaceViewModel.CanFindNodesFromElements = true;
            dynSettings.Controller.DynamoViewModel.CurrentSpaceViewModel.FindNodesFromElements = FindNodesFromSelection;
        }
        public DynamoController_Revit(FSchemeInterop.ExecutionEnvironment env, DynamoUpdater updater, Type viewModelType, string context, IUnitsManager units)
            : base(env, viewModelType, context, new UpdateManager.UpdateManager(), units, new RevitWatchHandler(), Dynamo.PreferenceSettings.Load())
        {
            Updater = updater;

            dynRevitSettings.Controller = this;

            Predicate <NodeModel> requiresTransactionPredicate = node => node is RevitTransactionNode;

            CheckRequiresTransaction = new PredicateTraverser(requiresTransactionPredicate);

            Predicate <NodeModel> manualTransactionPredicate = node => node is Transaction;

            CheckManualTransaction = new PredicateTraverser(manualTransactionPredicate);

            dynSettings.Controller.DynamoViewModel.RequestAuthentication += RegisterSingleSignOn;

            AddPythonBindings();

            dynRevitSettings.Revit.Application.DocumentClosed += Application_DocumentClosed;
            dynRevitSettings.Revit.Application.DocumentOpened += Application_DocumentOpened;
            dynRevitSettings.Revit.ViewActivated += Revit_ViewActivated;

            //allow the showing of elements in context
            dynSettings.Controller.DynamoViewModel.CurrentSpaceViewModel.CanFindNodesFromElements = true;
            dynSettings.Controller.DynamoViewModel.CurrentSpaceViewModel.FindNodesFromElements    = FindNodesFromSelection;

            MigrationManager.Instance.MigrationTargets.Add(typeof(WorkspaceMigrationsRevit));
            ElementNameStore = new Dictionary <ElementId, string>();
        }
Beispiel #4
0
        public DynamoController_Revit(FSchemeInterop.ExecutionEnvironment env, DynamoUpdater updater, Type viewModelType, string context)
            : base(env, viewModelType, context)
        {
            Updater = updater;

            dynRevitSettings.Controller = this;

            Predicate <NodeModel> requiresTransactionPredicate = node => node is RevitTransactionNode;

            CheckRequiresTransaction = new PredicateTraverser(requiresTransactionPredicate);

            Predicate <NodeModel> manualTransactionPredicate = node => node is Transaction;

            CheckManualTransaction = new PredicateTraverser(manualTransactionPredicate);

            dynSettings.Controller.DynamoViewModel.RequestAuthentication += RegisterSingleSignOn;

            AddPythonBindings();
            AddWatchNodeHandler();

            dynRevitSettings.Revit.Application.DocumentClosed += Application_DocumentClosed;
            dynRevitSettings.Revit.Application.DocumentOpened += Application_DocumentOpened;
            dynRevitSettings.Revit.ViewActivated += Revit_ViewActivated;

            //allow the showing of elements in context
            dynSettings.Controller.DynamoViewModel.CurrentSpaceViewModel.CanFindNodesFromElements = true;
            dynSettings.Controller.DynamoViewModel.CurrentSpaceViewModel.FindNodesFromElements    = FindNodesFromSelection;
        }
        public DynamoRevitViewModel(DynamoController controller) : base(controller)
        {
            Predicate <dynNodeModel> requiresTransactionPredicate = delegate(dynNodeModel node)
            {
                return(node is dynRevitTransactionNode);
            };

            checkRequiresTransaction = new PredicateTraverser(requiresTransactionPredicate);

            Predicate <dynNodeModel> manualTransactionPredicate = delegate(dynNodeModel node)
            {
                return(node is dynTransaction);
            };

            checkManualTransaction = new PredicateTraverser(manualTransactionPredicate);
        }