How to Load a Specific Part of a Model Instead of the Full Model in SCZ/SCS?

Hi everyone,

I’m currently working with Navisworks .nwd files and using them to generate:

  • .scz files for SSR (Server Side Rendering)
  • .scs files for CSR (Cilent Side Rendering)

Right now, my workflow involves loading the entire model and then selectively hiding/showing parts of it. However, this approach is not optimal in terms of performance, especially for large assemblies.

Question:
Is there any way to load only a specific part of the model directly—without loading the whole model first and hiding the rest?

For example, if I know the node ID or path of the component I want, can I load just that component directly into SSR or CSR using SCZ or SCS?

Any guidance or tips on how to achieve this would be greatly appreciated.

Thanks in advance!

Hello @shubham.suryawanshi,

You have a couple of options in terms of having more control on what is loaded in the viewer.

The server allows for different streaming modes. Most relevant to your situation is OnDemand. There is an example available as part of the quickstart module. To view this example, please do the following:

Worth noting is that while it is possible to request to load specific nodes, there is no option to unload them. So this means that controlling visibility may still me needed.

Another option — if the model is comprised of different standalone Stream Cache sub-assembly files — is to leverage the different variants of loadSubtreeFrom* function. That is, you can load specific Stream Cache files instead of the entire master assembly.

Thanks,
Tino

I went with the second approach — using shattered Stream Cache sub-assemblies along with the loadSubtreeFromSCSFile() functions.
To do this, I used this GitHub repo:
:link: GitHub - toshi-bata/shattered: This sample creates shattered assembly from a monolithic assembly file using HOOPS Exchange and LibConverter of HOOPS Communicator.

This allowed me to split the model into .scs and .png files and load them on demand. However:

  • Drawback: The shattering process is quite time-consuming, even for a 5 MB model.
  • Current bottleneck: Preparing the .scs, .scz, and image assets takes significantly more time than expected.
  • Future concern: My models may range from 100 MB to 5 GB, so optimization is critical to keep processing time manageable.

My question:

Is there any faster or more optimized way to generate these sub-assemblies (SCS + PNG) — especially for smaller and mid-sized models?

Also can you provide example to code for how to use loadSubtreeFromModel() function?

Thanks again, Tino, for the guidance!

Best regards,

Generating PNGs file will increase the conversion time, as will including other output files. Our recommendation here is to first generate the SCS in one conversion operation and the PNG (and other output files) in another. This won’t reduce overall processing time but being more judicious can still yield benefits.

As stated in our docs, SCS files are less than ideal for large(r) files. Regular SC/SCZ may be more appropriate.

An example of assembly building using loadSubtreeFromModel is available in the quickstart module. To view this example, please do the following: