使用Grasshopper:如果我将一个domain传递到Python组件中,Python将其视为一个间隔。我可以对它进行操作,如下所示:
print x
x.Grow(x[0]-y)
x.Grow(x[1]+y)
print x
print type(x)
print dir(x)
哪个打印:
^{pr2}$但是,我不知道如何建造一个新的。它们看起来很有用,我想多用一些。在
我已经尝试导入interval模块(Runtime error (ImportException): No module named interval
)。我尝试过将列表转换为一个间隔:Interval([1,2])
→Runtime error (UnboundNameException): name 'Interval' is not defined
。在
我不知道区间是属于Python,铁蟒还是蚱蜢。在
我该怎样做一个新的间隔?在
在一些帮助下,我最终得到了:
它给出了:
^{pr2}$如果我们解压:IronPython的}给出了{},它告诉我如何去做。在
type()
函数实际上返回一个包装.NET类型的PythonType。.GetType()
直接获取.NET类型。所以type(x)
给出了<type 'Interval'>
,这并不是很有帮助,而{这在Rhino docs here中有介绍,它有许多有用的属性和方法。在
相关问题 更多 >
编程相关推荐