【问题标题】:How to deserialize results of Autodesk.Forge.FoldersAPI.GetFolderContentsAsync(...)如何反序列化 Autodesk.Forge.FoldersAPI.GetFolderContentsAsync(...) 的结果
【发布时间】:2023-02-02 00:49:06
【问题描述】:

我正在尝试使用 forge .NET 客户端列出给定 BIM360 文件夹的文件内容以访问 Autodesk 的数据管理 API。

GetFolderContents 返回一个 Json Api 集合,但我对如何使用 SDK 模型对象反序列化响应数据感到困惑。

文档中的 C# 示例代码:

// Configure OAuth2 access token for authorization: oauth2_access_code
Configuration.Default.AccessToken = "YOUR_ACCESS_TOKEN";

var apiInstance = new FoldersApi();
var projectId = projectId_example;  // string | the `project id`
var folderId = folderId_example;  // string | the `folder id`
var filterType = new List<string>(); // List<string> | filter by the `type` of the `ref` target (optional)
var filterId = new List<string>(); // List<string> | filter by the `id` of the `ref` target (optional)
var filterExtensionType = new List<string>(); // List<string> | filter by the extension type (optional)
var pageNumber = 56;  // int? | specify the page number (optional)
var pageLimit = 56;  // int? | specify the maximal number of elements per page (optional)

try
{
    JsonApiCollection result = apiInstance.GetFolderContents(projectId, folderId, filterType, filterId, filterExtensionType, pageNumber, pageLimit);
    Debug.WriteLine(result);
}
catch (Exception e)
{
    Debug.Print("Exception when calling FoldersApi.GetFolderContents: " + e.Message );
}

【问题讨论】:

    标签: autodesk-forge forge autodesk-bim360


    【解决方案1】:

    请参考我们处理此问题的Hubs Browser 教程。

    具体在Data Browsing部分。

    您也可以查看repo

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-01-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-01-15
      • 1970-01-01
      相关资源
      最近更新 更多