Get relations of an object #302
-
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Hi, The functionality you are asking for will be part of next Mesh release (planned as 2.6.1) and Mesh Python SDK release. Because in the Mesh version you are using the relations are supported in very limited way you can't read what objects are connected to them and only basic information (name, id and path) is returned as you correctly observed. To give you a better understanding there are 2 groups of relations between objects in Mesh: ownership and link. Ownership relationEach object is owned by some other object (owner). It is called ownership relation. Ownership relations can be:
By convention ownership relation attribute names start with 'has_...', e.g.: has_PowerPlant. Removing an object will remove recursively all of its owned objects as well, if there were any. Link relationLink relation is a relation where one object may point to another object, but does not own it. There is also a versioned link relation, which is a link relation where the target object can change over time. It consists of a list of pairs:
There are four types of link relation attributes:
Similar to By convention link relation attribute names start with 'to_...', e.g.: 'to_EnergyMarket'. Removing an object that had link relations to other objects will NOT remove the linked objects. |
Beta Was this translation helpful? Give feedback.
-
Hi, I see. Nice to now that it will be implemented soon. And thank you for the thorough explanation of the two types of relations:) |
Beta Was this translation helpful? Give feedback.
Hi,
The functionality you are asking for will be part of next Mesh release (planned as 2.6.1) and Mesh Python SDK release.
I'm currently working on this. I'll also add an example of how to traverse a model using the relation attributes.
Because in the Mesh version you are using the relations are supported in very limited way you can't read what objects are connected to them and only basic information (name, id and path) is returned as you correctly observed.
To give you a better understanding there are 2 groups of relations between objects in Mesh: ownership and link.
Ownership relation
Each object is owned by some other object (owner). It is called ownership relation.
Ownership relations…