Beispiel #1
0
        /// <summary>
        /// Constructor to initialize the fields and create the winder stairs.
        /// It also registers the updater if addinId is not null.
        /// </summary>
        /// <param name="winder">Winder to create winder stairs</param>
        /// <param name="crvElements">Curve Elements to control the winder shape</param>
        /// <param name="rvtDoc">Revit Document</param>
        /// <param name="addinId">Active AddInId</param>
        /// <param name="drawSketch">Switch to control the winder sketch drawing</param>
        public WinderUpdater(Winder winder, IList <ElementId> crvElements,
                             Document rvtDoc, AddInId addinId, bool drawSketch)
        {
            m_curveElements = crvElements;
            m_winder        = winder;
            m_drawSketch    = drawSketch;

            // Create the winder stairs
            GenerateWinderStairs(rvtDoc);

            // Register the updater if addinId is not null.
            if (addinId != null)
            {
                // Register the updater
                m_updaterId = new UpdaterId(addinId, Guid.NewGuid());
                UpdaterRegistry.RegisterUpdater(this, rvtDoc);

                // Add modification triggers
                UpdaterRegistry.AddTrigger(m_updaterId, rvtDoc,
                                           m_curveElements, Element.GetChangeTypeAny());

                // Add deletion trigger
                List <ElementId> deleteParents = new List <ElementId>();
                deleteParents.AddRange(crvElements);
                var stairRun = rvtDoc.GetElement(m_winderRunId) as StairsRun;
                deleteParents.Add(stairRun.GetStairs().Id);
                UpdaterRegistry.AddTrigger(m_updaterId, rvtDoc,
                                           deleteParents, Element.GetChangeTypeElementDeletion());
            }
        }
 public SpatialFieldUpdater(AddInId id, ElementId sphere, ElementId view)
 {
     addinID   = id;
     sphereID  = sphere;
     viewID    = view;
     updaterID = new UpdaterId(addinID, new Guid("FBF2F6B2-4C06-42d4-97C1-D1B4EB593EFF"));
 }
 public PipeParameterUpdater(AddInId id, string excelFileFullName, string sheetName)
 {
     addinId    = id;
     updaterId  = new UpdaterId(addinId, new Guid("b0111042-f770-491b-b452-7353e49b2e35"));
     fullName   = excelFileFullName;
     sheet1Name = sheetName;
 }
        //Remove warning for needed add-in
        //public static void SetIsUpdaterOptional(UpdaterId id, bool isOptional);
        public RenameViewUpdater(AddInId id)
        {
            m_appId = id;
            m_updaterId = new UpdaterId(m_appId, new Guid("DA24DE4D-1440-467C-A50E-CF87F2AB9978"));

            //SetIsUpdaterOptional(m_updaterId, false);
        }
        public ElevationWatcherUpdater(AddInId id)
        {
            _appId = id;

            _updaterId = new UpdaterId(_appId, new Guid(
                                                   "fafbf6b2-4c06-42d4-97c1-d1b4eb593eff"));
        }
Beispiel #6
0
            public ElevationWatcherUpdater(AddInId id)
            {
                _appId = id;

                _updaterId = new UpdaterId(_appId, new Guid(
                                               "fafbf6b2-4c06-42d4-97c1-d1b4eb593eff"));
            }
