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
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: