public Products(ExternalCommandData comma, ref string mess, Autodesk.Revit.DB.ElementSet ele) { InitializeComponent(); comma1 = comma; mess1 = mess; element = ele; }
public Result Execute(ExternalCommandData commandData, ref string message, Autodesk.Revit.DB.ElementSet elements) { HelpForm helpForm = new HelpForm(); helpForm.ShowDialog(); return(Result.Succeeded); }
public Result Execute(ExternalCommandData commandData, ref string message, Autodesk.Revit.DB.ElementSet elements) { if (!DockablePane.PaneExists(DefaultFamilyTypes.PaneId) || !DockablePane.PaneExists(DefaultElementTypes.PaneId)) { return(Result.Failed); } UIApplication uiApp = commandData.Application; if (uiApp == null) { return(Result.Failed); } DockablePane pane = uiApp.GetDockablePane(DefaultFamilyTypes.PaneId); pane.Show(); DockablePane elemTypePane = uiApp.GetDockablePane(DefaultElementTypes.PaneId); elemTypePane.Show(); if (ThisApplication.DefaultFamilyTypesPane != null) { ThisApplication.DefaultFamilyTypesPane.SetDocument(commandData.Application.ActiveUIDocument.Document); } if (ThisApplication.DefaultElementTypesPane != null) { ThisApplication.DefaultElementTypesPane.SetDocument(commandData.Application.ActiveUIDocument.Document); } return(Result.Succeeded); }
public Result Execute( ExternalCommandData commandData, ref string message, Autodesk.Revit.DB.ElementSet elements) { if (commandData == null) { return(Result.Failed); } UIDocument udoc = commandData.Application.ActiveUIDocument; dynamic settings = new ExpandoObject(); settings.Height = 480; settings.Width = 768; settings.Title = "Destructive Purge - By Andrew Nicholas"; settings.ShowInTaskbar = false; settings.SizeToContent = System.Windows.SizeToContent.Manual; var vm = new ViewModels.DestructivePurgeViewModel(udoc.Document); SCaddinsApp.WindowManager.ShowDialog(vm, null, settings); return(Result.Succeeded); }
public ProductDetails(ExternalCommandData commadet, ref string messdet, Autodesk.Revit.DB.ElementSet eledet) { InitializeComponent(); properities.tempCommandData = commadet; properities.tempElementSet = eledet; properities.tempMessage = messdet; }
/// <summary> /// Implement this method as an external command for Revit. /// </summary> /// <param name="commandData">An object that is passed to the external application /// which contains data related to the command, /// such as the application object and active view.</param> /// <param name="message">A message that can be set by the external application /// which will be displayed if a failure or cancellation is returned by /// the external command.</param> /// <param name="elements">A set of elements to which the external application /// can add elements that are to be highlighted in case of failure or cancellation.</param> /// <returns>Return the status of the external command. /// A result of Succeeded means that the API external method functioned as expected. /// Cancelled can be used to signify that the user cancelled the external operation /// at some point. Failure should be returned if the application is unable to proceed with /// the operation.</returns> public Autodesk.Revit.UI.Result Execute(ExternalCommandData commandData, ref string message, Autodesk.Revit.DB.ElementSet elements) { try { // Verify active document if (null == commandData.Application.ActiveUIDocument.Document) { message = "Active view is null."; return(Autodesk.Revit.UI.Result.Failed); } MainData mainData = new MainData(commandData); // Show the dialog using (MainForm mainForm = new MainForm(mainData)) { if (mainForm.ShowDialog() == DialogResult.Cancel) { return(Autodesk.Revit.UI.Result.Cancelled); } } } catch (Exception ex) { message = ex.ToString(); return(Autodesk.Revit.UI.Result.Failed); } return(Autodesk.Revit.UI.Result.Succeeded); }
/// <summary> /// Implement this method as an external command for Revit. /// </summary> /// <param name="commandData">An object that is passed to the external application /// which contains data related to the command, /// such as the application object and active view.</param> /// <param name="message">A message that can be set by the external application /// which will be displayed if a failure or cancellation is returned by /// the external command.</param> /// <param name="elements">A set of elements to which the external application /// can add elements that are to be highlighted in case of failure or cancellation.</param> /// <returns>Return the status of the external command. /// A result of Succeeded means that the API external method functioned as expected. /// Cancelled can be used to signify that the user cancelled the external operation /// at some point. Failure should be returned if the application is unable to proceed with /// the operation.</returns> public Autodesk.Revit.UI.Result Execute(ExternalCommandData commandData, ref string message, Autodesk.Revit.DB.ElementSet elements) { try { CoordinateSystemData Data = new CoordinateSystemData(commandData); Data.GatData(); using (CoordinateSystemDataForm displayForm = new CoordinateSystemDataForm(Data, commandData.Application.Application.Cities, commandData.Application.ActiveUIDocument.Document.SiteLocation)) { if (DialogResult.OK != displayForm.ShowDialog()) { return(Autodesk.Revit.UI.Result.Cancelled); } } return(Autodesk.Revit.UI.Result.Succeeded); } catch (Exception ex) { message = ex.Message; return(Autodesk.Revit.UI.Result.Failed); } }
public login(ExternalCommandData commandata2, ref string mess, Autodesk.Revit.DB.ElementSet ele) { InitializeComponent(); commandata1 = commandata2; elements1 = ele; message1 = mess; }
public Result Execute( ExternalCommandData commandData, ref string message, Autodesk.Revit.DB.ElementSet elements) { ThinLinesApp.SetThinLines(commandData.Application, true); return(Result.Succeeded); }
public Result Execute(ExternalCommandData commandData, ref string message, Autodesk.Revit.DB.ElementSet elements) { var tempuseRequestMaker = new UseRequestMaker(commandData.Application.ActiveUIDocument); var useFrameWork = new QuickModelFrameWork(tempuseRequestMaker, new UseRespondHanlder()); useFrameWork.ExcuteWithWhile(commandData); return(Result.Succeeded); }
public Result Execute( ExternalCommandData commandData, ref string message, Autodesk.Revit.DB.ElementSet elements) { var vm = new ViewModels.SCincrementViewModel(); SCaddinsApp.WindowManager.ShowDialog(vm, null, ViewModels.SCincrementViewModel.DefaultWindowSettings); return(Result.Succeeded); }
public Result Execute(ExternalCommandData commandData, ref string message, Autodesk.Revit.DB.ElementSet elements) { Log.AppendLog(LogMessageType.INFO, "Started"); try { var addins = AppCommand.thisApp.addins; StoreTempCollection(addins.AddinCollection); var viewModel = new AddInViewModel(addins); var mainWindow = new MainWindow { DataContext = viewModel }; if (mainWindow.ShowDialog() == true) { var vm = (AddInViewModel)mainWindow.DataContext; try { // (Konrad) We are gathering information about the addin use. This allows us to // better maintain the most used plug-ins or discontiue the unused ones. // If Window was closed using the OK button we can collect more details about the app to publish. var log = new AddinLog("AddinManager", commandData.Application.Application.VersionNumber) { DetailInfo = vm.AddinsObj.AddinCollection .Select(x => new InfoItem { Name = x.ToolName, Value = x.ToolLoadType.ToString() }) .ToList() }; AddinUtilities.PublishAddinLog(log); } catch (Exception e) { Log.AppendLog(LogMessageType.EXCEPTION, e.Message); } // write setting and load addins. AppCommand.thisApp.addins = vm.AddinsObj; AppCommand.thisApp.ProcessPlugins(); } else { // If user cancelled out of this window, we don't need to log all the details, other than that it was opened. AddinUtilities.PublishAddinLog(new AddinLog("AddinManager", commandData.Application.Application.VersionNumber)); OverrideTempSettings(); } } catch (Exception ex) { Log.AppendLog(LogMessageType.EXCEPTION, ex.Message); } Log.AppendLog(LogMessageType.INFO, "Ended"); return(Result.Succeeded); }
public Result Execute(ExternalCommandData commandData, ref string message, Autodesk.Revit.DB.ElementSet elements) { try { } catch (Exception ex) { MessageBox.Show("Failed to import JSON to Revit.\n" + ex.Message, "Import JSON", MessageBoxButtons.OK, MessageBoxIcon.Warning); } return(Result.Succeeded); }
ElementSet(string label, ICollection<Autodesk.Revit.DB.ElementId> val, Autodesk.Revit.DB.Document doc) : base(label) { m_val = new Autodesk.Revit.DB.ElementSet(); foreach(Autodesk.Revit.DB.ElementId elemId in val) { if(Autodesk.Revit.DB.ElementId.InvalidElementId == elemId) continue; Autodesk.Revit.DB.Element elem = doc.GetElement(elemId); if(null != elem) m_val.Insert(elem); } }
public Result Execute(ExternalCommandData commandData, ref string message, Autodesk.Revit.DB.ElementSet elements) { try { RevitServerApp.Instance.Toggle(); return(Result.Succeeded); } catch (Exception ex) { message = ex.Message; return(Result.Failed); } }
public ElementSet(string label, ICollection<Autodesk.Revit.DB.ElementId> val, Autodesk.Revit.DB.Document doc) : base(label) { m_val = new Autodesk.Revit.DB.ElementSet(); foreach(Autodesk.Revit.DB.ElementId elemId in val) { if(Autodesk.Revit.DB.ElementId.InvalidElementId == elemId) continue; Autodesk.Revit.DB.Element elem = doc.GetElement(elemId); if(null != elem) m_val.Insert(elem); } }
public Result Execute(ExternalCommandData commandData, ref string message, Autodesk.Revit.DB.ElementSet elements) { try { RevitServerApp._app.ShowSettingsForm(); } catch (Exception exception) { System.Diagnostics.Debug.WriteLine(exception.Message); } return(Result.Succeeded); }
public Result Execute(ExternalCommandData commandData, ref string message, Autodesk.Revit.DB.ElementSet elements) { if (m_displacementstructuremodelAnimator == null) { m_displacementstructuremodelAnimator = new DisplacementStructureModelAnimator(commandData.Application, false); m_displacementstructuremodelAnimator.StartAnimation(); } else { m_displacementstructuremodelAnimator.AnimateNextStep(); } return(Result.Succeeded); }
public Result Execute( ExternalCommandData commandData, ref string message, Autodesk.Revit.DB.ElementSet elements) { if (commandData == null) { return(Result.Failed); } var uidoc = commandData.Application.ActiveUIDocument; ViewUnderlays.RemoveUnderlays(uidoc); return(Result.Succeeded); }
public Result Execute( ExternalCommandData commandData, ref string message, Autodesk.Revit.DB.ElementSet elements) { var vms = new ParameterUtilities.ViewModels.SCincrementViewModel(); var roomConverterViewModel = new RoomConverter.ViewModels.SettingsViewModel(); var sheetCopierViewModel = new SheetCopier.ViewModels.SheetCopierSettingsViewModel(); var viewUtilitiesViewModel = new ViewUtilities.ViewModels.ViewUtilitiesSettingsViewModel(); var spellCheckerOptionsViewModel = new SpellChecker.ViewModels.SpellCheckerOptionsViewModel(); var vm = new ViewModels.SettingsViewModel(vms, roomConverterViewModel, sheetCopierViewModel, viewUtilitiesViewModel, spellCheckerOptionsViewModel); SCaddinsApp.WindowManager.ShowDialog(vm, null, ViewModels.SettingsViewModel.DefaultWindowSettings); return(Result.Succeeded); }
public Result Execute(ExternalCommandData commandData, ref string message, Autodesk.Revit.DB.ElementSet elements) { try { App.revonApp.ShowShellForm(commandData.Application); return(Result.Succeeded); } catch (Exception ex) { message = ex.Message; return(Result.Failed); } return(Result.Succeeded); }
public Result Execute(ExternalCommandData commandData, ref string message, Autodesk.Revit.DB.ElementSet elements) { IParameterHelper ph = new ParameterHelper(commandData.Application.ActiveUIDocument.Document); var paramName = "SomeParameterThatNormallyDoesnotExist"; var exists = ph.HasParameter(paramName); MessageBox.Show(paramName + " exists: " + exists); paramName = "Project Name"; exists = ph.HasParameter(paramName); MessageBox.Show(paramName + " exists: " + exists); return(Result.Succeeded); }
/// <summary> /// Command entry point /// </summary> /// <param name="commandData"></param> /// <param name="message"></param> /// <param name="elements"></param> /// <returns></returns> public Result Execute(ExternalCommandData commandData, ref string message, Autodesk.Revit.DB.ElementSet elements) { try { EADocumentData eadd = new EADocumentData(elements, commandData); EASharedParamData easp = new EASharedParamData("Rooms"); //easp.SetNewParameterToTypeRoom("Display"); MainWindow mw = new MainWindow(); mw.ShowDialog(); return(Result.Succeeded); } catch (Exception ex) { Console.WriteLine(ex.Message); Console.Read(); return(Result.Failed); } }
public Result Execute(ExternalCommandData commandData, ref string message, Autodesk.Revit.DB.ElementSet elements) { // get ThinLies state and set it to its opposite value ThinLinesApp.SetThinLines(commandData.Application, !ThinLinesApp.IsThinLines()); // you also could toggle the ThinLines state by just invoking PostableCommand.ThinLines /* * RevitCommandId commandId = RevitCommandId.LookupPostableCommandId(PostableCommand.ThinLines); * * if (commandData.Application.CanPostCommand(commandId)) * { * commandData.Application.PostCommand(commandId); * } */ return(Result.Succeeded); }
public Result Execute(ExternalCommandData commandData, ref string message, Autodesk.Revit.DB.ElementSet elements) { Log.AppendLog(LogMessageType.INFO, "Started"); try { // (Konrad) We are gathering information about the addin use. This allows us to // better maintain the most used plug-ins or discontiue the unused ones. AddinUtilities.PublishAddinLog(new AddinLog("Beta-SheetManager", commandData.Application.Application.VersionNumber)); m_app = commandData.Application; AppCommand.thisApp.ShowWindow(m_app); } catch (Exception ex) { Log.AppendLog(LogMessageType.EXCEPTION, ex.Message); } Log.AppendLog(LogMessageType.INFO, "Ended"); return(Result.Succeeded); }
public Result Execute( ExternalCommandData commandData, ref string message, Autodesk.Revit.DB.ElementSet elements) { dynamic settings = new ExpandoObject(); settings.Height = 640; settings.Width = 480; settings.Title = "About SCaddins"; settings.Icon = new System.Windows.Media.Imaging.BitmapImage( new System.Uri("pack://application:,,,/SCaddins;component/Assets/scexport.png")); settings.ShowInTaskbar = false; settings.ResizeMode = System.Windows.ResizeMode.NoResize; settings.SizeToContent = System.Windows.SizeToContent.WidthAndHeight; var aboutViewModel = new ViewModels.AboutViewModel(); SCaddinsApp.WindowManager.ShowDialog(aboutViewModel, null, settings); return(Result.Succeeded); }
/// <summary> /// Implement this method as an external command for Revit. /// </summary> /// <param name="commandData">An object that is passed to the external application /// which contains data related to the command, /// such as the application object and active view.</param> /// <param name="message">A message that can be set by the external application /// which will be displayed if a failure or cancellation is returned by /// the external command.</param> /// <param name="elements">A set of elements to which the external application /// can add elements that are to be highlighted in case of failure or cancellation.</param> /// <returns>Return the status of the external command. /// A result of Succeeded means that the API external method functioned as expected. /// Cancelled can be used to signify that the user cancelled the external operation /// at some point. Failure should be returned if the application is unable to proceed with /// the operation.</returns> public Autodesk.Revit.UI.Result Execute(ExternalCommandData commandData, ref string message, Autodesk.Revit.DB.ElementSet elements) { Autodesk.Revit.DB.Transaction newTran = null; try { newTran = new Autodesk.Revit.DB.Transaction(commandData.Application.ActiveUIDocument.Document, "ViewPrinter"); newTran.Start(); PrintMgr pMgr = new PrintMgr(commandData); if (null == pMgr.InstalledPrinterNames) { PrintMgr.MyMessageBox("No installed printer, the external command can't work."); return(Autodesk.Revit.UI.Result.Cancelled); } using (PrintMgrForm pmDlg = new PrintMgrForm(pMgr)) { if (pmDlg.ShowDialog() != DialogResult.Cancel) { newTran.Commit(); return(Autodesk.Revit.UI.Result.Succeeded); } newTran.RollBack(); } } catch (Exception ex) { if (null != newTran) { newTran.RollBack(); } message = ex.ToString(); return(Autodesk.Revit.UI.Result.Failed); } return(Autodesk.Revit.UI.Result.Cancelled); }
public Result Execute(ExternalCommandData commandData, ref string message, Autodesk.Revit.DB.ElementSet elements) { Log.AppendLog(LogMessageType.INFO, "Started"); try { // (Konrad) We are gathering information about the addin use. This allows us to // better maintain the most used plug-ins or discontiue the unused ones. AddinUtilities.PublishAddinLog( new AddinLog("HOK Navigator", commandData.Application.Application.VersionNumber)); var helpForm = new HelpForm(); helpForm.ShowDialog(); } catch (Exception e) { Log.AppendLog(LogMessageType.EXCEPTION, e.Message); } Log.AppendLog(LogMessageType.INFO, "Ended"); return(Result.Succeeded); }
/// <summary> /// Implement this method as an external command for Revit. /// </summary> /// <param name="commandData">An object that is passed to the external application /// which contains data related to the command, /// such as the application object and active view.</param> /// <param name="message">A message that can be set by the external application /// which will be displayed if a failure or cancellation is returned by /// the external command.</param> /// <param name="elements">A set of elements to which the external application /// can add elements that are to be highlighted in case of failure or cancellation.</param> /// <returns>Return the status of the external command. /// A result of Succeeded means that the API external method functioned as expected. /// Cancelled can be used to signify that the user cancelled the external operation /// at some point. Failure should be returned if the application is unable to proceed with /// the operation.</returns> public Autodesk.Revit.UI.Result Execute(ExternalCommandData commandData, ref string message, Autodesk.Revit.DB.ElementSet elements) { // try to initialize necessary data to create framing FrameData data = FrameData.CreateInstance(commandData); // display UI for user's input using (CreateFrameForm framingForm = new CreateFrameForm(data)) { if (framingForm.ShowDialog() == DialogResult.OK) { // create framing FrameBuilder builder = new FrameBuilder(data); builder.CreateFraming(); } else { // cancel the command return(Autodesk.Revit.UI.Result.Cancelled); } } return(Autodesk.Revit.UI.Result.Succeeded); }
/// <summary> /// Implement this method as an external command for Revit. /// </summary> /// <param name="commandData">An object that is passed to the external application /// which contains data related to the command, /// such as the application object and active view.</param> /// <param name="message">A message that can be set by the external application /// which will be displayed if a failure or cancellation is returned by /// the external command.</param> /// <param name="elements">A set of elements to which the external application /// can add elements that are to be highlighted in case of failure or cancellation.</param> /// <returns>Return the status of the external command. /// A result of Succeeded means that the API external method functioned as expected. /// Cancelled can be used to signify that the user cancelled the external operation /// at some point. Failure should be returned if the application is unable to proceed with /// the operation.</returns> public Autodesk.Revit.UI.Result Execute(ExternalCommandData commandData, ref string message, Autodesk.Revit.DB.ElementSet elements) { using (frmPanelArea form = new frmPanelArea(commandData)) { // The form is created successfully if (null != form && !form.IsDisposed) { form.ShowDialog(); } } return(Autodesk.Revit.UI.Result.Succeeded); }
/// <summary> /// Implementation of the external command. /// </summary> /// <param name="commandData"></param> /// <param name="message"></param> /// <param name="elements"></param> /// <returns></returns> public Result Execute(ExternalCommandData commandData, ref string message, Autodesk.Revit.DB.ElementSet elements) { SiteUIUtils.ChangeSubregionAndPointsElevation(commandData.Application.ActiveUIDocument, 3); return(Result.Succeeded); }
public ElementSet(string label, Autodesk.Revit.DB.ElementSet val) : base(label) { m_val = val; }