The Forge DevCon launches today.
I am putting the final touches to my presentation.
One of them was the migration of the roomedit3d viewer extension and web app to the new Forge structure:
- Forge platform components
- Setting up a specific Roomedit3d model
- Roomedit3dV2 using OAuth2 to edit any model
- Download and installation
First, here are some snapshots from my walk through San Francisco to and from the One Market Autodesk office yesterday:
As you may know by now, the View and Data API no longer exists.
It morphed into several separate more specific, general, well-defined Forge APIs.
Currently, these are the main Forge components:
- Data Management API
- Model Derivative API
- Design Automation API
- Review Queue
- 3D Print API
- BIM 360 API
- Issues API
- Reality Capture API
- Fusion Connect API
- A360 API
The authentication can be both two- and three-legged.
What does that mean?
- Two-legged – my web app knows my credentials and uses them to access my Forge data.
- Three-legged – my web app prompts a third party end user to log in to the system in order to access her Forge data.
This is very cool. I got everything downloaded and started going through the SocketTest and it worked great. I want to try the Roomedit3dApp, but in my zip file I don't seem to have the .rvt file of the room. Where could I find this file?
Answer: You can use any Revit BIM RVT project file you like.
It does not have to have anything to do with rooms at all, really, since any element will be accepted, moved, and the translation communicated back via the socket to the Revit add-in running in the same model.
Translate your RVT for the Forge viewer using your own credentials.
Adapt the roomedit3d viewer server to load it by specifying your own credentials and your translated model URN.
With that done, you should be ready to go.
That is an example of using the two-legged authorisation.
Since I provided that answer, however, things have got easier still with the three-legged OAuth:
The Forge platform has now been redesigned and the View and Data API renamed.
To be more precise, what we so far considered the View and Data API has been restructured more cleanly into separate REST API endpoint collections:
I implemented a new version of Roomedit3d adapted to fit into that structure: Roomedit3dV2.
You can test it live at roomedit3dv2.herokuapp.com.
The sample uses the Data Management API to list all hubs you have access to and the hierarchy of projects, folders, items and versions within them.
When you select a specific version, the Model Derivative API provides access to the internal CAD seed file structure, translates it for the viewer, and enables geometry export of selected elements.
Within the viewer, the
Roomedit3dTranslationTool can be turned on and behaves just as before:
- Select an element
- Transform its location
- Report the data back from the viewer to the web server via a REST API call
- Broadcast the data from the web server to the C# .NET clients to update the BIM
If you have installed and launched the Roomedit3dApp Revit add-in in the same model and run its external command to subscribe to the broadcast events, you will see your own BIM being updated live by the element translations defined in the Forge viewer.
You don't even have to touch the roomedit3dv2 web server.
As long as my free Heroku account is not overloaded by excessive usage, you can access, share and use my instance at roomedit3dv2.herokuapp.com.
Alternatively, you can fork it and launch your own instance on Heroku, your own server, locally or on the web, or anywhere else you please.