示例#1
0
 public void TestTaskDialog()
 {
     if (Interaction.TaskDialog("请选择。", "吃饭", "睡觉", "懒人选择", "你必须做出选择", "你只有这些选择", "没有其他选项") == true)
     {
         Interaction.WriteLine("就知道吃!");
     }
     else
     {
         Interaction.WriteLine("就知道睡!");
     }
 }
示例#2
0
 public static void ClosePolyline()
 {
     ObjectId[] ids = Interaction.GetSelection("\nSelect polyline", "LWPOLYLINE");
     if (ids.Length == 0)
     {
         return;
     }
     if (Interaction.TaskDialog(ids.Count().ToString() + " polyline(s) selected. Make sure what you select is correct.", "Yes, I promise.", "No, I want to check.", "AutoCAD", "All polylines in selection will be closed.", "Abuse can mess up the drawing.", "Commonly used before export.") == true)
     {
         //polys.QForEach(x => LogManager.Write((x as Polyline).Closed));
         ids.QForEach <Polyline>(poly =>
         {
             if (poly.StartPoint.DistanceTo(poly.EndPoint) > 0)
             {
                 poly.AddVertexAt(poly.NumberOfVertices, poly.StartPoint.ToPoint2d(), 0, 0, 0);
             }
         });
     }
 }
示例#3
0
 public void ShowMessage()
 {
     Interaction.TaskDialog("多段线需要清理。", "去清理", "还是去清理", "AutoCAD", "请运行PolyClean命令。");
 }