private void OnAppInitalized(object sender, ApplicationInitializedEventArgs e) { Autodesk.Revit.ApplicationServices.Application app = sender as Autodesk.Revit.ApplicationServices.Application; uiApp = new UIApplication(app); }
private void EventAppInitialize(object sender, ApplicationInitializedEventArgs arg) { CreatePushButton(); if (CheckNetworkConnection()) { toolManager.FindOutDatedTools(); } }
void OnApplicationInitialized( object sender, ApplicationInitializedEventArgs e) { // `sender` is an Application instance: Application app = sender as Application; ExportLinkedInIfcDocs(app); }
public static void FairApplicationInitialized(object sender, ApplicationInitializedEventArgs e) { RibbonTab fairTab = null; RibbonPanel fairPanel = null; RibbonItem fairButton = null; foreach (var tab in ComponentManager.Ribbon.Tabs) { if (tab.Id == Ribbon.RibbonTabName) { fairTab = tab; Messaging.DebugMessage($"Found Tab: {fairTab}"); foreach (var panel in tab.Panels) { if (panel.Source.Title == "FairPanel") { fairPanel = panel; Messaging.DebugMessage($"Found Panel: {fairPanel}"); foreach (var item in panel.Source.Items) { if (item.Id == "CustomCtrl_%CustomCtrl_%Selection Monitor%FairPanel%FairButtonItem") { fairButton = item; Messaging.DebugMessage($"Found Button: {fairButton}"); break; } } } } break; } } if (fairPanel != null && fairButton != null) { var position = RibbonUtilities.GetPositionBeforeButton("ID_REVIT_FILE_PRINT"); RibbonUtilities.PlaceButtonOnQuickAccess(position, fairButton); RibbonUtilities.RemovePanelFromTab(fairTab, fairPanel); RibbonUtilities.RemoveTabFromRibbon(fairTab); } }
private void ApplicationInitialized(object sender, ApplicationInitializedEventArgs e) { // Register the IFC Entity selection server SingleServerService entUIService = ExternalServiceRegistry.GetService(ExternalServices.BuiltInExternalServices.IFCEntityTreeUIService) as SingleServerService; if (entUIService != null) { try { IFCEntityTree.BrowseIFCEntityServer browseIFCEntityServer = new IFCEntityTree.BrowseIFCEntityServer(); entUIService.AddServer(browseIFCEntityServer); entUIService.SetActiveServer(browseIFCEntityServer.GetServerId()); } catch {} } }
void OnApplicationInitialized( object sender, ApplicationInitializedEventArgs e) { // Create our custom external event. _event = ExternalEvent.Create( new ModificationLogger()); // Start a thread to raise it regularly. _thread = new Thread( TriggerModificationLogger); _thread.Start(); }
void OnApplicationInitialized( object sender, ApplicationInitializedEventArgs e) { // Sender is an Application instance: Application app = sender as Application; Document doc = app.OpenDocumentFile(_model_path); if (doc == null) { throw new InvalidOperationException( "Could not open document."); } Execute(doc); }
void OnApplicationInitialized(object sender, ApplicationInitializedEventArgs e) { try { client = new MongoClient(); var database = client.GetDatabase("my_database"); collection = database.GetCollection <BsonDocument>("collabrequests"); // Sender is an Application instance: Autodesk.Revit.ApplicationServices.Application app = sender as Autodesk.Revit.ApplicationServices.Application; UIApplication uiapp = new UIApplication(app); current = searchQueue(); needsCollaboration(sender); } catch (Exception err) { Console.Write(err.ToString()); } }
void OnApplicationInitialized( object sender, ApplicationInitializedEventArgs e) { // This does not work, because the sender is // an Application instance, not UIApplication. //UIApplication uiapp = sender as UIApplication; // Sender is an Application instance: Application app = sender as Application; // However, UIApplication can be // instantiated from Application. UIApplication uiapp = new UIApplication(app); uiapp.OpenAndActivateDocument( _test_project_filepath); }
/// <summary> /// Reads in the XML Settings file. /// </summary> private void ReadAddinSettingsOnInitialized(object source, ApplicationInitializedEventArgs args) { try { //read list of tools csvFileName = "HOK" + versionNumber + "Addins.csv"; csvFileName = Path.Combine(addinResources, csvFileName); if (File.Exists(csvFileName)) { addins.AddinCollection = CsvUtil.ReadAddInList(csvFileName, sourceDirectory, installDirectory); } //override settings settingPath = Path.Combine(installDirectory, settingFile); SettingUtil.ReadConfig(settingPath, ref addins); //add addins addins.AddinCollection.Where(x => x.ToolLoadType == LoadType.Always).ToList().ForEach(AddPlugin); } catch (Exception ex) { Log.AppendLog(LogMessageType.EXCEPTION, ex.Message); } }
private void OnAppInitalized(object sender, ApplicationInitializedEventArgs e) { Application app = sender as Application; UiApp = new UIApplication(app); }
/// <summary> /// Called when [application initialized]. /// </summary> /// <param name="sender">The sender.</param> /// <param name="args">The <see cref="Autodesk.Revit.DB.Events.ApplicationInitializedEventArgs" /> instance containing the event data.</param> /// ReSharper disable once MemberCanBeMadeStatic.Local private void OnApplicationInitialized(object sender, ApplicationInitializedEventArgs args) { // TODO: add you code here }
private static void ControlledApplicationOnApplicationInitialized([NotNull] object sender, [NotNull] ApplicationInitializedEventArgs applicationInitializedEventArgs) { // If the Application or UIApplication objects are needed in any services, they can be added to the IoC container as follows // The method should be made non-static if this is needed /* * var application = (Application)sender; * var uiApplication = new UIApplication(application); * * var containerBuilder = new ContainerBuilder(); * * containerBuilder.RegisterInstance(application).SingleInstance(); * containerBuilder.RegisterInstance(uiApplication).SingleInstance(); * * containerBuilder.RegisterModule<CommandModule>(); * containerBuilder.RegisterModule<MainModule>(); * * var container = containerBuilder.Build(); * * _autofacScope = container.BeginLifetimeScope(); */ }
private void EventAppInitialize(object sender, ApplicationInitializedEventArgs arg) { CreatePushButton(); }
protected override void OnApplicationInitialized(object sender, ApplicationInitializedEventArgs e) { base.OnApplicationInitialized(sender, e); }
public void OnInitialized(object sender, ApplicationInitializedEventArgs args) { KPLNDataBase.DbControll.Update(); }
///// <summary> ///// Return the full add-in assembly folder path. ///// </summary> //public static string Path //{ // get // { // return System.IO.Path.GetDirectoryName( // Assembly.GetExecutingAssembly().Location ); // } //} void OnApplicationInitialized( object sender, ApplicationInitializedEventArgs e) { throw new NotImplementedException(); }
private void HandleApplicationInitializedEvent(object sender, ApplicationInitializedEventArgs e) { Autodesk.Revit.ApplicationServices.Application app = sender as Autodesk.Revit.ApplicationServices.Application; EditWindowParametersMethod(app, projectPath); }
void OnApplicationInitialized(object sender, ApplicationInitializedEventArgs e) { }