我正在尝试获取曲线的长度,但收到消息: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;
最佳答案
我快速浏览了 documentation .我认为您应该使用 rhinoscriptsyntax.CurveLength
。 AddLine
返回一个 Guid 而不是一个曲线对象。您可以将 Guid 传递给 CurveLength
。
rs.CurveLength(ln)
关于c# - 缺少成员异常 : 'Guid' object has no attribute 'length' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15914328/