/// <summary>
        /// Constructor to initialize the fields.
        /// </summary>
        /// <param name="revitDoc">Revit DB Document</param>
        public CorbelReinforcementOptions(Document revitDoc)
        {
            RevitDoc      = revitDoc;
            RebarBarTypes = new List <RebarBarType>();
            RebarBarTypeSet barset = RevitDoc.RebarBarTypes;

            foreach (RebarBarType bartype in barset)
            {
                RebarBarTypes.Add(bartype);
            }
        }
Esempio n. 2
0
        /// <summary>
        /// get all the rebar types in current project, and store in m_rebarTypes data
        /// </summary>
        /// <param name="commandData">the ExternalCommandData reference</param>
        /// <returns>true if some rebar types can be gotton, otherwise false</returns>
        private bool GetRebarTypes(ExternalCommandData commandData)
        {
            // Initialize the m_rebarTypes which used to store all rebar types.
            // Get all rebar types in revit and add them in m_rebarTypes
            RebarBarTypeSet rebarTypes = commandData.Application.ActiveUIDocument.Document.RebarBarTypes;

            foreach (RebarBarType barType in rebarTypes)
            {
                m_rebarTypes.Add(barType);
            }

            // If no rebar types in revit return false, otherwise true
            return((0 == m_rebarTypes.Count) ? false : true);
        }