示例#1
0
        /// <summary>
        /// Run sample Rooms
        /// </summary>
        public void Run()
        {
            if (null == m_revit.ActiveUIDocument)
            {
                MessageBox.Show("No openning document.");
                return;
            }

            Transaction trans = new Transaction(m_revit.ActiveUIDocument.Document, "RoomInfo");

            trans.Start();
            try
            {
                //create a new instance of class Data
                RoomsData data = new RoomsData(m_revit);
                //create a form to display the room information
                using (roomsInformationForm infoForm = new roomsInformationForm(data))
                {
                    infoForm.ShowDialog();
                }
            }
            catch (Exception ex)
            {
                // If there are something wrong, give error information
                trans.RollBack();
                MessageBox.Show(ex.Message);
            }
            trans.Commit();
        }
示例#2
0
 /// <summary>
 /// Overload the constructor
 /// </summary>
 /// <param name="data">an instanc of Data class</param>
 public roomsInformationForm(RoomsData data)
 {
     m_data = data;
     InitializeComponent();
 }