<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://communities.bentley.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>[CONNECT] Item Type GetRelatedInstance Expression: select specific instance?</title><link>https://communities.bentley.com/products/programming/microstation_programming/f/microstation-programming---forum/234626/connect-item-type-getrelatedinstance-expression-select-specific-instance</link><description>Hi all, 
 
 I am trying to put together an Item Type Expression using GetRelatedInstance to dig down and retrieve properties of a related object. Does anyone know how i can specifically select an object when there are multiple options, 
 
 eg. I currently</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: [CONNECT] Item Type GetRelatedInstance Expression: select specific instance?</title><link>https://communities.bentley.com/thread/765461?ContentTypeID=1</link><pubDate>Fri, 12 May 2023 12:55:29 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:4f0dc170-85d2-4048-871a-51dd20d2b1ec</guid><dc:creator>Francisco Luque Rodrigue</dc:creator><description>&lt;p&gt;Any feedback in how to select one specific object instead the first one?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [CONNECT] Item Type GetRelatedInstance Expression: select specific instance?</title><link>https://communities.bentley.com/thread/739213?ContentTypeID=1</link><pubDate>Fri, 28 Oct 2022 17:39:04 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:9f9e078b-6370-4cd1-aea2-7dcca4b0076b</guid><dc:creator>Jan Šlegr</dc:creator><description>[quote userid="297179" url="~/products/programming/microstation_programming/f/microstation-programming---forum/234626/connect-item-type-getrelatedinstance-expression-select-specific-instance/731146"]What happens to the relationship info when you export or publish to imodel?[/quote]
