Exemplo n.º 1
0
        /// <summary>
        /// Creates polyline interactively.
        /// </summary>
        /// <param name="message">The message.</param>
        /// <returns>The polyline result.</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(line => line.Erase());
            return(poly);
        }