简体   繁体   English

在 Revit 插件中 .net dll 列出可用的 BIM 360 项目,然后打开可用的 BIM 360 模型

[英]In a Revit add-on .net dll List the available BIM 360 Projects then the available BIM 360 Models to open

In my Revit add-on I would like to write a command that I can open multiple BIM 360 models.在我的 Revit 插件中,我想编写一个可以打开多个 BIM 360 模型的命令。 I have 10 models to open in a project to work on simultaniously each morning.我每天早上要在一个项目中同时打开 10 个模型。 I have a command that will open multiple models from a network location.我有一个命令可以从网络位置打开多个模型。 However I would like to write a similar command that will open the cloud models.但是我想编写一个类似的命令来打开云模型。 It will save me loads of time.这将节省我大量的时间。 They can be all opening while I make coffee.我煮咖啡时,它们都可以打开。

  1. Using .net how can I get a list of the available projects to use in a new dialog I can create.使用 .net 如何获取可用项目列表以在我可以创建的新对话框中使用。
  2. Once the project is selected, get a list of the available models to open.选择项目后,获取要打开的可用模型列表。
  3. Open the models in Revit.在 Revit 中打开模型。

If there is a browser dialog solution, sure it will be better, but please it needs to be very simple to simply list & open the models in Revit.如果有浏览器对话框解决方案,肯定会更好,但是在 Revit 中简单列出和打开模型需要非常简单。

        Dim OpenOptions As New OpenOptions
        Dim ModelPath As ModelPath = ModelPathUtils.ConvertCloudGUIDsToCloudPath(ModelPathUtils.CloudRegionEMEA, projectGuid, modelGuid)
        commandData.Application.OpenAndActivateDocument(ModelPath, OpenOptions, False)

Thanks谢谢

These two topics have been discussed here in the past, eg, in listing model files in BIM360 through data management API .这两个主题过去在这里已经讨论过,例如, 通过数据管理 API 在 BIM360 中列出 model 文件 You can find many more related discussions by searching, eg, for ' list bim360 '.您可以通过搜索找到更多相关讨论,例如“ list bim360 ”。

Those solutions are cloud based, so they cannot be addressed using the pure Windows desktop Revit .NET API.这些解决方案基于云,因此无法使用纯 Windows 桌面 Revit .NET API 解决。 Therefore, the browser-based approach that you yourself suggest might be a good starting point for this first step of listing the available models.因此,您自己建议的基于浏览器的方法可能是列出可用模型的第一步的良好起点。

The second step is to open the BIM360 models in Revit once you have determined their paths.第二步是在确定路径后在 Revit 中打开 BIM360 模型。

This was addressed in May last year by The Building Coder in the note on locally opening RVT file managed by BIM360 , and here on StackOverflow in the question on how to open Revit BIM360 model via command line .去年 5 月,The Building Coder 在关于本地打开由 BIM360 管理的 RVT 文件的说明中解决了这个问题,在 StackOverflow 上关于如何通过命令行打开 Revit BIM360 model的问题中解决了这个问题。 Things are in flux in this area, though, and may have changed since then.不过,这方面的情况在不断变化,从那时起可能已经发生了变化。

The safest way to achieve this currently is also to use the web-based Forge API.目前实现这一目标的最安全方法也是使用基于 Web 的 Forge API。

Native Revit API functionality supporting the opening of a BIM360 hosted model directly in Revit on the desktop is in the works but not ready quite yet, I'm afraid.原生 Revit API 功能支持直接在桌面上的 Revit 中打开 BIM360 托管 model 的功能正在开发中,但恐怕还没有准备好。

Here are some notes from previous related conversations that I have not yet gotten around to editing and publishing:以下是之前相关对话中的一些笔记,我尚未开始编辑和发布:

Processing BIM360 model:加工BIM360 model:

Question: As much a BIM M360 as a Revit question: I'm programming some Revit desktop plugins using pyRevit/Python, and I'm trying to automate the linking of Revit files that live within BIM360.问题:BIM M360 和 Revit 问题一样多:我正在使用 pyRevit/Python 编写一些 Revit 桌面插件,并且我正在尝试自动链接 BIM360 中的 Revit 文件。 For example, I'd like to be able to open a file from one BIM360 project and copy it to another BIM360 project (including all of the linked files), and then re-path all of the links in the copied model to read from the new project.例如,我希望能够从一个 BIM360 项目中打开一个文件并将其复制到另一个 BIM360 项目(包括所有链接的文件),然后重新路径复制的 model 中的所有链接以读取新项目。 There are a number of other interactions I'm looking at as well, but that's the biggest hurdle at the moment.我也在研究其他一些交互,但这是目前最大的障碍。 We're working in Revit 2019, with eyes toward 2020, if that helps get to the bottom of things.我们正在 Revit 2019 中工作,着眼于 2020 年,如果这有助于了解事情的真相。

