Exemplo n.º 1
0
        public static void ClosePolyline()
        {
            var ids = Interaction.GetSelection("\nSelect polyline", "LWPOLYLINE");

            if (ids.Length == 0)
            {
                return;
            }
            if (Interaction.TaskDialog(
                    mainInstruction: ids.Count().ToString() + " polyline(s) selected. Make sure what you select is correct.",
                    yesChoice: "Yes, I promise.",
                    noChoice: "No, I want to double check.",
                    title: "AutoCAD",
                    content: "All polylines in selection will be closed.",
                    footer: "Abuse can mess up the drawing.",
                    expanded: "Commonly used before export."))
            {
                //polys.QForEach(poly => LogManager.Write((poly as Polyline).Closed));
                ids.QForEach <Polyline>(poly =>
                {
                    if (poly.StartPoint.DistanceTo(poly.EndPoint) > 0)
                    {
                        poly.AddVertexAt(poly.NumberOfVertices, poly.StartPoint.ToPoint2d(), 0, 0, 0);
                    }
                });
            }
        }
Exemplo n.º 2
0
 public void TestTaskDialog()
 {
     if (Interaction.TaskDialog("I prefer", "Work", "Life", "WLB poll", "You have to choose one...", "...and only choose one.", "No other choices."))
     {
         Interaction.WriteLine("You are promoted.");
     }
     else
     {
         Interaction.WriteLine("You are fired.");
     }
 }
Exemplo n.º 3
0
 /// <summary>
 /// Shows a message dialog of this exception.
 /// </summary>
 public void ShowMessage()
 {
     Interaction.TaskDialog("Polyline needs a clean-up", "Go to clean it up.", "Go to clean it up.", "AutoCAD", "Please run `PolyClean`.");
 }