예제 #1
0
        /// <summary>
        /// Submit RebarShapeDefinition. All the parameters and constraints
        /// will be added to RebarShape. The RebarShape will be added to Revit document after
        /// successfully submitted.
        /// </summary>
        /// <param name="defGroup">Parameter definition group</param>
        public void Commit(Document rvtDoc, DefinitionGroup defGroup)
        {
            // Submit all the parameters.
            foreach (RebarShapeParameter param in m_parameters)
            {
                param.Commit(rvtDoc, defGroup);
            }

            // Submit all the constraints.
            foreach (ConstraintOnRebarShape constraint in m_constraints)
            {
                constraint.Commit();
            }

            // Submit the RebarShape.
            if (m_rebarshapeDefinition.Complete)
            {
                m_rebarshapeDefinition.CheckDefaultParameterValues(0, 0);
            }
            else
            {
                throw new Exception("The Rebar shape definition is not completed.");
            }
        }