NCF参数化建筑论坛

标题: 请教如何在Gh中调用rhino的图层命令。 [打印本页]

作者: anturong    时间: 2019-9-22 19:51
标题: 请教如何在Gh中调用rhino的图层命令。
比如我将brep,bake到指定图层。想自己写个插件。因为要将brep不同规格分组,所以须要写个图层插件。进行归类烘焙方使在rhino中按图层做后边工作

作者: 元子Leo    时间: 2019-9-22 19:51
直接上附件

作者: 元子Leo    时间: 2019-9-23 07:11
本帖最后由 元子Leo 于 2019-9-23 09:12 编辑

如果你用 Python 插件:

import rhinoscriptsyntax as rs

之后你就可以调用了

developer.rhino3d.com/api/rhinoscript/layer_methods/layer_methods.htm

作者: anturong    时间: 2019-9-23 19:35
可以给出完整代码吗。我写完出错了
作者: anturong    时间: 2019-9-23 19:35
本帖最后由 anturong 于 2019-9-23 20:18 编辑
元子Leo 发表于 2019-9-23 07:11
如果你用 Python 插件:

import rhinoscriptsyntax as rs

可以给出完整代码吗。我写完出错了
Runtime error (UnboundNameException): name 'AddLayer' is not defined

Traceback:
  line 2, in script


作者: 元子Leo    时间: 2019-9-23 22:58
anturong 发表于 2019-9-23 19:35
可以给出完整代码吗。我写完出错了
Runtime error (UnboundNameException): name 'AddLayer' is not def ...

import rhinoscriptsyntax as rs

newLayer = rs.AddLayer(...)
作者: anturong    时间: 2019-9-24 09:52
元子Leo 发表于 2019-9-23 22:58
import rhinoscriptsyntax as rs

newLayer = rs.AddLayer(...)

运行时错误(不支持例外):这种类型的对象在蚱蜢中不支持,因此此Python脚本不能创建它。你可能想用“脚本”来代替“犀牛医生”吗?如果你这样做,记得恢复它:“脚本。
回溯:
在rhino中可以运行。但我是想在grasshopper中使用,上边是出错信息。
应当有其它的方法调用。哎!!不会英文真难。
作者: 元子Leo    时间: 2019-9-24 12:33
Don't worry my friend.

[attach]51968[/attach]

Reference:
[attach]51969[/attach]

作者: 陌烟苏    时间: 2020-1-2 16:12
bake(右键单击电池,里面的bake选项)的时候可以选择图层的。
作者: 410503238    时间: 2020-6-22 16:53
这个插件怎么用?只能先建图层,还是改变不了物件到对应图层啊
作者: chujiu    时间: 2022-9-9 11:18
围观学习一下





欢迎光临 NCF参数化建筑论坛 (http://www.ncf-china.com/) Powered by Discuz! X3.2