public void WriteObject(IBSplineCurveEntity entity)
 {
     IPointEntity[] points = entity.GetControlVertices();
     WriteEntity <IPointEntity>("ControlVertices", points);
     WriteInteger("Degree", entity.GetDegree());
     WriteBoolean("IsPeriodic", entity.GetIsPeriodic());
 }
        public string WriteEntity(IBSplineCurveEntity bspline, string paramName = null)
        {
            if (string.IsNullOrEmpty(paramName))
            {
                paramName = string.Format("__bspline_{0}", ++id);
            }

            IPointEntity[] points = bspline.GetControlVertices();
            string         cp     = WriteEntities(points);

            mExpression.AppendFormat("{0} = BSplineCurve.ByControlVertices({1}, {2}, {3});", paramName, cp, bspline.GetDegree(), bspline.GetIsPeriodic());
            mExpression.AppendLine();
            return(paramName);
        }