/// <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")); }
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); }
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(); }
// 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; }
// 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(); }
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; }
/// <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."); }
/// <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."); }
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; }
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")); }
public SpatialFieldUpdater(MultithreadedCalculationContainer _container, AddInId addinId) { containerOld = _container; s_updaterId = new UpdaterId(addinId, new Guid("FBF2F6B2-4C06-42d4-97C1-D1B4EB593EFF")); }
/// <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); }
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 }
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}")); }
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}")); }
public CO2eFieldUpdater(AddInId id) { addinID = id; updaterID = new UpdaterId(addinID, new Guid("010275A1-6560-48DA-8F60-71472270A984")); }
internal SectionUpdater(AddInId addinID) { m_updaterId = new UpdaterId(addinID, new Guid("FBF3F6B2-4C06-42d4-97C1-D1B4EB593EFF")); }
// 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)); }
// 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; }
// 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")] }
public PBPAUpdater_Delete(AddInId addinID) { AddInId = addinID; UpdaterId = new UpdaterId(AddInId, new Guid("BBDC7AD2-A42C-426C-99BF-DBB78D3E9A25")); }
public PBPAUpdater_Edit(AddInId addinID) { AddInId = addinID; UpdaterId = new UpdaterId(AddInId, new Guid("AFDD17AB-210A-43A4-9F8C-6DBFD7608B1B")); }
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"); }
public UpdaterTest2(Guid commandId, Guid updaterId) { this.UpdaterId = new UpdaterId(new AddInId(commandId), updaterId); }
public TypeNamingUpdater(AddInId id) { appId = id; updaterId = new UpdaterId(appId, new Guid("702ee21d-110d-40db-b065-d9b08d9a7cab")); }
protected ElementTypeSpecificUpdater(AddInId id) { _id = id; _updaterId = new UpdaterId(_id, Guid.Parse("51c0be9b-07a8-443a-be8c-21db815b17e7")); }