Exemplo n.º 1
0
 public static SketchPlane Wrap(Autodesk.Revit.DB.SketchPlane ele, bool isRevitOwned)
 {
     return(SketchPlane.FromExisting(ele, isRevitOwned));
 }
Exemplo n.º 2
0
        /// <summary>
        /// Create a ModelText Element in the Family Document by providing the text, SketchPlane Element host, coordinates (within the plane of the SketchPlane),
        /// the depth of the text, and the text type name
        /// </summary>
        /// <param name="text"></param>
        /// <param name="sketchPlane"></param>
        /// <param name="xCoordinateInPlane"></param>
        /// <param name="yCoordinateInPlane"></param>
        /// <param name="textDepth"></param>
        /// <param name="modelTextType"></param>
        /// <returns></returns>
        public static ModelText ByTextSketchPlaneAndPosition(string text, SketchPlane sketchPlane, double xCoordinateInPlane, double yCoordinateInPlane, double textDepth, ModelTextType modelTextType )
        {
            if (!Document.IsFamilyDocument)
            {
                throw new Exception("ModelText Elements can only be created in a Family Document");
            }

            if (text == null)
            {
                throw new ArgumentNullException("text");
            }

            if (sketchPlane == null)
            {
                throw new ArgumentNullException("sketchPlane");
            }

            if (modelTextType == null)
            {
                throw new ArgumentNullException("modelTextType");
            }

            return new ModelText(text, sketchPlane.InternalSketchPlane, xCoordinateInPlane, yCoordinateInPlane,
                textDepth, modelTextType.InternalModelTextType);
        }