Problem getting nodeid in ssr mode

Hello, I’m having trouble applying your technology to the project.
After the model is rendered
The first time I click on an object, can’t find the nodeid that corresponds to that object.
Then, when I click on another object, the nodeid of the first clicked object is output.

hwv.value.selectionManaget.getLast().getNodeId(); ← I used this to find nodeid

and

hwv.value = new Communicator.WebViewer({
containerId : viewerId,
endpointUri: “ws://localhost:11180?renderingLocation=ssr”,
model: ssrModelPath,
rendererType: Communicator.RendererType.Server,
streamingMode: Communicator.StreamingMode.Interactive,
)}

  • Property information in ssr mode was used like this.

I didn’t have a problem when I imported the scs file and used it…
If there was a case like this, please give me advice.
Thank you.

Hello @jhbae,

It’s possible that the model hasn’t been fully streamed from the server to the client when using SSR. And thus, the node isn’t yet “available” to be selected – but this is just a guess on my part.

Perhaps we can run a test using a selection callback and output the node id in the web browser console. Attached below is some JavaScript to paste directly in the web browser console. This code snippet will show the node id after it has been selected:

function mySelectionFunc(selectionEvent) {
        var selection = selectionEvent.getSelection();
        if (selection && selection.getSelectionType() != Communicator.SelectionType.None) {
            console.log("Selected Node: " + selection.getNodeId());
        }
        else {
            console.log("Selected: None");
        }
   }

hwv.setCallbacks({
        selection: mySelectionFunc
    });

You may need to change the hwv variable to fit your own Web Viewer implementation.

As an example of the output, below is a screenshot:

After running the example described above, can you confirm if the proper node id is being displayed?

Thanks,
Tino

1 Like

hello @tino
I used the code you provided, and the fundamental problem was solved.
thank you for your advice. :slight_smile:

1 Like