找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 1644|回复: 1

[分享] 用户交互(让用户选择各种....)&&各种选择集合方法使用

[复制链接]

已领礼包: 859个

财富等级: 财运亨通

发表于 2014-7-18 14:59:11 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

×

  1. // Copyright 2004-2006 by Autodesk, Inc.
  2. //
  3. //Permission to use, copy, modify, and distribute this software in
  4. //object code form for any purpose and without fee is hereby granted,
  5. //provided that the above copyright notice appears in all copies and
  6. //that both that copyright notice and the limited warranty and
  7. //restricted rights notice below appear in all supporting
  8. //documentation.
  9. //
  10. //AUTODESK PROVIDES THIS PROGRAM "AS IS" AND WITH ALL FAULTS.
  11. //AUTODESK SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF
  12. //MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE.  AUTODESK, INC.
  13. //DOES NOT WARRANT THAT THE OPERATION OF THE PROGRAM WILL BE
  14. //UNINTERRUPTED OR ERROR FREE.
  15. //
  16. //Use, duplication, or disclosure by the U.S. Government is subject to
  17. //restrictions set forth in FAR 52.227-19 (Commercial Computer
  18. //Software - Restricted Rights) and DFAR 252.227-7013(c)(1)(ii)
  19. //(Rights in Technical Data and Computer Software), as applicable.

  20. using System;
  21. using Autodesk.AutoCAD.DatabaseServices;
  22. using Autodesk.AutoCAD.Runtime;
  23. using Autodesk.AutoCAD.Geometry;
  24. using Autodesk.AutoCAD.ApplicationServices;
  25. using Autodesk.AutoCAD.EditorInput;

  26. namespace Prompts
  27. {
  28.     public class PromptsTest
  29.     {
  30.         static PromptAngleOptions useThisAngleOption;
  31.         static PromptDoubleResult useThisAngleResult;
  32.         static PromptPointOptions useThisPointOption;
  33.         static PromptPointResult useThisPointResult;
  34.         static PromptEntityOptions useThisEntityOption;
  35.         static PromptEntityResult useThisEntityResult;

  36.         //A small function that shows how to prompt for an integer
  37.         [CommandMethod("GetInteger")]
  38.         public void integerTest()
  39.         {
  40.             Editor ed = Application.DocumentManager.MdiActiveDocument.Editor;
  41.             PromptIntegerOptions opt0 = new PromptIntegerOptions("Enter your age");
  42.             opt0.AllowNegative = false;
  43.             opt0.AllowNone = false;
  44.             opt0.AllowZero = false;
  45.             opt0.DefaultValue = 1;
  46.             PromptIntegerResult IntRes = ed.GetInteger(opt0);
  47.             if (IntRes.Status == PromptStatus.OK)
  48.             {
  49.                 ed.WriteMessage(string.Format("\nYou entered {0}", IntRes.Value));
  50.             }
  51.         }

  52.         //This method prompts for a double value.
  53.         //Pi,Two-pi  are valid keywords that can be entered
  54.         //by the user at the prompt.
  55.         [CommandMethod("GetDouble")]
  56.         public void DoubleTest()
  57.         {
  58.             Editor ed = Application.DocumentManager.MdiActiveDocument.Editor;
  59.             PromptDoubleOptions opt1 = new PromptDoubleOptions("Enter a number or Pi/Two-pi");
  60.             opt1.Keywords.Add("Pi");
  61.             opt1.Keywords.Add("Two-pi");
  62.             opt1.AllowNone = false;
  63.             opt1.AllowZero = false;
  64.             opt1.DefaultValue = 1.0;

  65.             PromptDoubleResult doubleRes = ed.GetDouble(opt1);
  66.             if (doubleRes.Status == PromptStatus.Keyword)
  67.             {
  68.                 switch (doubleRes.StringResult)
  69.                 {
  70.                     case "Pi":
  71.                         ed.WriteMessage("Value is 3.14");
  72.                         break;
  73.                     case "Two-pi":
  74.                         ed.WriteMessage("\nValue is 6.28");
  75.                         break;
  76.                     default:
  77.                         ed.WriteMessage("\nKeyword unknown");
  78.                         break;
  79.                 }
  80.             }
  81.             if (doubleRes.Status != PromptStatus.OK)
  82.             {
  83.                 ed.WriteMessage("\nUser entered: " + doubleRes.Status.ToString());
  84.             }
  85.         }

  86.         //Gets the radius of the circle from the user using GetDistance command
  87.         //and draw the circle.
  88.         //The user can either specify the number in the command prompt or
  89.         //The user can set the distance (in this case radius of circle) also
  90.         //by specifying two locations on the graphics screen.
  91.         //AutoCAD draws a rubber-band line from the first point to
  92.         //the current crosshair position to help the user visualize the distance.
  93.         [CommandMethod("GetDistance")]
  94.         public void DistanceTest()
  95.         {
  96.             Editor ed = Application.DocumentManager.MdiActiveDocument.Editor;
  97.             PromptDistanceOptions opt1 = new PromptDistanceOptions("Enter the radius of the circle");

  98.             opt1.AllowNegative = false;
  99.             opt1.AllowZero = false;
  100.             opt1.AllowNone = false;
  101.             opt1.UseDashedLine = true;

  102.             PromptDoubleResult res = ed.GetDistance(opt1);

  103.             if (res.Status == PromptStatus.OK)
  104.             {
  105.                 Point3d center = new Point3d(9.0, 3.0, 0.0);
  106.                 Vector3d normal = new Vector3d(0.0, 0.0, 1.0);
  107.                 Database db = Application.DocumentManager.MdiActiveDocument.Database;
  108.                 Autodesk.AutoCAD.DatabaseServices.TransactionManager tm = db.TransactionManager;
  109.                 using (Transaction myT = tm.StartTransaction())
  110.                 {
  111.                     BlockTable bt = (BlockTable)tm.GetObject(db.BlockTableId, OpenMode.ForRead, false);
  112.                     BlockTableRecord btr = (BlockTableRecord)tm.GetObject(bt[BlockTableRecord.ModelSpace], OpenMode.ForWrite, false);
  113.                     using (Circle pcirc = new Circle(center, normal, res.Value))
  114.                     {
  115.                         btr.AppendEntity(pcirc);
  116.                         tm.AddNewlyCreatedDBObject(pcirc, true);
  117.                     }
  118.                     myT.Commit();
  119.                 }

  120.             }

  121.         }



  122.         //The user is prompted to enter the start angle and end angle at the
  123.         //command prompt.  Using which an arc is created.

  124.         //Not only by entering the values but The user can set the angle also by
  125.         //specifying two 2D locations on the graphics screen. AutoCAD draws a
  126.         //rubber-band line from the first point to the current crosshair position
  127.         //to help the user visualize the angle.

  128.         //Also attached to this function is the input context reactor event
  129.         //PromptingForAngle and PromptedForAngle. During ed.GetAngle(), these
  130.         //events gets fired. The call back function just remembers the prompt option
  131.         //that the user has set initially and also the prompt result that the
  132.         //user sees after he calls GetAngle() method.


  133.         [CommandMethod("GetAngle")]
  134.         public void AngleTest()
  135.         {
  136.             Editor ed = Application.DocumentManager.MdiActiveDocument.Editor;
  137.             PromptAngleOptions opt1 = new PromptAngleOptions("Enter start angle of the arc");

  138.             opt1.AllowNone = false;
  139.             opt1.UseDashedLine = true;

  140.             //USAGE OF INPUT CONTEXT REACTORS
  141.             ed.PromptingForAngle += new PromptAngleOptionsEventHandler(handle_promptangleOptions);
  142.             ed.PromptedForAngle += new PromptDoubleResultEventHandler(handle_promptAngleResult);

  143.             PromptDoubleResult startAngle = ed.GetAngle(opt1);

  144.             ed.PromptingForAngle -= new PromptAngleOptionsEventHandler(handle_promptangleOptions);
  145.             ed.PromptedForAngle -= new PromptDoubleResultEventHandler(handle_promptAngleResult);


  146.             opt1.Message = "Enter end angle of the arc";
  147.             PromptDoubleResult endAngle = ed.GetAngle(opt1);

  148.             PromptDoubleOptions opt2 = new PromptDoubleOptions("Enter the radius of the arc(double)");
  149.             opt2.Message = "Enter the radius of the arc(double)";
  150.             PromptDoubleResult radius = ed.GetDouble(opt2);

  151.             if (startAngle.Status == PromptStatus.OK && endAngle.Status == PromptStatus.OK && radius.Status == PromptStatus.OK)
  152.             {
  153.                 Point3d center = new Point3d(30.0, 19.0, 0.0);
  154.                 Database db = Application.DocumentManager.MdiActiveDocument.Database;
  155.                 Autodesk.AutoCAD.DatabaseServices.TransactionManager tm = db.TransactionManager;

  156.                 using (Transaction myT = tm.StartTransaction())
  157.                 {
  158.                     BlockTable bt = (BlockTable)tm.GetObject(db.BlockTableId, OpenMode.ForRead, false);
  159.                     BlockTableRecord btr = (BlockTableRecord)tm.GetObject(bt[BlockTableRecord.ModelSpace], OpenMode.ForWrite, false);
  160.                     using (Arc arc1 = new Arc(center, radius.Value, startAngle.Value, endAngle.Value))
  161.                     {
  162.                         btr.AppendEntity(arc1);
  163.                         tm.AddNewlyCreatedDBObject(arc1, true);
  164.                     }
  165.                     myT.Commit();
  166.                 }

  167.             }
  168.             else
  169.             {
  170.                 ed.WriteMessage("Arc cannot be constructed");
  171.             }

  172.         }



  173.         [CommandMethod("useAngle")]
  174.         public void UsingAngleOptionsAndResults()
  175.         {
  176.             Editor ed = Application.DocumentManager.MdiActiveDocument.Editor;
  177.             //Verify GetAngle has been ran once before executing this one
  178.             if (useThisAngleOption == null || useThisAngleResult == null)
  179.             {
  180.                 ed.WriteMessage("Please run GetAngle command first");
  181.                 return;
  182.             }
  183.             //Using the stored PromptAngleOption.
  184.             PromptDoubleResult res1 = ed.GetAngle(useThisAngleOption);
  185.             //Using the stored PromptAngleResult.
  186.             PromptDoubleResult res2 = useThisAngleResult;
  187.             if (res1.Status == PromptStatus.OK && res2.Status == PromptStatus.OK)
  188.             {
  189.                 Database db = Application.DocumentManager.MdiActiveDocument.Database;
  190.                 Autodesk.AutoCAD.DatabaseServices.TransactionManager tm = db.TransactionManager;

  191.                 using (Transaction myT = tm.StartTransaction())
  192.                 {
  193.                     BlockTable bt = (BlockTable)tm.GetObject(db.BlockTableId, OpenMode.ForRead, false);
  194.                     BlockTableRecord btr = (BlockTableRecord)tm.GetObject(bt[BlockTableRecord.ModelSpace], OpenMode.ForWrite, false);
  195.                     Point3d center = new Point3d(30.0, 19.0, 0.0);
  196.                     using (Arc arc1 = new Arc(center, res1.Value, res2.Value, 5.0))
  197.                     {
  198.                         arc1.ColorIndex = 3;
  199.                         btr.AppendEntity(arc1);
  200.                         myT.AddNewlyCreatedDBObject(arc1, true);
  201.                     }
  202.                     myT.Commit();
  203.                 }

  204.             }
  205.             else
  206.             {
  207.                 ed.WriteMessage("Arc cannot be constructed");
  208.             }
  209.         }

  210.         //        Drawing a line using the points entered by the user.
  211.         //        Prompt the user for the start point and end point of the line.

  212.         //        The AutoCAD user can specify the point by entering a coordinate in
  213.         //        the current units format; The user can specify the point also by specifying
  214.         //        a location on the graphics screen.
  215.         [CommandMethod("GetPoint")]
  216.         public void PointTest()
  217.         {
  218.             Editor ed = Application.DocumentManager.MdiActiveDocument.Editor;
  219.             PromptPointOptions ptopts = new PromptPointOptions("Enter start point of the line");
  220.             ptopts.BasePoint = new Point3d(1, 1, 1);
  221.             ptopts.UseDashedLine = true;
  222.             ptopts.Message = "Enter start point of the line";

  223.             ed.PromptingForPoint += new PromptPointOptionsEventHandler(handle_promptPointOptions);
  224.             ed.PromptedForPoint += new PromptPointResultEventHandler(handle_promptPointResult);
  225.             PromptPointResult ptRes = ed.GetPoint(ptopts);
  226.             ed.PromptingForPoint -= new PromptPointOptionsEventHandler(handle_promptPointOptions);
  227.             ed.PromptedForPoint -= new PromptPointResultEventHandler(handle_promptPointResult);


  228.             Point3d start = ptRes.Value;
  229.             if (ptRes.Status == PromptStatus.Cancel)
  230.             {
  231.                 ed.WriteMessage("Taking (0,0,0) as the start point");
  232.             }

  233.             ptopts.Message = "Enter end point of the line: ";
  234.             ptRes = ed.GetPoint(ptopts);
  235.             Point3d end = ptRes.Value;
  236.             if (ptRes.Status == PromptStatus.Cancel)
  237.             {
  238.                 ed.WriteMessage("Taking (0,0,0) as the end point");
  239.             }

  240.             Database db = Application.DocumentManager.MdiActiveDocument.Database;
  241.             Autodesk.AutoCAD.DatabaseServices.TransactionManager tm = db.TransactionManager;

  242.             using (Transaction myT = tm.StartTransaction())
  243.             {
  244.                 BlockTable bt = (BlockTable)tm.GetObject(db.BlockTableId, OpenMode.ForRead, false);
  245.                 BlockTableRecord btr = (BlockTableRecord)tm.GetObject(bt[BlockTableRecord.ModelSpace], OpenMode.ForWrite, false);
  246.                 using (Line myline = new Line(start, end))
  247.                 {
  248.                     btr.AppendEntity(myline);
  249.                     tm.AddNewlyCreatedDBObject(myline, true);
  250.                 }
  251.                 myT.Commit();
  252.             }

  253.         }


  254.         [CommandMethod("usepoint")]
  255.         public void UsingPointOptionsAndResults()
  256.         {
  257.             Editor ed = Application.DocumentManager.MdiActiveDocument.Editor;
  258.             //Verify GetPoint has been ran once before executing this one
  259.             if (useThisPointOption == null || useThisPointResult == null)
  260.             {
  261.                 ed.WriteMessage("Please run GetPoint command first");
  262.                 return;
  263.             }
  264.             //Using the stored PromptPointOption.
  265.             PromptPointResult res1 = ed.GetPoint(useThisPointOption);
  266.             //Using the stored PromptPointResult.
  267.             PromptPointResult res2 = useThisPointResult;

  268.             if (res1.Status != PromptStatus.Cancel && res2.Status != PromptStatus.Cancel)
  269.             {
  270.                 Point3d start = res1.Value;
  271.                 Point3d end = res2.Value;
  272.                 Database db = Application.DocumentManager.MdiActiveDocument.Database;
  273.                 Autodesk.AutoCAD.DatabaseServices.TransactionManager tm = db.TransactionManager;
  274.                 using (Transaction myT = tm.StartTransaction())
  275.                 {
  276.                     BlockTable bt = (BlockTable)tm.GetObject(db.BlockTableId, OpenMode.ForRead, false);
  277.                     BlockTableRecord btr = (BlockTableRecord)tm.GetObject(bt[BlockTableRecord.ModelSpace], OpenMode.ForWrite, false);
  278.                     using (Line myline = new Line(start, end))
  279.                     {
  280.                         myline.ColorIndex = 3;
  281.                         btr.AppendEntity(myline);
  282.                         myT.AddNewlyCreatedDBObject(myline, true);
  283.                     }
  284.                     myT.Commit();
  285.                 }

  286.             }
  287.         }

  288.         //Here the user is prompted for a string that could be used as a keyword.
  289.         //We then test to see if the user entered string has been taken as a valid
  290.         //keyword or not by asking the user to enter that string as a keyword in the
  291.         //command prompt. If it is not a valid one then the user is prompted for a
  292.         //different value (which is a bug).
  293.         [CommandMethod("GetKW")]
  294.         public void KWandStringTest()
  295.         {
  296.             Editor ed = Application.DocumentManager.MdiActiveDocument.Editor;
  297.             PromptStringOptions stropts = new PromptStringOptions("Enter a string you want to use as keyword");
  298.             PromptKeywordOptions kwopts = new PromptKeywordOptions("Enter a string you want to use as keyword");
  299.             stropts.AllowSpaces = false;
  300.             PromptResult str = ed.GetString(stropts);
  301.             kwopts.Keywords.Add(str.StringResult);
  302.             kwopts.Keywords.Add("onemore");
  303.             kwopts.Message = "Enter the word that u just enterd to test if its a valid keyword or not";
  304.             PromptResult kw = ed.GetKeywords(kwopts);
  305.             if (kw.Status == PromptStatus.OK)
  306.             {
  307.                 ed.WriteMessage("You entered a valid keyword");
  308.             }
  309.             else
  310.             {
  311.                 ed.WriteMessage("You didn't enter a valid keyword: " + kw.Status.ToString());
  312.             }
  313.         }

  314.         //Try to draw a few entities in the drawing for the user to select.
  315.         //It prompts the user to select some entities and finally types
  316.         //the name of the selected entity at the command prompt.
  317.         //Also added the two input context reactor events:
  318.         //PromptingForEntity and PromptedForEntity
  319.         [CommandMethod("Getentity")]
  320.         public void EntityTest()
  321.         {
  322.             Editor ed = Application.DocumentManager.MdiActiveDocument.Editor;
  323.             PromptEntityOptions entopts = new PromptEntityOptions("Pick an entity of your choice from the drawing");
  324.             entopts.Message = "Pick an entity of your choice from the drawing";
  325.             PromptEntityResult ent = null;
  326.             //ADDED INPUT CONTEXT REACTOR   
  327.             ed.PromptingForEntity += new PromptEntityOptionsEventHandler(handle_promptEntityOptions);
  328.             ed.PromptedForEntity += new PromptEntityResultEventHandler(handle_promptEntityResult);

  329.             try
  330.             {
  331.                 ent = ed.GetEntity(entopts);
  332.             }
  333.             catch
  334.             {
  335.                 ed.WriteMessage("You did not select a valid entity");
  336.                 ed.PromptingForEntity -= new PromptEntityOptionsEventHandler(handle_promptEntityOptions);
  337.                 ed.PromptedForEntity -= new PromptEntityResultEventHandler(handle_promptEntityResult);

  338.             }
  339.             ed.PromptingForEntity -= new PromptEntityOptionsEventHandler(handle_promptEntityOptions);
  340.             ed.PromptedForEntity -= new PromptEntityResultEventHandler(handle_promptEntityResult);

  341.             if (ent.Status != PromptStatus.Error)
  342.             {
  343.                 ObjectId entid = ent.ObjectId;
  344.                 Database db = Application.DocumentManager.MdiActiveDocument.Database;
  345.                 Autodesk.AutoCAD.DatabaseServices.TransactionManager tm = db.TransactionManager;
  346.                 using (Transaction myT = tm.StartTransaction())
  347.                 {
  348.                     Entity entity = (Entity)tm.GetObject(entid, OpenMode.ForRead, true);
  349.                     ed.WriteMessage("You selected: " + entity.GetType().FullName);
  350.                     myT.Commit();
  351.                 }
  352.             }

  353.         }



  354.         //This method just makes use of the entity option and entity result
  355.         //that was stored in a static variable when the PromptingForEntity
  356.         //and PromptingForEntity events where fired from EntityTest() function.
  357.         [CommandMethod("useentity")]
  358.         public void UsingEntityOptionsAndResults()
  359.         {
  360.             Editor ed = Application.DocumentManager.MdiActiveDocument.Editor;
  361.             //Using the stored PromptEntityOption.
  362.             PromptEntityResult res1 = ed.GetEntity(useThisEntityOption);
  363.             //Using the stored PromptEntityResult.
  364.             PromptEntityResult res2 = useThisEntityResult;
  365.             ed.WriteMessage("\nCHANGING THE ALREADY SELECTED ENTITIES COLORS TO GREEN");
  366.             if (res2.Status != PromptStatus.Error)
  367.             {
  368.                 ObjectId entid = res2.ObjectId;
  369.                 Database db = Application.DocumentManager.MdiActiveDocument.Database;
  370.                 Autodesk.AutoCAD.DatabaseServices.TransactionManager tm = db.TransactionManager;
  371.                 ObjectId nowSelEntid = res1.ObjectId;

  372.                 using (Transaction myT = tm.StartTransaction())
  373.                 {
  374.                     Entity Oldentity = (Entity)tm.GetObject(entid, OpenMode.ForWrite, true);
  375.                     Oldentity.ColorIndex = 2;
  376.                     ed.WriteMessage("\nYou Now selected: " + Oldentity.GetType().FullName);
  377.                     myT.Commit();
  378.                 }
  379.             }

  380.         }

  381.         //Try to draw a few nested entities like blocks and xrefs in the drawing for the user to select.
  382.         //if the user selects a nested entity then the name of the nested entity is displayed.
  383.         //Finally after the user is done selecting the entities, a non interactive selection is made
  384.         //at the point 30.4,11.6,0 and the name of the nested entity if any is displayed.
  385.         [CommandMethod("GetNestentity")]
  386.         public void NestedEntityTest()
  387.         {
  388.             ObjectIdCollection coll = new ObjectIdCollection();
  389.             Editor ed = Application.DocumentManager.MdiActiveDocument.Editor;
  390.             PromptNestedEntityOptions entopts = new PromptNestedEntityOptions("prompt nested entity");
  391.             entopts.AllowNone = true;
  392.             entopts.Keywords.Add("Done");
  393.             PromptNestedEntityResult ent = null;
  394.             Database db = Application.DocumentManager.MdiActiveDocument.Database;
  395.             Autodesk.AutoCAD.DatabaseServices.TransactionManager tm = db.TransactionManager;

  396.             using (Transaction myT = tm.StartTransaction())
  397.             {
  398.                 while (true)
  399.                 {

  400.                     entopts.Message = "\nPick an entity of your choice from the drawing or type Done";

  401.                     try
  402.                     {
  403.                         ent = ed.GetNestedEntity(entopts);
  404.                     }
  405.                     catch
  406.                     {
  407.                         ed.WriteMessage("\nYou did not select a valid nested entity");
  408.                         break;
  409.                     }
  410.                     if (ent.Status == PromptStatus.Keyword)
  411.                     {
  412.                         if (ent.StringResult.Equals("Done"))
  413.                             break;
  414.                     }

  415.                     try
  416.                     {
  417.                         if (ent.GetContainers().Length > 0)
  418.                         {
  419.                             Entity entity;
  420.                             foreach (ObjectId oid in ent.GetContainers())
  421.                             {
  422.                                 entity = (Entity)tm.GetObject(oid, OpenMode.ForRead, true);
  423.                                 ed.WriteMessage("You selected: " + entity.GetType().FullName);
  424.                             }
  425.                             break;
  426.                         }
  427.                         else
  428.                         {
  429.                             ed.WriteMessage("You did not select any nested entity");
  430.                         }
  431.                     }
  432.                     catch
  433.                     {
  434.                         ed.WriteMessage("You are Done or did not select any nested entity");
  435.                         myT.Commit();
  436.                         return;
  437.                     }

  438.                 }

  439.                 entopts.NonInteractivePickPoint = new Point3d(30.4, 11.6, 0);
  440.                 entopts.UseNonInteractivePickPoint = true;

  441.                 try
  442.                 {
  443.                     ent = ed.GetNestedEntity(entopts);
  444.                     if (ent.GetContainers().Length > 0)
  445.                     {
  446.                         Entity entity;
  447.                         foreach (ObjectId oid in ent.GetContainers())
  448.                         {
  449.                             entity = (Entity)tm.GetObject(oid, OpenMode.ForRead, true);
  450.                             ed.WriteMessage(entity.GetType().FullName + " has been selected");
  451.                         }
  452.                     }
  453.                     else
  454.                     {
  455.                         ed.WriteMessage("No nested entity was selected");
  456.                     }
  457.                 }
  458.                 catch
  459.                 {
  460.                     ed.WriteMessage("\nNo entity was selected");

  461.                 }
  462.                 myT.Commit();
  463.             }

  464.         }
  465.         private static void handle_promptEntityOptions(object sender, PromptEntityOptionsEventArgs e)
  466.         {
  467.             useThisEntityOption = e.Options;

  468.         }
  469.         private static void handle_promptEntityResult(object sender, PromptEntityResultEventArgs e)
  470.         {
  471.             useThisEntityResult = e.Result;

  472.         }
  473.         private static void handle_promptPointOptions(object sender, PromptPointOptionsEventArgs e)
  474.         {
  475.             useThisPointOption = e.Options;

  476.         }
  477.         private static void handle_promptPointResult(object sender, PromptPointResultEventArgs e)
  478.         {
  479.             useThisPointResult = e.Result;

  480.         }
  481.         private static void handle_promptangleOptions(object sender, PromptAngleOptionsEventArgs e)
  482.         {
  483.             useThisAngleOption = e.Options;

  484.         }
  485.         private static void handle_promptAngleResult(object sender, PromptDoubleResultEventArgs e)
  486.         {
  487.             useThisAngleResult = e.Result;
  488.         }

  489.     }
  490. }
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!

已领礼包: 3758个

财富等级: 富可敌国

发表于 2014-7-18 21:54:30 | 显示全部楼层
谢谢分享,下来学习学习!:lol{:soso_e163:}
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|申请友链|Archiver|手机版|小黑屋|辽公网安备|晓东CAD家园 ( 辽ICP备15016793号 )

GMT+8, 2024-5-22 06:47 , Processed in 0.179963 second(s), 29 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表