This class is used to deal with wizard parameters
        /// <summary>
        /// constructor of DoubleHungWinCreation
        /// </summary>
        /// <param name="para">WizardParameter</param>
        /// <param name="commandData">ExternalCommandData</param>
        public DoubleHungWinCreation(WizardParameter para, ExternalCommandData commandData)
            : base(para)
        {
            m_application   = commandData.Application;
            m_document      = commandData.Application.ActiveUIDocument.Document;
            m_familyManager = m_document.FamilyManager;

            using (Transaction tran = new Transaction(m_document, "InitializeWindowWizard"))
            {
                tran.Start();

                CollectTemplateInfo();
                para.Validator = new ValidateWindowParameter(m_wallHeight, m_wallWidth);
                switch (m_document.DisplayUnitSystem)
                {
                case Autodesk.Revit.DB.DisplayUnit.METRIC:
                    para.Validator.IsMetric = true;
                    break;

                case Autodesk.Revit.DB.DisplayUnit.IMPERIAL:
                    para.Validator.IsMetric = false;
                    break;
                }
                para.PathName = Path.GetDirectoryName(para.PathName) + "Double Hung.rfa";

                CreateCommon();

                tran.Commit();
            }
        }
Ejemplo n.º 2
0
 /// <summary>
 /// the method is used to show wizard form and do the creation
 /// </summary>
 /// <returns>the process result</returns>
 public int RunWizard()
 {
     int result = 0;
     m_para = new WizardParameter();           
     m_para.m_template = "DoubleHung";
     if (m_para.m_template == "DoubleHung")
     {
         m_winCreator = new DoubleHungWinCreation(m_para, m_commandData);
     }
     using (WizardForm form = new WizardForm(m_para))
     {
         switch(form.ShowDialog())
         {
             case DialogResult.Cancel:
                 result=0;
                 break;
             case DialogResult.OK:
                 if (Creation())
                     result = 1;
                 else
                     result = -1;
                 break;
             default :
                 result=-1;
                 break;
         }           
     }
     return result;
 }
Ejemplo n.º 3
0
 /// <summary>
 /// the method is used to show wizard form and do the creation
 /// </summary>
 /// <returns>the process result</returns>
 public int RunWizard()
 {
     int result = 0;
     m_para = new WizardParameter();
     m_para.m_template = "DoubleHung";
     if (m_para.m_template == "DoubleHung")
     {
         m_winCreator = new DoubleHungWinCreation(m_para, m_commandData);
     }
     using (WizardForm form = new WizardForm(m_para))
     {
         switch(form.ShowDialog())
         {
             case DialogResult.Cancel:
                 result=0;
                 break;
             case DialogResult.OK:
                 if (Creation())
                     result = 1;
                 else
                     result = -1;
                 break;
             default :
                 result=-1;
                 break;
         }
     }
     return result;
 }
Ejemplo n.º 4
0
 /// <summary>
 /// constructor of WizardForm
 /// </summary>
 /// <param name="para">the WizardParameter</param>
 public WizardForm(WizardParameter para)
 {
     m_para = para;
     InitializeComponent();
     InitializePara();
     m_newTip.SetToolTip(button_newType, "Add new type");
     m_copyTip.SetToolTip(button_duplicateType, "Duplicate the type");
     m_errorTip.ShowAlways = false;
     m_highFont            = InputDimensionLabel.Font;
     m_commonFont          = WindowPropertyLabel.Font;
     SetPanelVisibility(2);
 }
Ejemplo n.º 5
0
 /// <summary>
 /// The constructor of WindowCreation
 /// </summary>
 /// <param name="parameter">WizardParameter</param>
 public WindowCreation(WizardParameter parameter)
 {
     m_para = parameter;
 }
Ejemplo n.º 6
0
 /// <summary>
 /// constructor of WizardForm
 /// </summary>
 /// <param name="para">the WizardParameter</param>
 public WizardForm(WizardParameter para)
 {
     m_para = para;
     InitializeComponent();
     InitializePara();
     m_newTip.SetToolTip(button_newType, "Add new type");
     m_copyTip.SetToolTip(button_duplicateType, "Duplicate the type");
     m_errorTip.ShowAlways = false;
     m_highFont = InputDimensionLabel.Font;
     m_commonFont = WindowPropertyLabel.Font;
     SetPanelVisibility(2);
 }
Ejemplo n.º 7
0
 /// <summary>
 /// constructor of DoubleHungWinCreation
 /// </summary>
 /// <param name="para">WizardParameter</param>
 /// <param name="commandData">ExternalCommandData</param>
 public DoubleHungWinCreation(WizardParameter para, ExternalCommandData commandData)
     : base(para)
 {
     m_application = commandData.Application;
     m_document = commandData.Application.ActiveUIDocument.Document;
     m_familyManager = m_document.FamilyManager;
     CollectTemplateInfo();
     para.Validator = new ValidateWindowParameter(m_wallHeight, m_wallWidth);
     switch (m_document.DisplayUnitSystem)
     {
         case Autodesk.Revit.DB.DisplayUnit.METRIC:
             para.Validator.IsMetric = true;
             break;
         case Autodesk.Revit.DB.DisplayUnit.IMPERIAL:
             para.Validator.IsMetric = false;
             break;
     }
     para.PathName = Path.GetDirectoryName(para.PathName) + "Double Hung.rfa";
     CreateCommon();
 }
Ejemplo n.º 8
0
 /// <summary>
 /// The constructor of WindowCreation
 /// </summary>
 /// <param name="parameter">WizardParameter</param>
 public WindowCreation(WizardParameter parameter)
 {
     m_para = parameter;
 }