简体   繁体   English

具有动态文件名的 Revit Design 自动化控制打开过程

[英]Revit Design Automation Control Open Process with Dynamic File Name

We have a design automation application for Revit that handles models from BIM 360 and we would like to open models using our own process so we can modify what worksets are opened, etc. We have found the link at https://www.autodesk.com/autodesk-university/class/Getting-Started-Design-Automation-Revit-Forge-2019#handout .我们有一个 Revit 设计自动化应用程序,可以处理来自 BIM 360 的模型,我们希望使用我们自己的流程打开模型,以便我们可以修改打开的工作集等。我们在https://www.autodesk找到了链接。 com/autodesk-university/class/Getting-Started-Design-Automation-Revit-Forge-2019#handout According to that, though, you have to hard code the name of the rvt file as a specific name in order to open it.尽管如此,您必须将 rvt 文件的名称硬编码为特定名称才能打开它。 However, we have some places that the name of the model is used in the exported data so we would like to keep the name as it originally appeared.但是,我们有一些地方在导出的数据中使用了模型的名称,因此我们希望保留最初出现的名称。

Is it possible to reference the command arguments from within the application?是否可以从应用程序内部引用命令参数? Right now we have our parameter for the model on the activity defined as follows:现在我们的活动模型参数定义如下:

    "rvtFile": {
        "zip": false,
        "ondemand": false,
        "verb": "get",
        "description": "Input Revit Model",
        "required":true,
        "localName": "$(rvtFile)"
    },

And the command line looks like this:命令行如下所示:

"commandLine":["$(engine.path)\\\\revitcoreconsole.exe /i \"$(args[rvtFile].path)\" /al \"$(appbundles[{{ BundleId  }}{{ RevitVersion }}].path)\""]

So the local name is dynamic and is just opened by DA using the command line.所以本地名称是动态的,只是由 DA 使用命令行打开。 However since we want to control the opening process we need to pull the Revit file out of the command line and be able to figure out the path to the file to be opened.然而,由于我们想要控制打开过程,我们需要从命令行中拉出 Revit 文件,并能够找出要打开的文件的路径。 I'm not sure how to do this reliably since it's dynamic;我不确定如何可靠地做到这一点,因为它是动态的; any help would be appreciated.任何帮助,将不胜感激。

Following the blog announcement , Design Automation for Revit ( revitcoreconsoole.exe ) by default preserves the worksets for /i \\"$(args[rvtFile].path)\\" arguments.博客公告之后,Design Automation for Revit ( revitcoreconsoole.exe ) 默认保留/i \\"$(args[rvtFile].path)\\"参数的工作集。 You no longer have to use the hard coded name on the input file and try opening the model yourself.您不再需要在输入文件上使用硬编码名称并尝试自己打开模型。 You should be able to use dynamic file name.您应该能够使用动态文件名。

Improved the default behavior for opening and saving models that have worksharing enabled, in order to preserve worksets on open, and support saving the model as a new central.改进了打开和保存启用了工作共享的模型的默认行为,以便在打开时保留工作集,并支持将模型保存为新的中心。

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

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