# 还是个RhinoCommon 问题

**URL:** <https://cn.discourse.mcneel.com/t/rhinocommon/635>\
**Category:** Rhino for Windows\
**Created:** [2015年五月3日 09:34 UTC](https://cn.discourse.mcneel.com/t/rhinocommon/635 "2015-05-03T09:34:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mdjcad](https://avatars.discourse-cdn.com/v4/letter/m/5f9b8f/32.png) [@mdjcad](https://cn.discourse.mcneel.com/u/mdjcad)\
**Post date:** [2015年五月3日 09:34 UTC](https://cn.discourse.mcneel.com/t/rhinocommon/635/1 "2015-05-03T09:34:06Z")

</div>

选择一条曲线，怎么找到它的knots点，并转为point3d.  
@KelvinC

---

<div class="post-metadata">

**Author:** ![KelvinC](https://sea3.discourse-cdn.com/mcneel/user_avatar/cn.discourse.mcneel.com/kelvinc/32/3391_2.png) [@KelvinC](https://cn.discourse.mcneel.com/u/KelvinC)\
**Post date:** [2015年五月3日 14:22 UTC](https://cn.discourse.mcneel.com/t/rhinocommon/635/2 "2015-05-03T14:22:47Z")

</div>

Hi @dale,

@mdjcad would like to know how to extract the knots from a curve as 3d points. What function can he use? Do you have an example code? Thanks.

---

<div class="post-metadata">

**Author:** ![mdjcad](https://avatars.discourse-cdn.com/v4/letter/m/5f9b8f/32.png) [@mdjcad](https://cn.discourse.mcneel.com/u/mdjcad)\
**Post date:** [2015年五月4日 00:09 UTC](https://cn.discourse.mcneel.com/t/rhinocommon/635/3 "2015-05-04T00:09:40Z")

</div>

@KelvinC  
我开始表达有问题。  
正确的是，我想找到一条曲线的EditPt,就是 EditPtOn 命令显示的点，想获得这些点的 Point3d 值。我在英文版也有发，不知表达对不对。 😔  
[http://discourse.mcneel.com/t/how-to-get-point3d-of-knots-on-an-curve/19654](http://discourse.mcneel.com/t/how-to-get-point3d-of-knots-on-an-curve/19654)

---

<div class="post-metadata">

**Author:** ![KelvinC](https://sea3.discourse-cdn.com/mcneel/user_avatar/cn.discourse.mcneel.com/kelvinc/32/3391_2.png) [@KelvinC](https://cn.discourse.mcneel.com/u/KelvinC)\
**Post date:** [2015年五月4日 00:19 UTC](https://cn.discourse.mcneel.com/t/rhinocommon/635/4 "2015-05-04T00:19:12Z")

</div>

你的問題表答沒問題。

以下是 Dale 的回覆，不過他回答的的是 Knot，不是 Edit Point。

Hi Kelvin,

Not all types of curves have knots, such as lines, polylines, circles, and arcs. Of course, they can be represented as NURBS.

Anyway, to get the knots of a NURBS curve, use Rhino.Geometry.NurbsCurve.Knots. Here is a RhinoCommon, C#, example:

–  
protected override Result RunCommand(RhinoDoc doc, RunMode mode)  
{  
ObjRef obj\_ref;  
var rc = RhinoGet.GetOneObject(  
“Select NURBS curve”,  
false, ObjectType.Curve,  
out obj\_ref  
);

if (rc != Result.Success)  
return rc;

var nc = obj\_ref.Curve() as NurbsCurve;  
if (null == nc)  
{  
RhinoApp.WriteLine(“Not a NURBS curve.”);  
return Result.Nothing;  
}

for (var i = 0; i \< nc.Knots.Count; i++)  
RhinoApp.WriteLine(“Knot {0} = {1}”, i, nc.Knots[i]);

## return Result.Success; }

– Dale

Dale Fugier  
Rhinoceros Development  
Robert McNeel & Associates

---

<div class="post-metadata">

**Author:** ![mdjcad](https://avatars.discourse-cdn.com/v4/letter/m/5f9b8f/32.png) [@mdjcad](https://cn.discourse.mcneel.com/u/mdjcad)\
**Post date:** [2015年五月4日 02:16 UTC](https://cn.discourse.mcneel.com/t/rhinocommon/635/5 "2015-05-04T02:16:03Z")

</div>

@KelvinC  
谢谢你，英文版有人回答了edit point问题。
