简体   繁体   English

BIM 360和Revit API

[英]BIM 360 and the Revit API

Im trying to learn more about the Revit API as it works with BIM 360. I know I can determine isCloudInModel (which is available in the 2019 API, not the 2018 - and hopefully its available intentionally this time) and get the path using these strategies https://forums.autodesk.com/t5/revit-api-forum/determine-central-file-type-file-server-our-cloud/td-p/6506907 . 我试图了解有关Revit API的更多信息,因为它可以与BIM 360一起使用。我知道我可以确定isCloudInModel (可在2019 API中使用,而不是2018年 - 并且希望这次可以有意使用)并使用这些策略获取路径https://forums.autodesk.com/t5/revit-api-forum/determine-central-file-type-file-server-our-cloud/td-p/6506907

BIM 360 models don't seem to subscribe to Sync events, Im struggling to understand if I can subscribe to any events that have to do with synchronization, saving, opening or anything else. BIM 360模型似乎没有订阅Sync事件,我很难理解我是否可以订阅任何与同步,保存,打开或其他任何事件有关的事件。

Is there a reference for API and Limitations of models that are hosted on BIM 360? 是否存在BIM 360上托管的模型的API和限制的参考?

Through the Application/ControlledApplication classes you have methods for this. 通过Application / ControlledApplication类,您可以获得相应的方法。 You just need to have the logic for seeing if the application that is triggering the DocumentSynchronizing, DocumentSaving type Events is a BIM360 model. 您只需要具有用于查看触发DocumentSynchronizing,DocumentSaving类型事件的应用程序是否为BIM360模型的逻辑。 Which you can do with how you find the path. 您可以如何找到路径。

With the Forge API, through the Data Management API, you can use the PostModelJob endpoint which has this functionality: 使用Forge API,通过Data Management API,您可以使用具有此功能的PostModelJob端点:

Every time you synchronize the current model with the central model, it sets the data attribute to null. 每次将当前模型与中央模型同步时,它都会将data属性设置为null。 When you publish the latest version to BIM 360 Docs (using the PublishModel command), it sets the status to processing or complete. 当您将最新版本发布到BIM 360 Docs(使用PublishModel命令)时,它会将状态设置为处理或完成。

This will give you the information on if the model has been synced. 这将为您提供有关模型是否已同步的信息。 You also have to be using BIM 360 Docs and not BIM 360 Team. 您还必须使用BIM 360 Docs而不是BIM 360 Team。

Successful Retrieval of C4R Publish Status - Model Needs Publishing (200)

Note that if you have updated the central model, the data attribute is set to null until you publish it.

Request
  curl -X POST -v "https://developer.api.autodesk.com/data/v1/projects/b.project.id.xyz/commands/" -H "Authorization: Bearer kEnG562yz5bhE9igXf2YTcZ2bu0z" -H "Content-Type: application/vnd.api+json" -d '
  {
    "jsonapi": {
      "version": "1.0"
    },
    "data": {
      "type": "commands",
      "attributes": {
        "extension": {
          "type": "commands:autodesk.bim360:C4RModelGetPublishJob",
          "version": "1.0.0"
      }
    },
    "relationships": {
      "resources": {
        "data": [ { "type": "items", "id": "urn:adsk.wip:dm.file:hC6k4hndRWaeIVhIjvHu8w" } ]
      }
    }
  }
}'

Show Less
Response
{
  "data": null
  "jsonapi": {
    "version": "1.0"
  }
}

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

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