NCF参数化建筑论坛
标题:
【GhPython】导出GH电池的帮助文档
[打印本页]
作者:
月之眼
时间:
2019-9-9 16:45
标题:
【GhPython】导出GH电池的帮助文档
本帖最后由 月之眼 于 2019-9-9 17:00 编辑
今天有群友问,简单分享一下。希望对大家有帮助。
#coding=utf-8
import rhinoscriptsyntax as rs
docObjs = ghenv.Component.OnPingDocument().SelectedObjects()
for obj in docObjs:
objHelp = []
objHelp.append(obj.Name)
objHelp.append('\n')
objHelp.append(obj.Description)
objHelp.append("\n")
parInput = obj.Params.Input
parOutput = obj.Params.Output
objHelp.append("Input parameters: ")
for inp in parInput:
index1 = str(inp).find('_')
index2 = str(inp).find(' ')
objHelp.append(inp.NickName + "(" + str(inp)[index1+1:index2] + ")")
objHelp.append(inp.Description)
objHelp.append("\n")
objHelp.append("Output parameters:")
for oup in parOutput:
index1 = str(oup).find('_')
index2 = str(oup).find(' ')
objHelp.append(oup.NickName + "(" + str(oup)[index1+1:index2] + ")")
objHelp.append(oup.Description)
objHelp.append("\n")
objHelp.append("====================================================================================================================")
objHelp.append("\n")
for p in objHelp:
print (p)
复制代码
选中要导出help的电池,运行代码。代码运行之后,直接把panel导出txt。效果如下。
[attach]51879[/attach][attach]51881[/attach]
欢迎光临 NCF参数化建筑论坛 (http://ncf-china.com/)
Powered by Discuz! X3.2