MissingMemberException:'Guid'对象没有属性'length'

时间:2013-04-09 23:26:02

标签: c# python ironpython grasshopper rhino3d

我正在尝试获取曲线的长度,但我收到消息:MissingMemberException: 'Guid' object has no attribute 'length' C#中的相同脚本完美无缺。 python翻译有什么问题?这是Documentation

PYTHON:

import rhinoscriptsyntax as rs

ln = rs.AddLine(pt1, pt2)

a = ln 
b = ln.Length

C#:

Line ln;

ln = new Line(pt1, pt2);

A = ln;
B = ln.Length;

1 个答案:

答案 0 :(得分:5)

我快速浏览了documentation。我认为你应该使用rhinoscriptsyntax.CurveLengthAddLine返回Guid而不是曲线对象。您可以将Guid传递给CurveLength

rs.CurveLength(ln)