【问题标题】:Cant extract metadata properties of large files无法提取大文件的元数据属性
【发布时间】:2021-11-21 09:02:33
【问题描述】:

我有一个大约 200MB 的 RVT 文件。当我使用 forge SDK (ObjectsApi.UploadObjectAsync()) 上传对象时,我多次收到超时错误,但后来不知何故上传了对象并提取了清单。

但是,在提取每张纸的modelViewMetadataProperties 时,它抛出了URN is too big to extract 错误,我无法处理它。

大文件如何上传对象并顺利提取modelViewMetadataProperties?

SDK版本:Assembly Autodesk.Forge, Version=1.9.0.0

【问题讨论】:

    标签: autodesk-forge


    【解决方案1】:

    要上传大文件,我建议您改用ObjectApi#UploadChunk。这是一个演示如何使用它的示例:https://github.com/yiskang/ForgeResumableUploadProgressDemo/blob/master/ForgeResumableUploadProgressDemo/Program.cs#L93

    关于属性问题,请按照Alex的建议添加forceget参数并将其设置为true。这是它的declaration

    /// <summary>
    /// 
    /// </summary>
    /// <remarks>
    /// Returns a list of properties for each object in an object tree. Properties are returned according to object ID and do not follow a hierarchical structure.  The following image displays a typical list of properties for a Revit object:  ![](https://developer.doc.autodesk.com/bPlouYTd/7/_images/Properties.png)  To call this endpoint you need to first call the [GET {urn}/metadata](https://developer.autodesk.com/en/docs/model-derivative/v2/reference/http/urn-metadata-GET) endpoint, which returns a list of model view (metadata) IDs for a design input model. Select a model view (metadata) ID to use when calling the Get Properties endpoint.  Note that you can only get properties from a design input file that was previously translated into an SVF file. 
    /// </remarks>
    /// <exception cref="Autodesk.Forge.Client.ApiException">Thrown when fails to make API call</exception>
    /// <param name="urn">The Base64 (URL Safe) encoded design URN </param>
    /// <param name="guid">Unique model view ID. Call [GET {urn}/metadata](https://developer.autodesk.com/en/docs/model-derivative/v2/reference/http/urn-metadata-GET) to get the ID </param>
    /// <param name="acceptEncoding">If specified with &#x60;gzip&#x60; or &#x60;*&#x60;, content will be compressed and returned in a GZIP format.  (optional)</param>
    /// <param name="objectid">Object id which you want to query properties for.</param>
    /// <param name="xAdsForce">If true - force retrieve the object tree even though it failed to be retrieved or got timeout (got 404 with error message) previously.</param>
    /// <param name="forceget">If true - To force get the large resource even if it exceeded the expected maximum length (20 MB).</param>
    /// <returns>Metadata</returns>
    /*Metadata*/
    dynamic GetModelviewProperties (string urn, string guid, string acceptEncoding = null, List<int> objectIds = null, bool xAdsForce = false, bool forceget = false);
    

    下面是它的用法示例:

    derivativeApi.GetModelviewProperties( urn, guid, null, null, false, true );
    

    【讨论】:

      【解决方案2】:

      对于超时错误,此链接可能会有所帮助How does the UploadObjectAsync() method work?

      关于元数据属性,文档说如果资源超过20mb,可以使用forceget参数查询true。该选项应该在 SDK 方法中可用。 URN Metadata Get Properties

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2019-05-24
        相关资源
        最近更新 更多