Autodesk Forge Design Automation-错误打开模型-如何绕过对话框“模型已从远程位置传输" [英] Autodesk Forge Design Automation - Error Opening a model - How to bypass Dialog Box "Model has been transmitted from remote location"

查看:133
本文介绍了Autodesk Forge Design Automation-错误打开模型-如何绕过对话框“模型已从远程位置传输"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用Design Automation API从我们的BIM360帐户打开Revit模型.从以前的Revit版本升级

I'm trying to use the Design Automation api to open a Revit model from our BIM360 account, eg. to upgrade it from a previous version of Revit

当我在本地测试时,一些rvt文件在打开过程中会显示一个对话框:传输文件-该文件已从远程位置传输-参见附件图像(这是从BIM360下载的副作用)

When I test locally, some rvt files display a dialog box during opening: Transmitted File - this file has been transmitted from a remote location - see image attached (this is a side effect from being downloaded from BIM360)

打开文件对话框的对话框已传输的文件

我的问题是-我如何绕过此对话框,以便该插件可以与Design Aurtomation(其中不支持UI,对话框或警告)一起使用

my question is - how can I bypass this dialog box so that the addin can work with Design Aurtomation (in which no UI, dialogs or warnings are supported)

我对Jeremy T在此问题上的帖子进行了一些研究,并找到了一些有关如何使用DialogBoxShowing事件在对话框出现之前对其进行捕获和响应的信息. https://thebuildingcoder.typepad.com/blog/2009/06/autoconfirm-save-using-dialogboxshowing-event.html

I did some research on Jeremy T's posts on this issue, and found some information, about how to use the DialogBoxShowing event to catch and respond to dialog boxes before they appear.. https://thebuildingcoder.typepad.com/blog/2009/06/autoconfirm-save-using-dialogboxshowing-event.html

但是,问题在于此事件是UIApplication命名空间的一部分,因此在Design Automation云Revit引擎中可能不可用 https://www.revitapidocs.com/2017/cb46ea4c-2b80-0ec2-063f-dda6f662948a.htm

However, the problem is that this event is part of the UIApplication namespace, so is likely not available in the Design Automation cloud Revit engine https://www.revitapidocs.com/2017/cb46ea4c-2b80-0ec2-063f-dda6f662948a.htm

在任何情况下,打开模型时似乎都不会触发此特定事件

Also in any case it appears that this particular event is not fired when a model is opened https://forums.autodesk.com/t5/revit-api-forum/dialogboxshowing-event-not-firing-when-model-is-opened/td-p/5578594

关于如何打开传输的模型以使用Design Automation进行处理的任何想法?

Any ideas about how I can open transmitted models for processing with Design Automation?

谢谢!
埃德·G

Thanks!
Ed G

推荐答案

BIM 360中的文件是电子传输的工作共享文件.要在DesignAutomation for Revit中打开此类文件,您将需要使用 OpenOptions ( DetachAndPreserveWorksets DetachAndDiscardWorksets ).如果保留工作集并希望保存文件,请记住使用正确的 SaveAsOptions .

The file from BIM 360 is a eTransmitted workshared files. To open such a file in DesignAutomation for Revit, you will need to use OpenOptions (DetachAndPreserveWorksets or DetachAndDiscardWorksets). If you preserve the worksets and would like to save the file, remember to use the correct SaveAsOptions.

在活动中为输入文件明确指定一个本地名称:

Explicitly specify a local name to your input file in your activity:

{
  "alias": "prod",
  "activity": {
    "id": "YourActivity",
    "commandLine": [ "$(engine.path)\\\\revitcoreconsole.exe /al $(appbundles[YourBundle].path)" ],
    "parameters": {
      "rvtFile": {
        "zip": false,
        "ondemand": false,
        "verb": "get",
        "description": "Input Revit model",
        "required": true,
        "localName": "input.rvt",
      }
    },
    "engine": "Autodesk.Revit+2020",
    "appbundles": [ "YourName.YourBundle+label" ],
    "description": "Bundle description."
  }
}

在您的应用包中,使用 OpenOptions DetachAndPreserveWorksets DetachAndDiscardWorksets 打开文件输入文件"input.rvt".

In your app bundle open the file input file "input.rvt" using OpenOptions DetachAndPreserveWorksets or DetachAndDiscardWorksets.

   ModelPath path = ModelPathUtils.ConvertUserVisiblePathToModelPath("input.rvt");
   var opts = new OpenOptions
   {
      DetachFromCentralOption = DetachFromCentralOption.DetachAndPreserveWorksets
   };
   var document = application.OpenDocumentFile(path, opts);

我的 AU类(请观看37分钟的视频).

This was covered in the my AU class (see video at 37 min mark).

这篇关于Autodesk Forge Design Automation-错误打开模型-如何绕过对话框“模型已从远程位置传输"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