Exemple #1
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="s"></param>
        public form_MaxSize(clsSettings s)
        {
            InitializeComponent();

            // Widen Scope
            _s = s;
        }
Exemple #2
0
        /// <summary>
        /// Duct Command
        /// </summary>
        /// <param name="commandData"></param>
        /// <param name="message"></param>
        /// <param name="elements"></param>
        /// <returns></returns>
        public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
        {
            try
              {

            // Version
            if (!commandData.Application.Application.VersionName.Contains("2015"))
            {

              // Failure
              using (TaskDialog td = new TaskDialog("Cannot Continue"))
              {
            td.TitleAutoPrefix = false;
            td.MainInstruction = "Incompatible Revit Version";
            td.MainContent = "This Add-In was built for Revit 2015, please contact CASE for assistance...";
            td.Show();
              }
              return Result.Failed;

            }

            // Settings
            clsSettings m_s = new clsSettings(commandData);

            // Main Category Selection Form
            using (form_Orient dlg = new form_Orient())
            {
              dlg.ShowDialog();

              if (!dlg.DoConduit && !dlg.DoDuct && !dlg.DoPipe & !dlg.DoTray) return Result.Cancelled;

              // Process Data
              if (dlg.DoConduit) m_s.ProcessConduit();
              if (dlg.DoDuct) m_s.ProcessDuct();
              if (dlg.DoPipe) m_s.ProcessPipe();
              if (dlg.DoTray) m_s.ProcessTray();

            }

            // Success
            return Result.Succeeded;

              }
              catch (Exception ex)
              {

            // Failure
            message = ex.Message;
            return Result.Failed;

              }
        }
        /// <summary>
        /// Duct Command
        /// </summary>
        /// <param name="commandData"></param>
        /// <param name="message"></param>
        /// <param name="elements"></param>
        /// <returns></returns>
        public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elements)
        {
            try
            {

              // Version
              if (!commandData.Application.Application.VersionName.Contains("2015"))
              {

             // Failure
             message = "This Add-In was built for Revit 2015, please contact CASE for assistance...";
             return Result.Failed;

              }

              // Settings
              clsSettings m_s = new clsSettings(commandData);

              // User Form
              using (form_MaxSize dlg = new form_MaxSize(m_s))
              {
             dlg.ShowDialog();
             if (!string.IsNullOrEmpty(dlg.ErrorMsg))
             {
                message = dlg.ErrorMsg;
                return Result.Failed;
             }
              }

              // Success
              return Result.Succeeded;

            }
            catch (Exception ex)
            {

              // Failure
              message = ex.Message;
              return Result.Failed;

            }
        }