Update Revit custom properties by web API - autodesk-forge

It is possible to update and save a custom text attribute in a Revit project hosted on BIM360 ?
Our customer's advisor say it is possible, but after taking a look to the Forge API I do not see any reliable way to do it.
I'm wrong or I've missed something ?

I guess they are referring out new API, Design Automation for Revit V3, the new V3 API is still in Beta, but it has the ability to do the following task related to Revit file, including modify your Revit model:
Create custom Revit family content
Automate model creation
Explore and analyze model data
Extract and produce automated reports
Modify existing models to maintain company standards
Automatically create documentation
Also please check Learn Forge about Modify Model as the sample on detail steps of implementation.

Related

Questions about Autodesk Forge Viewer API

I couldn't find Forge Viewer API demo site and don't know what it looks like. I appreciate it if you have some experience using it and answer questions below.
Can you put markup comments on 3D models easily?
When you update comments, are they automatically saved right after you click some update button?
Can you delete 3D model data easily?
Is it mandatory to upload 3D model data to the Autodesk cloud server when you use the Forge Viewer? I don't want to put design data outside of my service but want to see 3D model on a browser.
You can upload any model and check with Viewer through viewer.autodesk.com
We have a few options for markups on documents. this blog might be helpful. You can also take advantage of sprites and textgeometry for labeling your models
Depending on the method you'll need to implement an algorithm to save, store and load your markups.
The data you see with Viewer is the SVF(2) generated by a translation from a source file. To modify the source file, you'll need to run a Design Automation job.
You need to upload your models to a bucket in order to trigger a translation, generating an SVF(2) that can be rendered with Viewer (refer here).
Formats like gltf, pdf, and dwf can be loaded without the need for translations.

Get Discipline of View [Autodesk Model Derivative API]

I'm trying to get the Discipline Property of a Revit Model uploaded to BIM 360. I was able to get the list of views by GET
https://developer.api.autodesk.com/modelderivative/v2/designdata/URL_SAFE_URN_OF_SOURCE_FILE/metadata
However there is no data on Discipline. Where and how can I get it?
I'm not familiar with "Discipline Properties" in Revit but I can comment on the Forge side of things:
The GET :urn/metadata endpoint simply returns a list of "viewables" that were extracted from the source design file. In case of Revit, these are typically 3D views or 2D sheets. I'm not aware of any other types of viewables that could be extracted by the Model Derivative service.
If the "discipline property" is a property available on some of the Revit elements, you might want to take a look at the GET :urn/metadata/:guid/properties endpoint. This one returns a JSON with properties of objects in one of the extracted viewables. Note that those properties are also accessible from Forge Viewer using its APIs.
In general, the Model Derivative service is trying to extract the "right" amount of information, making sure that the viewer gets all the important data for visualization and analysis, but also making sure that the size of the converted output stays in bounds. If there is some specific information in Revit designs that you need that is not extracted automatically, you can consider using the Design Automation service to process your Revit models in the cloud and extract all the information with your custom Revit plugin.

Do you need a BIM360 license to acces BIM360 files

For a school project I need to display a BIM360 model in the forge viewer. I can't find clear information on whether or not I need to have a BIM360 license to do that. Can I use the API to get the model without my own BIM360 account? (My mentor has the BIM-model in his account)
Also I read that the forge viewer uses the data-derivative API to convert to a it's own format, this uses 0.2 credits every time. Can's I just convert the model once and then store it somewhere?
Thanks,
DrawMen
For you to be able to see and access the model in BIM 360, the owner will have to share it with you.
This forum post seems to indicate that you would indeed need a BIM360 license.
https://forums.autodesk.com/t5/bim-360-support/do-people-need-a-bim-360-design-license-to-use-docs-online/td-p/9573036#:~:text=Anyone%20who%20needs%20to%20review,license%20is%20not%20a%20BYOS
There is a way to share files with publc links, but I don't think this will give you access to a forge viewer. (only the file)
https://bim360basics.com/2020/04/22/public-links-share-bim-360-files-with-anyone/
That being said, depending on the type of file you are trying to view. A lot of Autodesk product now have a feature called "shared view" which let you create a 3ds view for the forge viewer that can be shared with anyone with a URL. It might be worth asking your mentor if he would be willing to create a shared view for you to use.

How to query for TimeLiner data from Forge API?

I used the TimeLiner plugin for Navisworks to create a 4D timeline. I'm now trying to grab this TimeLiner data from the Forge API. When I log into BIM360, I'm able to load a model into the viewer and see all TimeLiner information within a browser. However, I don't see how I can accomplish this with the Forge API. Is there an available API for this? Or is there another way to grab this info?
Unfortunately, the Timeliner properties are not extracted by Forge service (which BIM 360 is running on), and also some other properties. This blog tells in detail:
https://forge.autodesk.com/blog/updates-navisworks-nwd-translation-engine-coming
Currently, we do have an advanced option to override default configurations to tell NWD/NWC translator if it needs to translate Timeliner properties. BUT, this option is about Forge Model Derivative API ONLY.
While in BIM360 Docs UI, there is no any plan to expose options to let users override default configurations when they upload files. So for now, users uploading NWD/NWC files to BIM 360 Docs will lose Timeliner properties. Consequently, you will have to open those files inside Navisworks to view Timeliner data or take advantage of the Navisworks API to extract the data inside Navisworks. We apologize for the inconvenience.
However, we have legged a wish BIMPLT-698 with BIM360 engineering team to evaluate the possibility of adding options for end-user when they upload the model files. You're welcome to track the updates in the future via sending an email quoting this wish id to the Forge support channel.
Note. Triggering your own translation job to override your desired translation configurations via Forge Model Derivative API on files uploaded to BIM360 will charge you for cloud credits. You will have to consider the extra costs if you want to do so, and see here for the pricing: https://forge.autodesk.com/pricing

Use Forge to Access Change Report from BIM 360

Is it possible to use Forge with some BIM 360 API to gain access to the changes in a model from one version to the next?
Unfortunately, there is no API available for doing BIM360 model comparison on Forge currently. However, here are two workarounds you might be interested in:
Compare changes via Forge Viewer: https://forge.autodesk.com/blog/comparing-versions-viewer
Dump changes via Revit Addin, and then integrate its results with Forge.
What you can do though is to leverage Webhook to get notified when a new version is “upserted” to the Data Management API. See docs here:
Official Doc: https://forge.autodesk.com/en/docs/webhooks/v1/tutorials/create-a-hook-data-management/
Sample Code: https://forge.autodesk.com/blog/webhooks-and-bim-360-c