如果有3个点 可以考虑设置阈值过滤下点集
下面是我的测试代码
- [CommandMethod("ttss")]
- public void tt()
- {
- Document doc = Application.DocumentManager.MdiActiveDocument;
- Editor ed = doc.Editor;
- Database db = doc.Database;
- var res = ed.GetEntity("\nSelect a Curve:");
- if (res.Status == PromptStatus.OK)
- {
- using (var tr = doc.TransactionManager.StartTransaction())
- {
- Curve c = tr.GetObject(res.ObjectId, OpenMode.ForRead) as Curve;
- ed.WriteMessage("\nTotal Knots:{0}", c.EndParam);
- var opts = new PromptPointOptions("\nSelect a Point:");
- opts.AllowNone = true;
- opts.AllowArbitraryInput = true;
- var res2 = ed.GetPoint(opts);
- while (res2.Status == PromptStatus.OK)
- {
- ed.WriteMessage("\nPoint:{0},Param:{1}", res2.Value, c.GetParameterAtPoint(res2.Value));
- res2 = ed.GetPoint(opts);
- }
- }
- }
- }
|