Does the loadSubtreeFromScsFile method break the structure of the tree

I created the node using the createNode method and generated the tree structure from the tree relationship, but when I used loadSubtreeFromScsFile to load the node, I found that the tree structure had been changed

As shown below:

I’m unable to reproduce this behavior. Please see the code snippet below:

https://3dsandbox.techsoft3d.com/?snippet=7XZBbUKafgjDh2E0ylzc1Qv1

Are you able to reproduce this behavior in the sandbox?


When I create a node, the first layer gives it a node with a nodeId of 0, which will cause the several nodes I created before to be lost

Looks like the issue is that you are trying to assign nodeid 0 to the “test” node which already exist (it is the root node). Is there a reason you want to assign a specific nodeid to that node instead of simply omitting the third parameter for the call?

If you do assign a nodeid to a node during creation you have to make sure it does not clash with already existing ones. See below snippet:
https://3dsandbox.techsoft3d.com/?snippet=7XZBbUKafgjDh2E0ylzc1Qv2

Thanks for your reply. After I used the createNode method to generate the nodeId, there was no problem