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:
Forge platform components
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:
- Launched
- Authentication
- Data Management API
- Model Derivative API
- Viewer
- 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.
Setting up a Specific Roomedit3d Model
In a comment on The Building Coder discussion of the roomedit3d live real-time socket.io BIM update, Danny Bentley asked:
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:
Roomedit3dV2 Using OAuth2 to Edit any Model
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.
In that version, you can log into your own A360 account, obviously exercising the Authentication API.
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.
Download and Installation
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.
The current versions of roomedit3dv2 and Roomedit3dApp discussed above are release 0.0.2 and 2017.0.0.5, respectively.