Ejemplo n.º 1
0
        public static Autodesk.Revit.DB.Curve ToRevitType(this Autodesk.DesignScript.Geometry.Curve crv,
                                                          bool performHostUnitConversion = true)
        {
            crv = performHostUnitConversion ? crv.InHostUnits() : crv;

            dynamic dyCrv = crv;

            Autodesk.Revit.DB.Curve converted = ProtoToRevitCurve.Convert(dyCrv);

            if (converted == null)
            {
                throw new Exception("An unexpected failure occurred when attempting to convert the curve");
            }

            return(converted);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// An extension method for DesignScript.Geometry.Curve to convert to the analogous revit type
        /// </summary>
        /// <param name="crv"></param>
        /// <returns></returns>
        public static Autodesk.Revit.DB.Curve ToRevitType(this Autodesk.DesignScript.Geometry.Curve crv)
        {
            dynamic dyCrv = crv;

            return(ProtoToRevitCurve.Convert(dyCrv));
        }