&lt;p&gt;Mark is (more or less) right, but complete answer is not (and cannot be) simple, because the publishing process is a transformation between two different worlds. Even when EC data in PowerPlatform and in iModel are &amp;quot;only&amp;quot; another versions of the same technology, there are plenty of structural changes and some features can be persisted in different way. So it depends on the transformation process, how specific relationship is transformed.&lt;/p&gt;
[quote userid="297179" url="~/products/programming/microstation_programming/f/microstation-programming---forum/234626/connect-item-type-getrelatedinstance-expression-select-specific-instance/731146"]Maybe you can leverage ecsql there?[/quote]
&lt;p&gt;Yes, ECSQL is one from core features of iTwin.js / iModel ecosystem. But, depending how data are transformed, the query is different in PowerPlatform and iModel, both because different query mechanism (ECQuery&amp;nbsp; vs ECSQ) and data structure is probably different.&lt;/p&gt;
&lt;p&gt;With regards,&lt;/p&gt;
&lt;p&gt;&amp;nbsp; Jan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [CONNECT] Item Type GetRelatedInstance Expression: select specific instance?</title><link>https://communities.bentley.com/thread/738928?ContentTypeID=1</link><pubDate>Thu, 27 Oct 2022 13:13:30 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:e0bda2f9-8934-4365-8123-6f3592948a8b</guid><dc:creator>Jon Summers</dc:creator><description>[quote userid="334014" url="~/products/programming/microstation_programming/f/microstation-programming---forum/234626/connect-item-type-getrelatedinstance-expression-select-specific-instance/738919"]I&amp;#39;m not too familiar with ecsql - how could i use that?[/quote]
&lt;p&gt;ECSQL is iTwin technology.&amp;nbsp; Unfortunately, it&amp;#39;s not available in MicroStation &amp;mdash; if only it were available!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [CONNECT] Item Type GetRelatedInstance Expression: select specific instance?</title><link>https://communities.bentley.com/thread/738919?ContentTypeID=1</link><pubDate>Thu, 27 Oct 2022 12:33:44 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:07a12133-3bc7-43b1-ada4-1a2abc4d6d29</guid><dc:creator>Mark Shamoun</dc:creator><description>&lt;p&gt;As far as i know i would think that relationship info would be retained. I&amp;#39;m not too familiar with ecsql - how could i use that?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [CONNECT] Item Type GetRelatedInstance Expression: select specific instance?</title><link>https://communities.bentley.com/thread/738918?ContentTypeID=1</link><pubDate>Thu, 27 Oct 2022 12:31:18 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:b3452d99-2a9d-456d-8044-99b57786c4b4</guid><dc:creator>Mark Shamoun</dc:creator><description>&lt;p&gt;Hi Jan,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Sample dgn here with an ORD model that has GetRelatedInstance expressions on the corridor meshes that gets the related corridor they are part of and then finds a related linear feature and gets its length.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Because there are many linear features in the corridor, what we would like to be able to do is somehow select any one of these features specifically by something like a query or even collection index instead of it only selecting the first one.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://communities.bentley.com/cfs-file/__key/communityserver-discussions-components-files/343173/ord_5F00_corridor_2D00_getrelatedinstance_5F00_test.dgn"&gt;communities.bentley.com/.../ord_5F00_corridor_2D00_getrelatedinstance_5F00_test.dgn&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [CONNECT] Item Type GetRelatedInstance Expression: select specific instance?</title><link>https://communities.bentley.com/thread/731775?ContentTypeID=1</link><pubDate>Wed, 14 Sep 2022 12:31:32 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:141ccefd-c6a3-41cd-9673-f93d40acf81f</guid><dc:creator>Jan Šlegr</dc:creator><description>&lt;p&gt;Hi Mark,&lt;/p&gt;
[quote userid="334014" url="~/products/programming/microstation_programming/f/microstation-programming---forum/234626/connect-item-type-getrelatedinstance-expression-select-specific-instance/731109"]Any ideas?[/quote]
&lt;p&gt;do you have any (preferably small) example of such design? As not regular ORD user, right I have no model with mesh available on my computer. Although Civil Browser is useful often, it does not always show exact EC classes structure, so to compare it with real DGN and (in the best case) model EC dump file, can provide clearer picture of the situation.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;&amp;nbsp; Jan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [CONNECT] Item Type GetRelatedInstance Expression: select specific instance?</title><link>https://communities.bentley.com/thread/731146?ContentTypeID=1</link><pubDate>Sun, 11 Sep 2022 06:14:32 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:0b80beba-aba6-45b2-a75d-38716dc30486</guid><dc:creator>dominic SEAH</dc:creator><description>&lt;p&gt;Hi Mark,&lt;/p&gt;
&lt;p&gt;What happens to the relationship info when you export or publish to imodel?&lt;/p&gt;
&lt;p&gt;Maybe you can leverage ecsql there?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [CONNECT] Item Type GetRelatedInstance Expression: select specific instance?</title><link>https://communities.bentley.com/thread/731112?ContentTypeID=1</link><pubDate>Sat, 10 Sep 2022 07:28:49 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:8a0f2b46-4f3c-409b-bc5f-9cc50f6849dd</guid><dc:creator>Jon Summers</dc:creator><description>[quote userid="334014" url="~/products/programming/microstation_programming/f/microstation-programming---forum/234626/connect-item-type-getrelatedinstance-expression-select-specific-instance/731109"]Any ideas?[/quote]
&lt;p&gt;Unfortunately not: &lt;a title="MicroStation Help: Expressions" href="https://docs.bentley.com/LiveContent/web/MicroStation%20Help-v21/en/BetaExpressions.html" rel="noopener noreferrer" target="_blank"&gt;Expressions&lt;/a&gt; are...&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Hard to understand&lt;/li&gt;
&lt;li&gt;Non-intuitive&lt;/li&gt;
&lt;li&gt;Poorly documented&lt;/li&gt;
&lt;li&gt;Lacking in examples&lt;/li&gt;
&lt;li&gt;Without debugging tools&lt;/li&gt;
&lt;/ol&gt;
[quote userid="334014" url="~/products/programming/microstation_programming/f/microstation-programming---forum/234626/connect-item-type-getrelatedinstance-expression-select-specific-instance/729039"]The &amp;quot;Civil Display Browser&amp;quot; interface in ORD. It visually maps the EC relationships of the Civil model to easier understand the links[/quote]
&lt;p&gt;Why isn&amp;#39;t that tool in vanilla MicroStation?&amp;nbsp; The vertical apps could then use the base tool for their particular relationships.&lt;/p&gt;
&lt;p&gt;I have read statements by Bentley staff that &lt;a title="MicroStation Help: Expressions" href="https://docs.bentley.com/LiveContent/web/MicroStation%20Help-v21/en/BetaExpressions.html" rel="noopener noreferrer" target="_blank"&gt;Expressions&lt;/a&gt; are like &lt;a title="TechTarget: What is Structured Query Language?" href="https://www.techtarget.com/searchdatamanagement/definition/SQL" rel="noopener noreferrer" target="_blank"&gt;SQL&lt;/a&gt;.&amp;nbsp; However, anything less like SQL than the expression in your first post is hard to imagine.&amp;nbsp; It&amp;#39;s not as if the technology is impossible: look what &lt;a title="iTwin.js: ECSQL" href="https://www.itwinjs.org/learning/ecsql/" rel="noopener noreferrer" target="_blank"&gt;iTwin technology&lt;/a&gt; has to offer!&lt;/p&gt;
&lt;p&gt;Perhaps&amp;nbsp;&lt;a href="/members/9b2e18a2_2d00_f09e_2d00_4c49_2d00_bb42_2d00_66dd47c08ffb"&gt;Mangesh.Shelar&lt;/a&gt;&amp;nbsp;could comment?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [CONNECT] Item Type GetRelatedInstance Expression: select specific instance?</title><link>https://communities.bentley.com/thread/731109?ContentTypeID=1</link><pubDate>Sat, 10 Sep 2022 04:45:23 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:271da192-95e8-4cb6-ae09-f7ae7af372f3</guid><dc:creator>Mark Shamoun</dc:creator><description>&lt;p&gt;Any ideas?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [CONNECT] Item Type GetRelatedInstance Expression: select specific instance?</title><link>https://communities.bentley.com/thread/729130?ContentTypeID=1</link><pubDate>Tue, 30 Aug 2022 23:28:59 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:323c5dd6-0eb3-46a9-b75d-26cf1186c199</guid><dc:creator>Ryan McCormack</dc:creator><description>&lt;p&gt;Thanks Mark. That is very helpful.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [CONNECT] Item Type GetRelatedInstance Expression: select specific instance?</title><link>https://communities.bentley.com/thread/729039?ContentTypeID=1</link><pubDate>Tue, 30 Aug 2022 09:18:42 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:7fc776bc-9190-4a1b-9516-955489da6be5</guid><dc:creator>Mark Shamoun</dc:creator><description>&lt;p&gt;Hey Ryan,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;That is the &amp;quot;Civil Display Browser&amp;quot; interface in ORD. It visually maps the EC relationships of the Civil model to easier understand the links (it took me a while to know what it actually was until recently),&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: [CONNECT] Item Type GetRelatedInstance Expression: select specific instance?</title><link>https://communities.bentley.com/thread/728715?ContentTypeID=1</link><pubDate>Sun, 28 Aug 2022 21:43:22 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:763eabf7-b15c-4db8-97f3-572e693a066f</guid><dc:creator>Ryan McCormack</dc:creator><description>&lt;p&gt;Hi Mark,&lt;/p&gt;
&lt;p&gt;Great question, I hope somebody is able to assist with this. In regards to the image in your question, how are you getting that information presented in that format?&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Ryan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>