Ejemplo n.º 1
0
        /// <summary>
        /// 绘制直线
        /// </summary>
        /// <param name="startPoint3d">指定起点</param>
        /// <returns></returns>
        public static (PromptResult result, Line line) DrawLine(Point3d startPoint3d)
        {
            var ed      = DataBaseTools.DocumentEditor();
            var lineJig = new LineJig(startPoint3d);
            //lineJig.Line.LineWeight = LineWeight.LineWeight200;
            //lineJig.Line.Color = Color.FromColor();
            var  res  = ed.Drag(lineJig);
            Line line = null;

            if (res.Status == PromptStatus.OK)
            {
                lineJig.Line.AddToModelSpace(DataBaseTools.DocumentDatabase());
                line = lineJig.Line;
            }
            return(res, line);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 绘制直线
        /// </summary>
        /// <returns></returns>
        public static (PromptResult result, Line line) DrawLine()
        {
            var  ed      = DataBaseTools.DocumentEditor();
            var  lineJig = new LineJig();
            var  res     = ed.Drag(lineJig);
            Line line    = null;

            if (res.Status == PromptStatus.OK)
            {
                lineJig.SetCounter(1);
                res = ed.Drag(lineJig);
                if (res.Status == PromptStatus.OK)
                {
                    lineJig.Line.AddToModelSpace(DataBaseTools.DocumentDatabase());
                    line = lineJig.Line;
                }
            }
            return(res, line);
        }