# Does the loadSubtreeFromScsFile method break the structure of the tree

**URL:** <https://forum.techsoft3d.com/t/does-the-loadsubtreefromscsfile-method-break-the-structure-of-the-tree/2729>\
**Category:** HOOPS Visualize Web\
**Tags:** webviewer\
**Created:** [October 6, 2023, 9:07am UTC](https://forum.techsoft3d.com/t/does-the-loadsubtreefromscsfile-method-break-the-structure-of-the-tree/2729 "2023-10-06T09:07:24Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![erduowang1995](https://avatars.discourse-cdn.com/v4/letter/e/9dc877/32.png) [@erduowang1995](https://forum.techsoft3d.com/u/erduowang1995)\
**Post date:** [October 6, 2023, 9:07am UTC](https://forum.techsoft3d.com/t/does-the-loadsubtreefromscsfile-method-break-the-structure-of-the-tree/2729/1 "2023-10-06T09:07:25Z")

</div>

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:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/techsoft3d/original/2X/9/9dad648bb7fea039ab6549cd0dcf1d4d2550556b.png)

---

<div class="post-metadata">

**Author:** ![guido](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.techsoft3d.com/guido/32/115_2.png) [@guido](https://forum.techsoft3d.com/u/guido)\
**Post date:** [October 6, 2023, 12:41pm UTC](https://forum.techsoft3d.com/t/does-the-loadsubtreefromscsfile-method-break-the-structure-of-the-tree/2729/2 "2023-10-06T12:41:56Z")

</div>

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

[https://3dsandbox.techsoft3d.com/?snippet=7XZBbUKafgjDh2E0ylzc1Qv1](https://3dsandbox.techsoft3d.com/?snippet=7XZBbUKafgjDh2E0ylzc1Qv1)

Are you able to reproduce this behavior in the sandbox?

---

<div class="post-metadata">

**Author:** ![erduowang1995](https://avatars.discourse-cdn.com/v4/letter/e/9dc877/32.png) [@erduowang1995](https://forum.techsoft3d.com/u/erduowang1995)\
**Post date:** [October 7, 2023, 3:22am UTC](https://forum.techsoft3d.com/t/does-the-loadsubtreefromscsfile-method-break-the-structure-of-the-tree/2729/3 "2023-10-07T03:22:15Z")

</div>

![image](https://us1.discourse-cdn.com/flex020/uploads/techsoft3d/original/2X/8/89a0211fa844a2029c7d73112f68ead7a0e03a1e.png)  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/techsoft3d/original/2X/1/14f2f7c9870b9892e048e992c6ab1f67534f8808.png)

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

---

<div class="post-metadata">

**Author:** ![guido](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.techsoft3d.com/guido/32/115_2.png) [@guido](https://forum.techsoft3d.com/u/guido)\
**Post date:** [October 7, 2023, 2:23pm UTC](https://forum.techsoft3d.com/t/does-the-loadsubtreefromscsfile-method-break-the-structure-of-the-tree/2729/4 "2023-10-07T14:23:20Z")

</div>

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](https://3dsandbox.techsoft3d.com/?snippet=7XZBbUKafgjDh2E0ylzc1Qv2)

---

<div class="post-metadata">

**Author:** ![erduowang1995](https://avatars.discourse-cdn.com/v4/letter/e/9dc877/32.png) [@erduowang1995](https://forum.techsoft3d.com/u/erduowang1995)\
**Post date:** [October 9, 2023, 9:26am UTC](https://forum.techsoft3d.com/t/does-the-loadsubtreefromscsfile-method-break-the-structure-of-the-tree/2729/5 "2023-10-09T09:26:38Z")

</div>

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