Exemplo n.º 1
0
        /// <summary>
        /// 绘制直线
        /// </summary>
        /// <param name="db">图形数据库</param>
        /// <param name="startPoint">起点坐标</param>
        /// <param name="length">直线长度</param>
        /// <param name="degree">直线弧度</param>
        /// <returns>ObjectId</returns>
        public static ObjectId AddEntityToModelSpace(this Database db, Point3d startPoint, Double length, Double degree)
        {
            //计算终点坐标
            Double End_X = startPoint.X + length * Math.Cos(degree.DegreeToAngle());
            Double End_Y = startPoint.Y + length * Math.Sin(degree.DegreeToAngle());
            //Point3d
            Point3d endLine = new Point3d(End_X, End_Y, 0);

            return(AddEntityTool.AddEntityToModelSpace(db, new Line(startPoint, endLine)));
        }
Exemplo n.º 2
0
 /// <summary>
 /// 绘制直线
 /// </summary>
 /// <param name="db">图形数据库</param>
 /// <param name="startPoint">起点坐标</param>
 /// <param name="endPoint">终点坐标</param>
 /// <returns></returns>
 public static ObjectId AddEntityToModelSpace(this Database db, Point3d startPoint, Point3d endPoint)
 {
     // Line line1 = new Line(startPoint, endPoint);
     return(AddEntityTool.AddEntityToModelSpace(db, new Line(startPoint, endPoint)));
 }
Exemplo n.º 3
0
 /// <summary>
 /// 绘制圆弧
 /// </summary>
 /// <param name="db">图形数据库对象</param>
 /// <param name="center">圆心点位置</param>
 /// <param name="radius">半径</param>
 /// <param name="startDegree">起始角度</param>
 /// <param name="endDegree">终止角度</param>
 /// <returns>ObjectId</returns>
 public static ObjectId AddArcToModelSpace(this Database db, Point3d center, double radius, double startDegree, double endDegree)
 {
     return(AddEntityTool.AddEntityToModelSpace(db, new Arc(center, radius, startDegree.DegreeToAngle(), endDegree.DegreeToAngle())));
 }