示例#1
0
文件: Interaction.cs 项目: iamHXQ/Oy
        /// <summary>
        /// 获取用户交互创建的Polyline
        /// </summary>
        /// <param name="message">提示</param>
        /// <returns>多段线</returns>
        public static Polyline GetPromptPolyline(string message) // newly 20130806
        {
            var point = Interaction.GetPoint(message);

            if (point.IsNull())
            {
                return(null);
            }
            var poly    = NoDraw.Pline(new[] { point });
            var prev    = point;
            var tempIds = new List <ObjectId>();

            while (true)
            {
                point = Interaction.GetLineEndPoint(message, prev);
                if (point.IsNull())
                {
                    break;
                }
                tempIds.Add(Draw.Line(prev, point));
                poly.AddVertexAt(poly.NumberOfVertices, point.ToPoint2d(), 0, 0, 0);
                prev = point;
            }
            tempIds.QForEach(x => x.Erase());
            return(poly);
        }
示例#2
0
        public static void GetLineOfPoint()
        {
            var p = Interaction.GetPoint("GetLineOfPoint");

            Interaction.WriteLine(p.ToString());
            var p2 = Interaction.GetLineEndPoint("otherPoint", p);

            Interaction.WriteLine(p2.ToString());
        }