My discussion with Philippe on integrating roomedit3dv3 with the rest of his Forge node.js boilerplate samples continues, as does the Forge hackathon webinar series.
Furthermore, the Open Design Alliance made an interesting Revit related announcement:
- REST vs WebSocket and Roomedit3dv3 broadcast architecture
- Teigha BIM announcement
- Forge webinar series
REST vs WebSocket and Roomedit3dv3 Broadcast Architecture
Philippe Leefsma and I discussed how to communicate end user modifications made using the custom viewer extension back to the Revit add-in to update the BIM.
Philippe suggested:
Putting all the code into a viewer extension to make it pretty easy to manage. I could add potentially useful features to my server if needed by your app.
Question: In my previous architecture, I used REST to notify the server from the client, and socket.io
from the server to the rest of the world.
- Client viewer extension → REST → server →
socket.io
→ desktop
Therefore, I did not just add a pure client viewer extension, but also fiddled around in the server a bit as well.
Should I try to put the socket.io
broadcast directly into the viewer extension, and avoid the extra communication step?
- Client viewer extension →
socket.io
→ desktop
Here is the architecture implementation that I used successfully for that last time around:
- Viewer extension
- Client notification to server
- Server broadcast request API endpoint
- Server broadcast relay
Answer: You have to go from client to server if you want to broadcast a message to other connected clients, but it seems like you don't need to handle any very specific logic on the server; basically the server can expose a generic REST endpoint which will receive a message and dispatch it to all other clients except the one that initiated the request.
The server already implements a SocketSvc
socket service which we can use for that.
There are two options how this can be implemented:
- Similar to what you did last time: REST endpoint exposed by server, client calls POST with a payload containing message, server broadcast to all other clients.
- Client uses socket to send message to server, server broadcasts message to all other clients.
In both cases I need to add a little piece of code to my server, so the feature is more generic than what you did last time. I will also add a SocketService on the client side, so it's easy to use.
Here is an illuminating read on a REST vs WebSocket comparison and benchmarks.
Take a look at that and decide which is more suitable for your scenario.
Later: I just finished adding a thin wrapper around client side socket.
It is now wrapped in a 'service' making it avail application-wide through the client-side ServiceManager
like this:
import ServiceManager from 'Services/SvcManager' var svc = ServiceManager.getService('SocketSvc') svc.broadcast('your-msg-id', {data...})
All other clients but the initiator will receive the message.
An example of using this is provided in the client App.js.
Time for me to get going on implementing and using this, then.
Teigha BIM Announcement
The Open Design Alliance ODA is working on Teigha BIM to provide access to Revit model data and family definitions in RVT
and RFA
files without a running session of Revit.
Here is the ODA Teigha BIM announcement and an Architosh article on its current status.
Forge Webinar Series
Yesterday, Adam Nagy presented the third session in the ongoing Forge webinar series, on the Model Derivative API.
Here are the recordings, presentations and support material of the sessions held so far:
- September 20 – Introduction to Autodesk Forge and the Autodesk App Store
- September 22 – Introduction to OAuth and Data Management API – on OAuth and Data Management API, providing token-based authentication, authorization and a unified and consistent way to access data across A360, Fusion 360, and the Object Storage Service.
- September 27 – Introduction to Model Derivative API – on the Model Derivative API that enables users to represent and share their designs in different formats and extract metadata.
Upcoming sessions continue during the remainder of the Autodesk App Store Forge and Fusion 360 Hackathon until the end of October:
- September 29 – Viewer API – formerly part of the 'View and Data API', a WebGL-based, JavaScript library for 3D and 2D model rendering a CAD data from seed models, e.g., AutoCAD, Fusion 360, Revit, and many other formats.
- October 4 – Design Automation API – formerly known as 'AutoCAD I/O', run scripts on design files.
- October 6 – BIM360 – develop apps that integrate with BIM 360 to extend its capabilities in the construction ecosystem.
- October 11 – Fusion 360 Client API – an integrated CAD, CAM, and CAE tool for product development, built for the new ways products are designed and made.
- October 13 – Q&A on all APIs.
- October 20 – Q&A on all APIs.
- October 27 – Submitting a web service app to Autodesk App store.
Quick access links:
- For API keys, go to developer.autodesk.com
- For code samples, go to github.com/Developer-Autodesk
Feel free to contact us at [email protected] at any time with any questions.