Answer: One little part of the task you address is discussed here, on opening a BIM360 model via the desktop command line and the Revit API .答:这里讨论了您解决的任务的一小部分, 即通过桌面命令行和 Revit API 打开 BIM360 model Maybe the same approach can be used to handle the linking as well.也许同样的方法也可以用来处理链接。

Stepping back a bit, what kind of Revit file are you targeting?退一步说,您的目标是哪种 Revit 文件?

A Revit model may be stored in BIM360 in three ways: Revit model 可以通过三种方式存储在 BIM360 中:

  • Revit cloud worksharing Revit 云工作共享
  • File based and uploaded to BIM 360 directly基于文件并直接上传到 BIM 360
  • Desktop connector桌面连接器

Ad 1: There is no API to access #1.广告 1:没有 API 可以访问 #1。 You can publish to BIM 360 using forge API.您可以使用 forge API 发布到 BIM 360。 But currently, you cannot set the same environment through api.但目前,您无法通过 api 设置相同的环境。

Ad 2: You can use forge API to upload and download.广告2:可以使用forge API上传下载。

Ad 3: No Desktop connecter API, but I believe you can use normal Windows API for the part that copies files within folders.广告3:没有桌面连接器API,但我相信你可以使用普通的Windows API用于在文件夹中复制文件的部分。

We may still need to do a bit of research.我们可能还需要做一些研究。 But something we need to look into separately one by one.但有些事情我们需要一一单独研究。 Could you clarify on these?你能澄清一下这些吗?

Response: I think I'm using the models based on #1 above, although I'm not 100% sure if I have my terminology correct.回应:我认为我正在使用基于上述#1 的模型,尽管我不能 100% 确定我的术语是否正确。 Essentially, we're hosting our files on BIM360 (the old C4R way of doing things, whatever it's called now) and uploading the workshared model through Revit.从本质上讲,我们将文件托管在 BIM360(旧的 C4R 做事方式,无论现在叫什么),并通过 Revit 上传工作共享 model。 We're then interacting with it from there.然后我们从那里与之交互。 I have a feeling that that description probably confuses things even more, but hopefully not.我有一种感觉,这种描述可能会使事情更加混乱,但希望不会。 In a broad sense, our idea is to have a 'library' of pieces of buildings (RVT files) living on a cloud server somewhere.从广义上讲,我们的想法是在某处的云服务器上建立一个建筑物(RVT 文件)的“库”。 We'd then have an interface that allows users to select various configurations of those library pieces, and the tool would copy those pieces into a new project and automatically link them together based on some rules built into the tool.然后,我们将有一个界面,允许用户对这些库片段的各种配置进行 select,该工具会将这些片段复制到一个新项目中,并根据工具中内置的一些规则将它们自动链接在一起。 We have a working version of the tool for workshared models on our own internal servers, but we'd prefer it in the cloud – specifically, Autodesk cloud services, since they are meant to deal with Revit files.我们在我们自己的内部服务器上有一个用于工作共享模型的工具的工作版本,但我们更喜欢它在云中 - 特别是 Autodesk 云服务,因为它们旨在处理 Revit 文件。 Not sure if that made things clearer, or muddied the waters even more.不确定这是否使事情变得更清楚,或者使水域更加混乱。

You might also want to study the article by Eason Kang on BIM360 Docs: Setting up external references between files (Upload Linked Files) .您可能还想学习 Eason Kang 在BIM360 Docs 上的文章:设置文件之间的外部引用(上传链接文件)

Finally, to wrap up, the complete working sample implementing a desktop app to view models on hubs (BIM 360 or Fusion Team) might fulfil a large part of your requirements right out of the box.最后,总结一下,实施桌面应用程序以查看集线器(BIM 360 或 Fusion Team)上的模型的完整工作示例可能会立即满足您的大部分要求。

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

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