我正在尝试获取曲线的长度,但我收到消息: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;
答案 0 :(得分:5)
我快速浏览了documentation。我认为你应该使用rhinoscriptsyntax.CurveLength
。 AddLine
返回Guid而不是曲线对象。您可以将Guid传递给CurveLength
。
rs.CurveLength(ln)