# Node unique identifiers?

**URL:** <https://forum.techsoft3d.com/t/node-unique-identifiers/4473>\
**Category:** HOOPS Exchange\
**Tags:** how-to\
**Created:** [March 20, 2025, 7:11pm UTC](https://forum.techsoft3d.com/t/node-unique-identifiers/4473 "2025-03-20T19:11:41Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![camilo.talero](https://avatars.discourse-cdn.com/v4/letter/c/e68b1a/32.png) [@camilo.talero](https://forum.techsoft3d.com/u/camilo.talero)\
**Post date:** [March 20, 2025, 7:11pm UTC](https://forum.techsoft3d.com/t/node-unique-identifiers/4473/1 "2025-03-20T19:11:41Z")

</div>

Is there a system that assigns a unique identifier to each `A3DTreeNode` node in a `A3DTree`?

Not all nodes have names. Moreover, when converting a file to xml using the ImportExport example, I see the following on the XML:

```xml
<UserData Title="UNIQUE_ID">
				<UserValue Type="String" Value="1a117b7e-495e-4e39-8c5b-3a2cfe43c0ab-00057ac2" />
			</UserData>

```

So it seems that at some point the exchanger creates unique ids for the exported data. I would like to get these identifiers from the nodes.

I also see an ID on the ProductOccurrence:

```xml
        <ProductOccurrence pointer="0x63fd04a51940" Id="16" Name="Door-Curtain-Wall-Single-Glass" Layer="65535" Style="65535" Behaviour="1" Children="17" ModellerType="50" ProductLoadStatus="0" ProductFlag="2" Unit="304.80000000000001" DensityVolumeUnit="1" DensityMassUnit="1" UnitFromCAD="1" RGB="0.753 0.753 0.753">
			<Transformation RelativeTransfo="1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1" />
			<A3DMiscMaterialPropertiesData m_dDensity="-1" />
		</ProductOccurrence>

```

Does that correspond to one of the fields in here ? [A3DRootBaseData — HOOPS Exchange Documentation](https://docs.techsoft3d.com/exchange/latest/api/structA3DRootBaseData.html#_CPPv4N15A3DRootBaseData16m_uiPersistentIdE)

Or where does it come from?

---

<div class="post-metadata">

**Author:** ![Man](https://avatars.discourse-cdn.com/v4/letter/m/f17d59/32.png) [@Man](https://forum.techsoft3d.com/u/Man)\
**Post date:** [March 21, 2025, 2:09pm UTC](https://forum.techsoft3d.com/t/node-unique-identifiers/4473/2 "2025-03-21T14:09:16Z")

</div>

Hello @camilo.talero,  
Do you mean get the persistent ID from the tree node? If yes, you can refer to the HOOPS Exchange sample **MeshViewer**. In exchange.cpp, you can look for line 218, `xml_entity.append_attribute("persistentUId") = root_data.m_uiPersistentId;`

Best Regards,  
Man

---

<div class="post-metadata">

**Author:** ![aevyrie](https://avatars.discourse-cdn.com/v4/letter/a/9d8465/32.png) [@aevyrie](https://forum.techsoft3d.com/u/aevyrie)\
**Post date:** [March 21, 2025, 5:48pm UTC](https://forum.techsoft3d.com/t/node-unique-identifiers/4473/3 "2025-03-21T17:48:40Z")

</div>

Thanks Man.

Our goal here is to get our hands on a UID that we can persist on a client, and use later to query the CAD file on a server. There appear to be ways to traverse the hierarchy in the PRC intermediate representation in memory, but I don’t see a way to get a serializable handle to a node in the hierarchy for O(1) lookups.

`persistentUId` sounds like what we are looking for, are there any docs or examples that show how to use that UID to query the CAD data once you have this UID?

---

<div class="post-metadata">

**Author:** ![Man](https://avatars.discourse-cdn.com/v4/letter/m/f17d59/32.png) [@Man](https://forum.techsoft3d.com/u/Man)\
**Post date:** [March 25, 2025, 1:31pm UTC](https://forum.techsoft3d.com/t/node-unique-identifiers/4473/4 "2025-03-25T13:31:21Z")

</div>

Hello @aevyrie,  
In the HOOPS Exchange documentation, there is a dedicated page for persistent IDs [Persistent IDs — HOOPS Exchange Documentation](https://docs.techsoft3d.com/exchange/latest/guide/persistent_ids.html).  
Also, I found a discussion in forum - [How to generate GUID to each node during conversion?](https://forum.techsoft3d.com/t/how-to-generate-guid-to-each-node-during-conversion/2671).  
If you have any further questions, please let me know. Thank you.

Best Regards,  
Man
