public void HandleApplicationInitializedEvent(object sender, Autodesk.Revit.DB.Events.ApplicationInitializedEventArgs e) { Application app = sender as Application; DesignAutomationData data = new DesignAutomationData(app, "C:\\Program Files\\Autodesk\\Revit 2019\\Samples\\Entry Door Handle 2018.rfa"); UpgradeFile(data); }
private void DockablePaneRegisters(object sender, Autodesk.Revit.DB.Events.ApplicationInitializedEventArgs e) { // Register dockable pane. var registercommand = new Main.Register(); registercommand.Execute(new UIApplication(sender as Application)); }
public void HandleApplicationInitializedEvent(object sender, Autodesk.Revit.DB.Events.ApplicationInitializedEventArgs e) { Autodesk.Revit.ApplicationServices.Application app = sender as Autodesk.Revit.ApplicationServices.Application; DesignAutomationData data = new DesignAutomationData(app, "C:\\Program Files\\Autodesk\\Revit 2019\\Samples\\WindowFamilyTmp.rft"); CreateWindowFamily(data); }
public void HandleApplicationInitializedEvent(object sender, Autodesk.Revit.DB.Events.ApplicationInitializedEventArgs e) { Autodesk.Revit.ApplicationServices.Application app = sender as Autodesk.Revit.ApplicationServices.Application; DesignAutomationData data = new DesignAutomationData(app, Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), "sdk/csharp/src/revit/HyparRevitApp/hypar.rvt")); CreateHyparModel(data); }
public void HandleApplicationInitializedEvent(object sender, Autodesk.Revit.DB.Events.ApplicationInitializedEventArgs e) { var app = sender as Autodesk.Revit.ApplicationServices.Application; DesignAutomationData data = new DesignAutomationData(app, "InputFile.rvt"); this.ExportFBX(data); }
private void ApplicationInitialized(object sender, Autodesk.Revit.DB.Events.ApplicationInitializedEventArgs e) { if (app != null) { Proxy.OnStartup(app); } }
public void HandleApplicationInitializedEvent(object sender, Autodesk.Revit.DB.Events.ApplicationInitializedEventArgs e) { Application app = sender as Application; String filePath = Directory.GetCurrentDirectory() + @"\Change to your local legacy RFA file for local test"; DesignAutomationData data = new DesignAutomationData(app, filePath); UpgradeFile(data); }
public void HandleApplicationInitializedEvent(object sender, Autodesk.Revit.DB.Events.ApplicationInitializedEventArgs e) { Autodesk.Revit.ApplicationServices.Application app = sender as Autodesk.Revit.ApplicationServices.Application; String filePath = Directory.GetCurrentDirectory() + "\\WindowFamilyTmp.rft"; DesignAutomationData data = new DesignAutomationData(app, filePath); CreateWindowFamily(data); }
public void HandleApplicationInitializedEvent(object sender, Autodesk.Revit.DB.Events.ApplicationInitializedEventArgs e) { Autodesk.Revit.ApplicationServices.Application app = sender as Autodesk.Revit.ApplicationServices.Application; // We don't need to provide the file DesignAutomationData data = new DesignAutomationData(app, "C:\\tmp\\FindColumns-Basic.rvt"); FindColumnsIOMain(data.RevitDoc); }
void application_ApplicationInitialized(object sender, Autodesk.Revit.DB.Events.ApplicationInitializedEventArgs e) { Server.Server server = new Server.Server(); Autodesk.Revit.DB.CodeChecking.Service.AddServer(server); //Updater updater = new Updater(); //UpdaterRegistry.RegisterUpdater(updater); //UpdaterRegistry.AddTrigger(updater.GetUpdaterId(), new ElementClassFilter(typeof(FamilyInstance)), Element.GetChangeTypeGeometry()); }
private void ControlledApplication_ApplicationInitialized(object sender, Autodesk.Revit.DB.Events.ApplicationInitializedEventArgs e) { Application app = sender as Application; UIApplication uiapp = new UIApplication(app); Runner.ReadConfig(); if (Runner.Config.autoStart) { Runner.Launch(uiapp); } }
//local test entry point public void HandleApplicationInitializedEvent(object sender, Autodesk.Revit.DB.Events.ApplicationInitializedEventArgs e) { try { Autodesk.Revit.ApplicationServices.Application app = sender as Autodesk.Revit.ApplicationServices.Application; DesignAutomationData data = new DesignAutomationData(app, @"c:\temp\rac_advanced_sample_project.rvt"); //DesignAutomationData data = new DesignAutomationData(app, @"c:\temp\result.rvt"); DoJob(data); } catch (Exception) { throw new InvalidOperationException("Could not ini application!"); } }
private void ControlledApplication_ApplicationInitialized(object sender, Autodesk.Revit.DB.Events.ApplicationInitializedEventArgs e) { RevitApplicationService = sender as Autodesk.Revit.ApplicationServices.Application; sQLiteConnection = FamFactoryDataSet.GetSQlteConnection(@"c:\temp\famFactoryDatabase.db"); famFactoryDataSet = new DataSet("famFactoryDatabase"); string file = @"c:\temp\famFactoryDatabase.db"; if (!System.IO.File.Exists(file)) { FamFactoryDataSet.CreateSQliteDataBase(file, Resources.FamFactoryDBTables, famFactoryDataSet); FamFactoryDataSet.InstallRequierments(sQLiteConnection, famFactoryDataSet); } else { FamFactoryDataSet.InitilizeDataSet(famFactoryDataSet); } // Authenticate with username and pass to get User object. // Create FamfactoryObject with authenticated User. User user = FamFactoryDataSet.AuthenticateUser("Admin", "Password", sQLiteConnection); famFactoryManager = new FamFactoryViewModel(famFactoryDataSet, sQLiteConnection, user, RevitApplicationService); //installationConfiguration = new DataProvidor.Installation.InstallationConfiguration(); //installationConfiguration.Load("config.xml"); //famFactoryDBContext = ModBox.FamFactory.DataProvidor.FamFactoryDBContext.Instance(installationConfiguration.connectionData); //famFactoryViewModel = new ObjectControls.FamFactoryViewModel(famFactoryDBContext); //if (string.IsNullOrEmpty(ReadWriteProperteis.AuthenticationKey) || string.IsNullOrEmpty(ReadWriteProperteis.UserName)) //{ // LogIn(famFactoryDBContext, true); //} //else //{ // activeUser = famFactoryDBContext.AuthenticateUser(ReadWriteProperteis.UserName, ReadWriteProperteis.AuthenticationKey); // TaskDialog taskDialog = new TaskDialog("Logged In"); // if (activeUser != null && activeUser.IsAuthenticated == true) // { // activeUser.LogIn(); // taskDialog.Show(); // } //} }
/// <summary> /// Register dockable panes in zero state document. /// </summary> /// <param name="sender">The sender.</param> /// <param name="e">The <see cref="Autodesk.Revit.DB.Events.ApplicationInitializedEventArgs"/> instance containing the event data.</param> /// <exception cref="System.NotImplementedException"></exception> private void DockablePaneRegisters(object sender, Autodesk.Revit.DB.Events.ApplicationInitializedEventArgs e) { // Register dockable pane. var familyManagerRegisterCommand = new RegisterFamilyManagerCommand(); familyManagerRegisterCommand.Execute(new UIApplication(sender as Application)); if (!PreferencesFileExists()) { // Create preference file with only one "MyDocuments" repository path. // This represents a default repository if file doesn't exsist. var prefs = new Preferences { Repository = new List <string> { // Add Documents directory as default repository path. Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), } }; prefs.Save(); } }
//Revit初始化事件 private void ControlledApplication_ApplicationInitialized(object sender, Autodesk.Revit.DB.Events.ApplicationInitializedEventArgs e) { Autodesk.Revit.ApplicationServices.Application app = sender as Autodesk.Revit.ApplicationServices.Application; uiapp = new UIApplication(app); uiapp.Idling += Uiapp_Idling; }
void OnApplicationInitialized(object sender, Autodesk.Revit.DB.Events.ApplicationInitializedEventArgs e) { // Find a system ribbon tab and panel to house // our API items // Also find our API tab, panel and button within // the Autodesk.Windows.RibbonControl context adWin.RibbonControl adWinRibbon = adWin.ComponentManager.Ribbon; adWin.RibbonTab adWinSysTab = null; adWin.RibbonPanel adWinSysPanel = null; adWin.RibbonTab adWinApiTab = null; adWin.RibbonPanel adWinApiPanel = null; adWin.RibbonItem adWinApiItem = null; foreach (adWin.RibbonTab ribbonTab in adWinRibbon.Tabs) { // Look for the specified system tab if (ribbonTab.Id == SystemTabId) { adWinSysTab = ribbonTab; foreach (adWin.RibbonPanel ribbonPanel in ribbonTab.Panels) { // Look for the specified panel // within the system tab if (ribbonPanel.Source.Id == SystemPanelId) { adWinSysPanel = ribbonPanel; } } } else { // Look for our API tab if (ribbonTab.Id == ApiTabName) { adWinApiTab = ribbonTab; foreach (adWin.RibbonPanel ribbonPanel in ribbonTab.Panels) { // Look for our API panel. // The Source.Id property of an API created // ribbon panel has the following format: // CustomCtrl_%[TabName]%[PanelName] // Where PanelName correlates with the string // entered as the name of the panel at creation // The Source.AutomationName property can also // be used as it is also a direct correlation // of the panel name, but without all the cruft // Be sure to include any new line characters // (\n) used for the panel name at creation as // they still form part of the Id & AutomationName //if(ribbonPanel.Source.AutomationName // == ApiPanelName) // Alternative method if (ribbonPanel.Source.Id == "CustomCtrl_%" + ApiTabName + "%" + ApiPanelName) { adWinApiPanel = ribbonPanel; foreach (adWin.RibbonItem ribbonItem in ribbonPanel.Source.Items) { // Look for our command button // The Id property of an API created ribbon // item has the following format: // CustomCtrl_%CustomCtrl_%[TabName]%[PanelName]%[ItemName] // Where ItemName correlates with the string // entered as the first parameter (name) // of the PushButtonData() constructor // While AutomationName correlates with // the string entered as the second // parameter (text) of the PushButtonData() // constructor // Be sure to include any new line // characters (\n) used for the button // name and text at creation as they // still form part of the ItemName // & AutomationName //if(ribbonItem.AutomationName // == ApiButtonText) // alternative method if (ribbonItem.Id == "CustomCtrl_%CustomCtrl_%" + ApiTabName + "%" + ApiPanelName + "%" + ApiButtonName) { adWinApiItem = ribbonItem; } } } } } } } // Make sure we got everything we need if (adWinSysTab != null && adWinSysPanel != null && adWinApiTab != null && adWinApiPanel != null && adWinApiItem != null) { // First we'll add the whole panel including // the button to the system tab adWinSysTab.Panels.Add(adWinApiPanel); // now lets also add the button itself // to a system panel adWinSysPanel.Source.Items.Add(adWinApiItem); // Remove panel from original API tab // It can also be left there if needed, // there doesn't seem to be any problems with // duplicate panels / buttons on seperate tabs // / panels respectively adWinApiTab.Panels.Remove(adWinApiPanel); // Remove our original API tab from the ribbon adWinRibbon.Tabs.Remove(adWinApiTab); } // A new panel should now be added to the // specified system tab. Its command buttons // will behave as they normally would, including // API access and ExternalCommandAvailability tests. // There will also be a second copy of the command // button from the panel added to the specified // system panel. }
void application_ApplicationInitialized(object sender, Autodesk.Revit.DB.Events.ApplicationInitializedEventArgs e) { Server server = new Server(); Autodesk.Revit.DB.CodeChecking.LoadCombination.Service.AddServer(server); }
public void Application_ApplicationInitialized(object sender, Autodesk.Revit.DB.Events.ApplicationInitializedEventArgs e) { ExecuteEventHooks(EventType.Application_ApplicationInitialized, sender, e); }
private void RegisterDockablePane(object sender, Autodesk.Revit.DB.Events.ApplicationInitializedEventArgs e) { var registerPaneCommand = new RegisterDockablePaneManager(); registerPaneCommand.Register(new UIApplication(sender as Autodesk.Revit.ApplicationServices.Application)); }