简体   繁体   English

Revit,Python:如何获取打开项目文件的当前版本?

[英]Revit, Python: How to get the current build of an open project file?

I have a python file that needs to read the Version Year that the open project is currently in (for instance, the current project is in Revit 2020).我有一个 python 文件,需要读取打开的项目当前所在的版本年份(例如,当前项目在 Revit 2020 中)。 Once I get that, I can pass that info on to other portions of the script - basically telling it what folder to find the families for that version.一旦我知道了,我可以将该信息传递给脚本的其他部分——基本上告诉它在哪个文件夹中找到该版本的系列。

Make sense???说得通???

Problem is, I can't seem to find a clue for what I need to look for to get the version.问题是,我似乎无法找到获取版本所需的线索。

All right, paint me stupid.好吧,把我画成傻子。 Here's the PRETTY DAMN EASY ANSWER!这是该死的简单答案!

app = doc.Application

data = app.VersionNumber
print data

I like simple!我喜欢简单!

You might also want to take a look at the utility shared in this recent comment on The Building Coder discussion of Basic File Info and RVT File Version .您可能还想查看在最近关于基本文件信息和 RVT 文件版本的 The Building Coder 讨论中的评论中共享的实用程序。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM