Hi All,
I am currently using ORD 2021 R1 (10.10.01.03).
Does anyone know if there is an Item Types expression that can be used to determine the "length" of an element in a corridor model?
I thought I might be able to get the value using a System.Math expression and the Start Station and End Station values but that didn't seem to work.
Any ideas/suggestions would be appreciated.
Regards,
Ryan
Hi Ryan,
As discussed over email, below GetRelatedInstance symbol expression will help you to fetch Length of continuous or non continuous mesh element.
this.GetRelatedInstance("OnSameElement:0:MeshSurfaceEntity").GetRelatedInstance("Component__Entity_Embedding:1:Corridor").GetRelatedInstance("Component__Entity_Embedding:0:LinearEntity3d").GetElement().LinearElement_Length3d
I am adding these details here, just to inform other guys about this use case solution and about new blog of GetRelatedInstance expression. This will help them to refer it for future use cases.
Above expression looks pretty complex as there are various relationships involved. To form such expressions, you will need some understanding of internal relationships between elements. To get insight into relationships, we have key-in “ecx items dump” which dumps all instance data of dgn file in one xml file.I have published one blog recently to give an overview of how to use GetRelatedInstance and how to use the ecx item dump tool. Here is the blog link:
Creating-item-type-expression-with-GetrRlatedInstance
Regards,Sanjivani
Thanks for looking into this Paul and Jan!
thanks for the file, that's great there is no workspace/workset dependency.
Unfortunately, I think there is no simple solution available. It's possible to obtain Start and End Stations using these expressions:
this.GetRelatedInstance("OnSameElement:0:MeshSurfaceEntity").MeshSurfaceEntity_StartStation this.GetRelatedInstance("OnSameElement:0:MeshSurfaceEntity").MeshSurfaceEntity_EndStation
but the results are strings, not numbers, so the distance (difference between start and end) cannot be calculated. I do not know ORD well enough, but I guess it's because the station can be formatted text, and not always simple number. Plus, there is no expression available to convert string to number.
It seems that the length (and direction) is available internally, but to analyze, whether this information can be reached from Item Type element, requires perfect knowledge of ORD internal EC data model ... or to play a day or two with expressions and C# code to check all dependencies, whether such information exists in some EC class.
With regards,
Jan
Bentley Accredited Developer: iTwin Platform - AssociateLabyrinth Technology | dev.notes() | cad.point
I'm not aware of any short term plans for that. Whilst I understand that you would see the length as End Station - Start Station the mesh element itself doesn't carry a length property and it could become confusing if applying clipping to the corridor or other changes that modify the mesh. Something for us to think about though as we expand capabilities for digital engineering requirements.
Item Types - For BeCommunities Question.dgn
Hi Jan,
Please find attached a simple model as an example (the file was created in ORD 10.10.01.03 with no workspace/workset). In the file a barrier template has been used in a corridor to create a barrier element. I have then added Item Types to the element called "Item Type Test". I would like to be able to populate the "Length" Item Type with the length of the barrier element.
Please let me know if you require any additional information. Any help would be appreciated.