Beispiel #7
0
 public DTMUpdater(AddInId addinId)
 {
     updaterId = new UpdaterId(addinId, updaterGuid);
     catDictionary.Add("Grids", BuiltInCategory.OST_Grids);
     catDictionary.Add("Levels", BuiltInCategory.OST_Levels);
     catDictionary.Add("Views", BuiltInCategory.OST_Views);
     catDictionary.Add("Scope Boxes", BuiltInCategory.OST_VolumeOfInterest);
     catDictionary.Add("RVT Links", BuiltInCategory.OST_RvtLinks);
 }
 public BrickDimUpdater(AddInId id)
 {
     addinID = id;
     // UpdaterId that is used to register and
     // unregister updaters and triggers
     updaterID = new UpdaterId(addinID, new Guid(
                                   "63CDBB88-5CC4-4ac3-AD24-52DD435AAB25"));
     Debug.Print("guid");
 }
        public static bool UnregisterUpdaters(Document doc, SheetManagerConfiguration config)
        {
            bool unregistered = false;

            try
            {
                IList <UpdaterInfo> registeredUpdaters = UpdaterRegistry.GetRegisteredUpdaterInfos(doc);
                var sheetUpdaterInfo = from updater in registeredUpdaters where updater.UpdaterName == "SheetDBUpdater" select updater;
                if (sheetUpdaterInfo.Count() > 0)
                {
                    foreach (UpdaterInfo info in sheetUpdaterInfo)
                    {
                        string    addInfo   = info.AdditionalInformation;
                        Guid      guid      = new Guid(addInfo);
                        UpdaterId updaterId = new UpdaterId(addinId, guid);
                        if (UpdaterRegistry.IsUpdaterRegistered(updaterId, doc))
                        {
                            if (sheetUpdaters.ContainsKey(config.ModelId))
                            {
                                sheetUpdaters[config.ModelId].CloseDataManager();
                                sheetUpdaters.Remove(config.ModelId);
                            }
                            UpdaterRegistry.UnregisterUpdater(updaterId, doc);
                            unregistered = true;
                        }
                    }
                }

                var revisionUpdaterInfo = from updater in registeredUpdaters where updater.UpdaterName == "RevisionDBUpdater" select updater;
                if (revisionUpdaterInfo.Count() == 0)
                {
                    foreach (UpdaterInfo info in revisionUpdaterInfo)
                    {
                        string    addInfo   = info.AdditionalInformation;
                        Guid      guid      = new Guid(addInfo);
                        UpdaterId updaterId = new UpdaterId(addinId, guid);
                        if (UpdaterRegistry.IsUpdaterRegistered(updaterId, doc))
                        {
                            if (revisionUpdaters.ContainsKey(config.ModelId))
                            {
                                revisionUpdaters[config.ModelId].CloseDataManager();
                                revisionUpdaters.Remove(config.ModelId);
                            }
                            UpdaterRegistry.UnregisterUpdater(updaterId, doc);

                            unregistered = true;
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show("Failed to unregister updaters.\n" + ex.Message, "Unregister Updaters", MessageBoxButton.OK, MessageBoxImage.Warning);
            }
            return(unregistered);
        }
Beispiel #10
0
        public RevisionUpdater(AddInId addInId, Guid updaterGuid, SheetManagerConfiguration config)
        {
            m_appId         = addInId;
            m_updaterId     = new UpdaterId(m_appId, updaterGuid);
            linkedProjectId = config.ModelId;
            configuration   = config;

            dataManager = new UpdaterDataManager(configuration.DatabaseFile);
            CollectRevisionParamIds();
        }
            public SimpleUpdater(
                Document doc,
                AddInId addInId)
            {
                _updater_id = new UpdaterId(
                    addInId, new Guid(Id));

                RegisterUpdater(doc);
                RegisterTriggers();
            }
Beispiel #12
0
        // constructor takes the AddInId for the add-in associated with this updater
        public DynamoUpdater(AddInId id, ControlledApplication app)
        {
            m_appId = id;
            m_updaterId = new UpdaterId(m_appId, new Guid("1F1F44B4-8002-4CC1-8FDB-17ACD24A2ECE")); //[Guid("1F1F44B4-8002-4CC1-8FDB-17ACD24A2ECE")]

            _updateDict[ChangeTypeEnum.Delete] = new Dictionary<ElementId, DynElementUpdateDelegate>();
            _updateDict[ChangeTypeEnum.Modify] = new Dictionary<ElementId, DynElementUpdateDelegate>();
            _updateDict[ChangeTypeEnum.Add] = new Dictionary<ElementId, DynElementUpdateDelegate>();

            app.DocumentChanged += Application_DocumentChanged;
        }
Beispiel #13
0
        // constructor takes the AddInId for the add-in associated with this updater
        public DynamoUpdater(AddInId id, ControlledApplication app)
        {
            m_appId     = id;
            m_updaterId = new UpdaterId(m_appId, new Guid("1F1F44B4-8002-4CC1-8FDB-17ACD24A2ECE")); //[Guid("1F1F44B4-8002-4CC1-8FDB-17ACD24A2ECE")]

            _updateDict[ChangeTypeEnum.Delete] = new Dictionary <ElementId, DynElementUpdateDelegate>();
            _updateDict[ChangeTypeEnum.Modify] = new Dictionary <ElementId, DynElementUpdateDelegate>();
            _updateDict[ChangeTypeEnum.Add]    = new Dictionary <ElementId, DynElementUpdateDelegate>();

            app.DocumentChanged += Application_DocumentChanged;
        }
        public SheetUpdater(AddInId addInId, Guid updaterGuid, SheetManagerConfiguration config)
        {
            m_appId         = addInId;
            m_updaterId     = new UpdaterId(m_appId, updaterGuid);
            linkedProjectId = config.ModelId;
            configuration   = config;

            dataManager        = new UpdaterDataManager(configuration.DatabaseFile);
            rvtSheetParameters = dataManager.GetSheetParameters();

            //update project id
            CollectSheetParamIds();
        }
Beispiel #15
0
        private PilingUpdater(AddInId id, PilingCoordinator coordinator)
        {
            if (id == null)
            {
                throw new ArgumentNullException(nameof(id));
            }

            if (coordinator == null)
            {
                throw new ArgumentNullException(nameof(coordinator));
            }

            _updaterId         = new UpdaterId(id, new Guid("ddb23f37-892e-4b43-9e8a-0ad8ff381b2b"));
            _pilingCoordinator = coordinator;
        }
Beispiel #16
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="addInId">Add-in id of the
        /// add-in associated with this updater.</param>
        public DeletionUpdater(AddInId addInId)
        {
            _appId = addInId;

            _updaterId = new UpdaterId(_appId, new Guid(
                                           "6f453eba-4b9a-40df-b637-eb72a9ebf008"));

            _failureId = new FailureDefinitionId(
                new Guid("33ba8315-e031-493f-af92-4f417b6ccf70"));

            FailureDefinition failureDefinition
                = FailureDefinition.CreateFailureDefinition(
                      _failureId, FailureSeverity.Error,
                      "PreventDeletion: Sorry, this element cannot be deleted. Please contact your BIM Manager to find out why.");
        }
Beispiel #17
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ElementProtectionUpdater"/> class.
        /// </summary>
        /// <param name="addInId">The AddinId of the active addin.</param>
        public ElementProtectionUpdater(AddInId addInId)
        {
            ElementProtectionUpdater.appId = addInId;

            this.updaterId           = new UpdaterId(appId, Guid.NewGuid());
            this.failureId           = new FailureDefinitionId(Guid.NewGuid());
            this.protectedElementIds = new List <ElementId>();

            FailureDefinition failureDefinition
                = FailureDefinition.CreateFailureDefinition(
                      this.failureId,
                      FailureSeverity.Error,
                      "PreventModification: Panel elements cannot currently be modified.\n" +
                      "Please make all element modifications before running framing creation.");
        }
Beispiel #18
0
        private CoordinatePilingUpdater(AddInId id, PilingCoordinator coordinator)
        {
            if (id == null)
            {
                throw new ArgumentNullException(nameof(id));
            }

            if (coordinator == null)
            {
                throw new ArgumentNullException(nameof(coordinator));
            }

            _updaterId         = new UpdaterId(id, new Guid("a066aabd-7ccd-43c3-9a86-b2089ebabb99"));
            _pilingCoordinator = coordinator;
        }
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="addInId">Add-in id of the 
        /// add-in associated with this updater.</param>
        public DeletionUpdater(AddInId addInId)
        {
            _appId = addInId;

            _updaterId = new UpdaterId(_appId, new Guid(
              "6f453eba-4b9a-40df-b637-eb72a9ebf008"));

            _failureId = new FailureDefinitionId(
              new Guid("33ba8315-e031-493f-af92-4f417b6ccf70"));

            FailureDefinition failureDefinition
              = FailureDefinition.CreateFailureDefinition(
                _failureId, FailureSeverity.Error,
                "PreventDeletion: Sorry, this element cannot be deleted. Please contact your BIM Manager to find out why.");
        }
        public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
        {
            //Excel名称及路径
            string fullName = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory) + @"\test\PlumbingCalc.xlsx";
            //string filePath = @"C:\Users\Administrator\Desktop\test\" + fileName + ".xlsx";
            //Sheet1名称
            string sheet1Name = "给排水工程量";
            //第一个单元格
            int startCol = 2;
            int startRow = 2;



            //实例化更新器
            Updater.PipeParameterUpdater ppu = new Updater.PipeParameterUpdater(commandData.Application.ActiveAddInId, fullName, sheet1Name);
            //更新器ID
            UpdaterId updaterId = ppu.GetUpdaterId();

            if (UpdaterRegistry.IsUpdaterRegistered(updaterId))
            {
                if (UpdaterRegistry.IsUpdaterEnabled(updaterId))
                {
                    UpdaterRegistry.DisableUpdater(updaterId);
                }
                else
                {
                    Tool.ExcelTool excelTool = new Tool.ExcelTool();
                    excelTool.UpdataInOpenWorkBook(commandData.Application.ActiveUIDocument.Document, fullName, sheet1Name, startRow, startCol);


                    UpdaterRegistry.EnableUpdater(updaterId);
                }
            }
            else
            {
                message = "未能启动更新器,请联系XXX";
                return(Result.Failed);
            }


            return(Result.Succeeded);
        }
 public LocationUpdater(AddInId id)
 {
     m_appId = id;
     m_updaterId = new UpdaterId(m_appId, new Guid("42ac4134-15dd-466e-93c9-4a1dc5d863ce"));
 }
Beispiel #22
0
 public SpatialFieldUpdater(MultithreadedCalculationContainer _container, AddInId addinId)
 {
     containerOld = _container;
     s_updaterId = new UpdaterId(addinId, new Guid("FBF2F6B2-4C06-42d4-97C1-D1B4EB593EFF"));
 }
Beispiel #23
0
 /// <summary>
 /// Constructor 
 /// </summary>
 public WindowDoorUpdater(AddInId id)
 {
   m_updaterId = new UpdaterId(id, new Guid("EF43510F-38CB-4980-844C-72174A674D56"));
 }
 public CompoundStructureUpdater(Guid _uid)
 {
     this.UpdaterId = new UpdaterId(new AddInId(new Guid("BBC4E9C2-AD73-4F13-9D70-6CAFAFAE35CC")), _uid);
 }
Beispiel #25
0
 internal DummyUpdater( AddInId addinID )
 {
     _updaterId = new UpdaterId( addinID, _guid );
 }
 public ParameterUpdater(Guid guid)
 {
     _uid = new UpdaterId(new AddInId(
                              new Guid("c1f5f009-8ba9-4f1d-b0fb-ba41a0f69942")), // addin id
                          guid);                                                 // updater id
 }
Beispiel #27
0
 public RoomUpdater(AddInId addInId)
 {
     m_addInId   = addInId;
     m_updaterId =
         new UpdaterId(m_addInId, new Guid("6945200D-DB7F-489D-8578-6C8E9A31D81A"));
 }
        /***********************************************************************************************************************/


        internal UpdaterAdded(AddInId addInId)
        {
            _updaterId = new UpdaterId(addInId, new Guid("{CD811131-3D32-4C44-B995-A0167FA85703}"));
        }
Beispiel #29
0
 public PlaneTypeUpdater(AddInId id)
 {
     appId     = id;
     updaterId = new UpdaterId(appId, new Guid("c8eda7b3-a1fd-496c-8e98-0438a2f8c9dd"));
 }
        /***********************************************************************************************************************/


        internal UpdaterModified(AddInId addInId)
        {
            _updaterId = new UpdaterId(addInId, new Guid("{1C79F0B7-8D98-44BC-96D8-0A20823CD50A}"));
        }
Beispiel #31
0
 public CO2eFieldUpdater(AddInId id)
 {
     addinID = id;
     updaterID = new UpdaterId(addinID, new Guid("010275A1-6560-48DA-8F60-71472270A984"));
 }
Beispiel #32
0
 internal SectionUpdater(AddInId addinID)
 {
     m_updaterId = new UpdaterId(addinID, new Guid("FBF3F6B2-4C06-42d4-97C1-D1B4EB593EFF"));
 }
Beispiel #33
0
 // constructor takes the AddInId for the add-in associated with this updater
 public PhaseGraphicsUpdater(AddInId id)
 {
     m_appId = id;
     m_updaterId = new UpdaterId(m_appId, new Guid(PhaseGraphicsGUID));
 }
Beispiel #34
0
 public SpatialFieldUpdater(AddInId id, ElementId sphere, ElementId view)
 {
     addinID = id;
      sphereID = sphere;
      viewID = view;
      updaterID = new UpdaterId(addinID, new Guid("FBF2F6B2-4C06-42d4-97C1-D1B4EB593EFF"));
 }
Beispiel #35
0
 // constructor takes the AddInId for the add-in associated with this updater
 public WallUpdater(AddInId id, Form1 form)
 {
     m_appId     = id;
     m_updaterId = new UpdaterId(m_appId, new Guid("890b1c75-0be7-4782-b8ad-2125032e7feb"));
     form1       = form;
 }
Beispiel #36
0
 // constructor takes the AddInId for the add-in associated with this updater
 public DynamoUpdater(AddInId id)
 {
     m_appId     = id;
     m_updaterId = new UpdaterId(m_appId, new Guid("1F1F44B4-8002-4CC1-8FDB-17ACD24A2ECE")); //[Guid("1F1F44B4-8002-4CC1-8FDB-17ACD24A2ECE")]
 }
Beispiel #37
0
 public SpatialFieldUpdater(MultithreadedCalculationContainer _container, AddInId addinId)
 {
     containerOld = _container;
     s_updaterId  = new UpdaterId(addinId, new Guid("FBF2F6B2-4C06-42d4-97C1-D1B4EB593EFF"));
 }
Beispiel #38
0
 public PBPAUpdater_Delete(AddInId addinID)
 {
     AddInId   = addinID;
     UpdaterId = new UpdaterId(AddInId, new Guid("BBDC7AD2-A42C-426C-99BF-DBB78D3E9A25"));
 }
Beispiel #39
0
 public PBPAUpdater_Edit(AddInId addinID)
 {
     AddInId   = addinID;
     UpdaterId = new UpdaterId(AddInId, new Guid("AFDD17AB-210A-43A4-9F8C-6DBFD7608B1B"));
 }
Beispiel #40
0
 internal SectionUpdater(AddInId addinID)
 {
     m_updaterId = new UpdaterId(addinID, new Guid("FBF3F6B2-4C06-42d4-97C1-D1B4EB593EFF"));
      m_schemaId = new Guid("4DE4BE80-0857-4785-A7DF-8A8918851CB2");
 }
Beispiel #41
0
 internal SectionUpdater(AddInId addinID)
 {
     m_updaterId = new UpdaterId(addinID, new Guid("FBF3F6B2-4C06-42d4-97C1-D1B4EB593EFF"));
     m_schemaId  = new Guid("4DE4BE80-0857-4785-A7DF-8A8918851CB2");
 }
Beispiel #42
0
 public UpdaterTest2(Guid commandId, Guid updaterId)
 {
     this.UpdaterId = new UpdaterId(new AddInId(commandId), updaterId);
 }
Beispiel #43
0
 public TypeNamingUpdater(AddInId id)
 {
     appId     = id;
     updaterId = new UpdaterId(appId, new Guid("702ee21d-110d-40db-b065-d9b08d9a7cab"));
 }
Beispiel #44
0
 protected ElementTypeSpecificUpdater(AddInId id)
 {
     _id = id;
     _updaterId = new UpdaterId(_id, Guid.Parse("51c0be9b-07a8-443a-be8c-21db815b17e7"));
 }
Beispiel #45
0
 /// <summary>
 /// Constructor
 /// </summary>
 public WindowDoorUpdater(AddInId id)
 {
     m_updaterId = new UpdaterId(id, new Guid("EF43510F-38CB-4980-844C-72174A674D56"));
 }
Beispiel #46
0
 // constructor takes the AddInId for the add-in associated with this updater
 public DynamoUpdater(AddInId id)
 {
     m_appId = id;
     m_updaterId = new UpdaterId(m_appId, new Guid("1F1F44B4-8002-4CC1-8FDB-17ACD24A2ECE")); //[Guid("1F1F44B4-8002-4CC1-8FDB-17ACD24A2ECE")]
 }