MicroStation Help tells us Note: GetRelatedItem has been deprecated. Use *GetRelatedInstance* instead.
Mangesh.Shelar wrote: Once you attach ItemType to an element, you can fetch properties of the element on which ItemType resides. You can also use GetRelated expression to traverse to related element and fetch its property.
Tell us more about GetRelated and GetRelatedInstance. They are not discussed in detail in MicroStation Help.
Jan Šlegr wrote: GetRelated* (e.g. GetRelatedItem) is mentioned in expressions examples. But not documented in detail.
Mangesh.Shelar wrote: I will try to get my colleague to write a blog for it.
I have raised a request with Mangesh.Shelar and Sanjivani Ichake to produce a Blog to explain the operation of this Item Type Expression.
Product Backlog Item # 673214 Item Type Expression GetRelated (MicroStation Communities Blog)
RegardsAndrew BellTechnical SupportBentley Systems
Answer Verified By: Jon Summers
Thanks!
After some practicing, I have to say the using of GetRelatedInstance is quite straightworfard, but any further explanation or documentation is welcomed :-)
What I see as not small challenge is, unlike other symbols available in expression builder, that using GetRelatedInstance requires good understanding of EC classes (including EC relationship classes) and how model content is represented as EC data structure.
Regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
Hi Andrew, any updates on this?
Mark
OpenRoads Designer 2023 | Microstation 2023.2 | ProjectWise 2023
No update yet from the development team on the production of a Blog to explain these ItemType Expressions but I have requested an update from them.
Hi,
We already have published blog related to GetRelatedInstance. Here is the link:
[MSCE] Creating Item type Expression with GetRelatedInstance symbol - MicroStation Programming Blog - MicroStation Programming - Bentley Communities
Sanjivani Ichake said:We already have published blog related to GetRelatedInstance
Excellent! Even if we had to wait three years...better late than never.
Jan Šlegr said:using GetRelatedInstance requires good understanding of EC classes
From that blog: Before knowing about the GetRelatedInstance expression symbol, it is required to know the basics about EC Classes and their relationships ... writing accurate relationship expression is a tedious task.
A great example of understatement!
Bentley Systems have told us, in the past, that writing an Expression is like writing SQL. SQL is a public standard. It is implemented by many databases including Access, SQLite and Oracle. There are thousands of developers who use SQL every day.
Here's an example of a MicroStation GetRelatedInstance query from that blog:
GetRelatedInstance
this.GetItem("DgnCustomItemTypes_Architectural:FloorArea"). GetRelatedInstance("OnSameElement:0:MstnGraphHeader"). ElementDescription
If that's like SQL then I'll eat my hat. Let's face it, writing a MicroStation Expression is not like writing SQL.
Regards, Jon Summers LA Solutions