目标
- 将低版本revit族库批量升级到2023版本
环境
- Dynamo 2.16.1
- Revit 2023
下载dyn
Revit version reporter.dyn
https://pan.baidu.com/s/1dQTQrXOcFT_WRdV6Pt44Gw?pwd=git3
前提
- 本地已安装Revit 2023
逻辑
- 输入:文件夹路径
- 执行:遍历所有目录,找到所有族文件,通过info.Format接口获取文件的revit版本
Python Scropt
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
import clr clr.AddReference("RevitAPI") import Autodesk from Autodesk.Revit.DB import * clr.AddReference("RevitNodes") import Revit clr.ImportExtensions(Revit.Elements) clr.ImportExtensions(Revit.GeometryConversion) #The inputs to this node will be stored as a list in the IN variables. path = IN[0] listout = [] for p in path: try: info = BasicFileInfo.Extract(p) version = info.Format listout.append(p + ' 【' + version + '】' ) except: listout.append("failed") OUT = listout |
使用
- 打开Revit 2023
- 运行Dynamo
- 打开Revit version reporter.dyn
- 选择包含族文件的文件夹
- 点击左下角运行dyn程序
- 等待执行完成
- 在Watch窗口中查看各个文件的版本
- All Done!
截图
know more
https://forum.dynamobim.com/t/get-revit-version-while-loading-family/10211/13
There are no comments yet