如何从 zip 打开 .rvt 文件?

How to open .rvt file from zip?

我试图在 Design Automation for Revit 中打开 zip 文件夹中的 Revit 文件,但出现错误:

>  Autodesk.Revit.Exceptions.FileNotFoundException: The filePath:T:\Aces\Jobs32f21bb19d4605b941472d4961ed96\input.rvt to be opened doesn't exist.

我已经为“localname”和“pathInZip”尝试了不同的参数,但仍然出现此错误

我正在使用 OpenOptions 打开我的模型:

var path = ModelPathUtils.ConvertUserVisiblePathToModelPath("input.rvt");
        var openOptions = new OpenOptions();
        openOptions.DetachFromCentralOption = DetachFromCentralOption.DetachAndPreserveWorksets;
        Document doc = rvtApp.OpenDocumentFile(path, openOptions);

我的activity:

   {
    "commandLine": [
        "$(engine.path)\\revitcoreconsole.exe /al \"$(appbundles[AppBundle].path)\""
    ],
    "parameters": {
        "inputFile": {
            "zip":true,
            "verb": "get",
            "description": "Input Revit model",
            "required": true,
            "localName":"input.rvt"     
        }       
}

我的工作项目:

{
    "activityId": "activityId",
    "arguments": {
        "inputFile": {
        "pathInZip":"test.rvt",
            "url": "https://developer.api.autodesk.com/oss/v2/buckets/my_bucket/objects/test.zip",
            "Headers": {
                "Authorization": "Bearer {{Bearer}}"
            }

    }
}

根据下面的定义,Design Automation 会将 zip 解压缩到名为“input.rvt”的文件夹中,然后如果需要,在该文件夹中查找名为“test.rvt”的文件。

"parameters": {
        "inputFile": {
            "zip":true,
            "verb": "get",
            "description": "Input Revit model",
            "required": true,
            "localName":"input.rvt"     
        }
    "arguments": {
        "inputFile": {
        "pathInZip":"test.rvt",
            "url": "https://developer.api.autodesk.com/oss/v2/buckets/my_bucket/objects/test.zip",
            "Headers": {
                "Authorization": "Bearer {{Bearer}}"
            }
    }

关于zippathInzip的用法,你可以参考forge doc -->arguments-->*--> XrefTreeArgument--> pathInZip Or 看你想怎么用。