关于使用Forge .Net SDK更新Autodesk Docs/BIM360文档元数据的技术咨询
Great question! Let’s clear this up for you step by step.
First off, you’re right—the official Forge SDKs (across Python, JavaScript, .NET, etc.) don’t have a dedicated, pre-built method for setting metadata/custom attributes on already uploaded BIM360/Autodesk Docs documents. This isn’t an oversight, though: the underlying Forge Data Management API fully supports this functionality, it just hasn’t been wrapped into a convenient SDK method yet.
Since BIM360 and Autodesk Docs are both built on the Forge platform, you can use the same REST API workflow to update metadata for both services. Here’s how to do it:
Step 1: Get a valid access token
You’ll need a token with thedata:writescope. Use the standard Forge OAuth flow (client credentials or 3-legged auth) to generate this.Step 2: Locate your document’s identifiers
You’ll need the project ID, item ID, and version ID of the target document. You can fetch these via the Forge Data Management API’s endpoints (like listing items in a project) if you don’t already have them.Step 3: Call the PATCH API endpoint
Use thePATCH /data/v1/projects/{project_id}/items/{item_id}/versions/{version_id}endpoint to update the custom attributes. Here’s an example request body (JSON):{ "attributes": { "customAttributes": { "ProjectPhase": "Construction", "CostCode": "CC-789", "Owner": "Jane Doe" } } }Important note: The custom attribute keys you use must already exist in your BIM360/Autodesk Docs project’s custom attribute settings (configured via the web UI). If you try to use a key that hasn’t been defined, the API will return an error.
Bonus: Wrap it in your own SDK helper
If you prefer using the SDK, you can leverage its built-in HTTP client to make this PATCH request directly. For example, in JavaScript’sforge-apislibrary, you can use theApiClientobject to construct the request with your token and payload.
This approach works seamlessly for both BIM360 and Autodesk Docs, since they share the same Forge Data Management backend.
内容的提问来源于stack exchange,提问作者Søren Kamp Nielsen

