The Building Coder

Roomedit3d Broadcast, Teigha BIM and Forge Webinar 3

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

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.

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?

Here is the architecture implementation that I used successfully for that last time around:

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:

  1. 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.
  2. 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:

Upcoming sessions continue during the remainder of the Autodesk App Store Forge and Fusion 360 Hackathon until the end of October:

Quick access links:

Feel free to contact us at forgehackathon@autodesk.com at any time with any questions.

Forge – build the future of making things together