Forge模型派生试图通过外部IDID获取对象属性失败,但可以与ObjectID一起使用

发布于 2025-01-24 18:07:25 字数 2448 浏览 3 评论 0 原文

使用此模型衍生物端点我们想通过使用其外部ID调用对象来检索对象的属性。我们遵循解释的过程

在这种情况下,端点使用objectID来起作用,在这种情况下:

    "data": {
        "type": "properties",
        "collection": [
            {
                "objectid": 3,
                "name": "Finished Ceiling Height",
                "externalId": "5d365ed4-cccc-4589-b4e1-a8c5c744672a-0046dd63",
                "properties": {
                    "General": {
                        "Override": ""
                    },
                    "Extents": {
                        "Scope Box": "None"
                    },
                    "Constraints": {
                        "Elevation": "8.667 ft-and-fractional-in",
                        "Story Above": "Default"
                    },
                    "Dimensions": {
                        "Computation Height": "3.000 ft-and-fractional-in"
                    },
                    "Identity Data": {
                        "Name": "Finished Ceiling Height",
                        "Structural": "No",
                        "Building Story": "Yes",
                        "Asset ID": "",
                        "Asset Location": "",
                        "Asset Category": "",
                        "Workset": "Shared Views, Levels, Grids",
                        "Edited by": ""
                    }
                    
                }
            }
        ]
    }
}

文档指出我们也可以使用externexit来获得相同的结果。

如果再次将设计转换为SVF或SVF2,则可以更改对象的对象。如果您需要持续的ID来引用对象,请使用外部ID。

但是更改ObjectId = 3 to Objectid = 5D365ED4-CCCC-4589-B4E1-A8C5C7444672A-0046DD63 返回错误400:

{
    "diagnostic": "Invalid 'objectid' parameter"
}

我们还试图将GUID转换为base64,而不是objectid作为参数名称。一切都具有相同的结果。

有什么想法吗?我们在错过文档吗?

注意:目前还不是一个选择,也不是下载sqlite/json文件

[edit 1] 我们尝试将查询参数设置为外部INTERCENID/externalId接收相同的结果。

curl --location --request GET 'https://developer.api.autodesk.com/modelderivative/v2/designdata/urn/metadata/guid/properties?externalId=43f2c4e0-d09b-4151-a349-1b6f684411c6-004c8717' \
--header 'x-ads-force: true' \
--header 'x-ads-derivative-format: fallback' \
--header 'Authorization: Bearer XXXXXXX

Using this Model Derivative endpoint we want to retrieve the properties of an object by calling it with its externalId. We follow the procedure explainined here.

The endpoint works using the objectid, in this case 3:

    "data": {
        "type": "properties",
        "collection": [
            {
                "objectid": 3,
                "name": "Finished Ceiling Height",
                "externalId": "5d365ed4-cccc-4589-b4e1-a8c5c744672a-0046dd63",
                "properties": {
                    "General": {
                        "Override": ""
                    },
                    "Extents": {
                        "Scope Box": "None"
                    },
                    "Constraints": {
                        "Elevation": "8.667 ft-and-fractional-in",
                        "Story Above": "Default"
                    },
                    "Dimensions": {
                        "Computation Height": "3.000 ft-and-fractional-in"
                    },
                    "Identity Data": {
                        "Name": "Finished Ceiling Height",
                        "Structural": "No",
                        "Building Story": "Yes",
                        "Asset ID": "",
                        "Asset Location": "",
                        "Asset Category": "",
                        "Workset": "Shared Views, Levels, Grids",
                        "Edited by": ""
                    }
                    
                }
            }
        ]
    }
}

The documentation states that we could also use externalId to get the same result.

The objectid of an object can change if the design is translated to SVF or SVF2 again. If you require a persistent ID to reference an object, use externalId.

But changing objectid=3 to objectid=5d365ed4-cccc-4589-b4e1-a8c5c744672a-0046dd63 returns an error 400:

{
    "diagnostic": "Invalid 'objectid' parameter"
}

We also tried to convert the GUID to base64, use externalid instead of objectid as the parameter name. Everything with the same results.

Any ideas? Are we missunderstanding the documentation?

Note: Accesing the viewer is not an option at the moment, neither downloading the sqlite/json files

[Edit 1]
We tried setting the query parameter as externalId/externalid receiving the same results.

curl --location --request GET 'https://developer.api.autodesk.com/modelderivative/v2/designdata/urn/metadata/guid/properties?externalId=43f2c4e0-d09b-4151-a349-1b6f684411c6-004c8717' \
--header 'x-ads-force: true' \
--header 'x-ads-derivative-format: fallback' \
--header 'Authorization: Bearer XXXXXXX

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

半暖夏伤 2025-01-31 18:07:25

ObjectID参数仅接受数值。从API响应中可以看到,ObjectID是数值。不幸的是,您不能将字符串传递给此参数。

但是,我们的工程团队正在研究支持更多过滤器的新物业API。您可能对 20分钟。

The objectId parameter accepts numerical values only. As you can see from the API response, objectId is a numerical value. You cannot pass a string to this parameter, unfortunately.

However, our engineering team is working on the new property API which supports more filters. You might be interested in the new property metadata API mentioned in https://www.autodesk.com/autodesk-university/class/Forge-Road-Map-2021 at 20 mins.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文