How to obtain the id of a node

Hi, I am exporting models from MPS. Basically I export all the models as trees, this schema works decently with children but it does not work with references. To do that I would need to assign an ID to every node. Does not have they already an ID? How can I access it?
2 comments
Yes, all nodes in MPS have ids, unique in scope of model. You can obtain the id from SNode class: SNode.getSNodeId().

If you have a node<Concept> - typed variable, you can cast it to SNode or use the "downcase to lower semantics level" operation:
node<Concept> n;
n/.getSNodeId();
prettyPrint();
Regards,
Mihail
0
thank you, this is exactly what I was looking for!

Regards,

Federico
0

Please sign in to leave a comment.