<?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>Named Expression - System. String.Substring</title><link>https://communities.bentley.com/products/building/building_analysis___design/f/aecosim-speedikon-forum/139945/named-expression---system-string-substring</link><description>Hello, 
 I am trying to create a named expression that will be used to control the display of context menus based on the model name prefix, (e.g. Sketch 1, detail 5.258, section t785) the user is in. My approach will only look at the prefixes and will</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: Named Expression - System. String.Substring</title><link>https://communities.bentley.com/thread/424689?ContentTypeID=1</link><pubDate>Fri, 25 Aug 2017 16:09:16 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:ce70360b-39ae-4fed-b9bb-3c62f292ac72</guid><dc:creator>MTH</dc:creator><description>&lt;p&gt;Marc,&lt;br /&gt;Thank you for the reply. I have tried your suggestion, prior to my initial post. I&amp;nbsp;did not&amp;nbsp;notice that it was excluded that example in the posted.&amp;nbsp;I have also&amp;nbsp;tried&amp;nbsp;it with out the carriage returns between each condition. The&amp;nbsp;results are the same when testing the Sketch model. What Bentley software and version are you testing in?&lt;/p&gt;
&lt;p&gt;Below is the named expression that I am testing&lt;/p&gt;
&lt;p&gt;&lt;a href="/cfs-file/__key/communityserver-discussions-components-files/5917/pastedimage1503677069982v2.png"&gt;&lt;img src="/resized-image/__size/320x240/__key/communityserver-discussions-components-files/5917/pastedimage1503677069982v2.png" alt=" " /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Models are:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Sketch&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;section&lt;/strong&gt;.temp&lt;br /&gt;&lt;strong&gt;building&lt;/strong&gt;.temp&lt;br /&gt;&lt;strong&gt;detail&lt;/strong&gt;.temp&lt;/p&gt;
&lt;p&gt;Regards,&lt;br /&gt;Mike&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Named Expression - System. String.Substring</title><link>https://communities.bentley.com/thread/423996?ContentTypeID=1</link><pubDate>Mon, 21 Aug 2017 12:00:42 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:7bc0299a-259c-49cc-a62e-be5d790f5839</guid><dc:creator>Marc Thomas</dc:creator><description>&lt;p&gt;Hi Mike,&lt;/p&gt;
&lt;p&gt;Just trying this out, I have not found a problem with lengths, although the values are case sensitive. This expression works and evaluates True/False&amp;nbsp;with strings of 6 to 8 characters:&lt;/p&gt;
&lt;p&gt;System.String.Substring(ActiveModel.Name, 0,6) = &amp;quot;Sketch&amp;quot;&amp;nbsp; OR System.String.Substring(ActiveModel.Name, 0,6) = &amp;quot;sketch&amp;quot;&amp;nbsp; OR System.String.Substring(ActiveModel.Name, 0,7) = &amp;quot;Section&amp;quot;OR System.String.Substring(ActiveModel.Name, 0,8) = &amp;quot;building&amp;quot;&lt;/p&gt;
&lt;p&gt;So model names starting in&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Sketch&lt;/li&gt;
&lt;li&gt;sketch&lt;/li&gt;
&lt;li&gt;Section&lt;/li&gt;
&lt;li&gt;building&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Evaluate True&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;section&lt;/li&gt;
&lt;li&gt;Building&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;evaluate False.&lt;/p&gt;
&lt;p&gt;[the OR operator is not case sensitive, I just habitually type Booleans in upper case]&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>