<?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/"><channel><title>Using Named Expressions to drive interface items – A sample</title><link>https://communities.bentley.com/products/microstation/w/askinga/4541/using-named-expressions-to-drive-interface-items-a-sample</link><description>Articles previously found in the &amp;quot;AskInga&amp;quot; Community.</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>Using Named Expressions to drive interface items – A sample</title><link>https://communities.bentley.com/products/microstation/w/askinga/4541/using-named-expressions-to-drive-interface-items-a-sample</link><pubDate>Tue, 13 Dec 2022 13:29:48 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:5bae2907-f0ef-4c23-8c9a-213531402e1d</guid><dc:creator>Leonard Jones</dc:creator><comments>https://communities.bentley.com/products/microstation/w/askinga/4541/using-named-expressions-to-drive-interface-items-a-sample#comments</comments><description>Current Revision posted to [Archived] AskInga Wiki by Leonard Jones on 12/13/2022 1:29:48 PM&lt;br /&gt;
&lt;p&gt;&lt;img title="AskInga" alt="AskInga logo" border="0" height="76" src="/askIngaPics/askingalogo.gif" width="230" /&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Using Named Expressions to drive interface items - A Sample&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;With thanks to Bentley&amp;#39;s &lt;a href="/members/sam-hendrick/default.aspx"&gt;Sam Hendrick&lt;/a&gt; for this article suggestion and content.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;By now you&amp;#39;ve heard and read about &lt;i&gt;Named Expressions&lt;/i&gt;, but might not have had the inspiration to experiment with them.&amp;nbsp; If this describes you, then the following tutorial might be just what you need to kick-start your learning and exploration of Named Expressions.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Named expressions can be used with the Customize utility to perform the following tasks:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;define rules that control when a tool is available,&lt;/li&gt;
&lt;li&gt;define rules to control when a task is available and to ,&lt;/li&gt;
&lt;li&gt;define rules for right-click context menus, such as conditions under which a context menu item is hidden.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;nbsp;Knowing this, we&amp;#39;ll use a couple of named expressions to load a different user interface depending upon the value of configuration variables defined in a pair UCF files:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;a href="http://communities.bentley.com/cfs-file.ashx/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/5751.NE2.mp4"&gt;communities.bentley.com/.../5751.NE2.mp4&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;The following instructions can be used as a guide to work through this tutorial.&amp;nbsp; Of course this is just a sample workflow, what you employ to create your customized interface may differ.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 1:&amp;nbsp; Create two UCFs and one PCF&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Using the File Open dialog, or what us old-timers still call the MicroStation Manager dialog, create two new users and one new project.&amp;nbsp; In this example, I&amp;#39;m using ENGINEERING and FACILITIES as the users and MyCity as the project.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img border="0" src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/3554.new-user.jpg" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;From there you can locate and open each of the UCF files and add a couple of new variables which will be used by the named expressions to drive the interface items.&amp;nbsp; In this example, MYCITY_ENG is for the Engineering user and MYCITY_FAC is for the facilities user.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 2:&amp;nbsp; Define variables &lt;/b&gt;&lt;/p&gt;
&lt;p&gt;In the UCF file for the Engineering, we define MYCITY_ENG=1 and MYCITY_FAC=2 while the variables for the facilities user would be the exact opposite (MYCITY_ENG=2 and MYCITY_FAC=1).&amp;nbsp; Note, setting a variable to 1 is True, and when setting it to any value other than 1 is recognized as &amp;quot;False&amp;quot; when dealing with named expressions.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img border="0" src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/0081.facucf.jpg" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 3:&amp;nbsp; Create named expressions&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Back in the MicroStation Manager, navigate to the DGNLIB folder and create a new file to hold the named expression definitions.&amp;nbsp; Note that this is optional, if you prefer you can add them to any dgnlib that&amp;#39;s in a location pointed to by MS_DGNLIBLIST.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Note&lt;/strong&gt;: In &lt;em&gt;MicroStation Connect,&lt;/em&gt; DGNLIB should point to&amp;nbsp;Configuration variable &lt;strong&gt;MS_GUIDGNLIBLIST&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;In the File Open dialog, ensure that you&amp;#39;re set to the new ENGINEERING user and the MyCity project.&amp;nbsp; Then open the dgnlib that will hold the named expressions and select &lt;i&gt;Utilities &amp;gt; Named Expressions&lt;/i&gt;.&amp;nbsp; The resulting dialog is used to define and manage named expressions in the active DGN library.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img border="0" src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2538.Named-Expresssion-dialog.jpg" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The next step is to create two named expressions that test for the presence of the variables created above.&amp;nbsp; To do that, click on the New button and enter the following information.&lt;/p&gt;
&lt;p&gt;Internal Name - sets the name of the named expression:&amp;nbsp; MyCity_ENG&lt;/p&gt;
&lt;p&gt;External Name - sets the text label that appears in the user interface to describe the test that will be applied when evaluating the named expression:&amp;nbsp; &lt;em&gt;MyCity ENGINEERING &lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Description:&amp;nbsp;&lt;em&gt; Is this user in Engineering Services?&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Keywords - enables the named expression to be used in specific areas:&amp;nbsp;&lt;em&gt; File, Task, Tool, User Interface&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Symbol Sets - defines the values and properties of the named expression:&amp;nbsp; &lt;em&gt;ConfigVar&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Expression - is the text string that&amp;#39;s to be evaluated. The expression is a single-line statement that contains symbols and operators: &amp;nbsp;&amp;nbsp;&lt;em&gt;ConfigVar.GetExpandedConfigVar(&amp;quot;MYCITY_ENG&amp;quot;)=1&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 4:&amp;nbsp; Test expressions&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Since you&amp;#39;re using the ENGINEERING workspace, the test button should return &lt;i&gt;True.&amp;nbsp; &lt;/i&gt;This makes sense since the variable MyCity_ENG is set to 1 in the UCF file.&amp;nbsp; This named expression will be used to control the display an ENGEERING User task that will be created in the next section.&lt;/p&gt;
&lt;p&gt;You can repeat these steps to create a second named expression for MyCity_FAC.&amp;nbsp; Testing this variable returns false since the variable is not set to 1.&amp;nbsp; This named expression will be used to control the display of a FACILITIES User task that will be created later.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img border="0" src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/0116.fale.jpg" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;To determine what the expression should be, select &lt;i&gt;Utilities &amp;gt; Report Symbols &lt;/i&gt;which opens expression_symbols.html in your browser.&amp;nbsp;&amp;nbsp; This is an index of available expression symbols that includes information such as the syntax to use, the description and an example.&amp;nbsp; The symbol being used in this exercise is &lt;i&gt;ConfigVar, &lt;/i&gt;which has four available expressions&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;ExpandConfigVar - returns string where all MicroStation configuration variables are expanded.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;GetExpandedConfigVar - returns the expanded variable.&lt;/p&gt;
&lt;p&gt;GetUnexpandedConfigVar - returns unexpanded variables.&lt;/p&gt;
&lt;p&gt;IsConfigVarDefined - returns true if the variable is defined.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;The named expressions can now be used for creating a show/hide test for tasks, tools, and other interface items.&amp;nbsp;&amp;nbsp; In this tutorial we&amp;#39;ll be creating two tasks:&lt;/p&gt;
&lt;p&gt;&lt;i&gt;ENGINEERING User&lt;/i&gt; which contains specific tasks for Engineering Services users, and&lt;/p&gt;
&lt;p&gt;&lt;i&gt;FACILITIES User&lt;/i&gt; which contains tasks for the Facility Maintenance users.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The availability of these tasks will be driven by a Show/Hide test using the named expressions created earlier.&amp;nbsp; Let&amp;#39;s take a closer look.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 5:&amp;nbsp; Create UI dgnlib&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Start by creating a new DGN library to hold the interface customizations.&amp;nbsp; You&amp;#39;ll want to put this file in the projects .../dgnlib/ folder so it will be found by MS_DGNLIBLIST. &amp;nbsp;Note that this is defined at the project level, so all customizations in this dgnlib file will be read by all user workspaces using this project.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 6:&amp;nbsp; Create user tools and tasks&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Once open, navigate to the Customize dialog and create several new tool boxes under User Tools.&amp;nbsp; In this example, I created the following tool boxes and populated them with relevant tools:&amp;nbsp;&lt;em&gt; Annotation, Display, Draw, Measure, Modify, and Publishing.&amp;nbsp; &amp;nbsp;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img border="0" src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/6740.User-Tools.jpg" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Once the User Tools have been created, go to the &lt;i&gt;Tasks&lt;/i&gt; pane and create a new task called &lt;i&gt;ENGINEERING User&lt;/i&gt;.&amp;nbsp; You can then populate this task with some or all of the user tools created above.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Likewise, create a new task called &lt;i&gt;FACILITIES User&lt;/i&gt; and populate this task with some of the user tools.&amp;nbsp; &amp;nbsp;&amp;nbsp;Since MicroStation builds the interface on-the-fly, you can easily verify your UI design as you go.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img border="0" src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/5504.fac.jpg" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 7:&amp;nbsp; Add Show/Hide test&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Tasks and workflows have a variety of properties that are defined in the Tool Container pane of the Customize dialog.&amp;nbsp; One of available properties is a &lt;i&gt;Show/Hide Test&lt;/i&gt; which determines whether the item is displayed in the Tasks dialog.&amp;nbsp; The tests are based on named expressions, and since we&amp;#39;ve already created those in Step 3, we can now define these tests.&lt;/p&gt;
&lt;p&gt;In the Customize dialog, highlight &lt;i&gt;ENGINEERING User&lt;/i&gt; in the Tasks pane, and note the available properties in the Tool Container.&amp;nbsp; Since there is no Show/Hide test, add one via the right click menu. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img border="0" src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2260.Add-test.jpg" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Select the drop-down of the new Show/Hide test item and choose &lt;i&gt;MyCity ENGINEERING&lt;/i&gt; from the pop-up dialog.&amp;nbsp; At this time you may also want to click the Test button to ensure it returns True.&amp;nbsp; (Remember, your active user workspace is ENGINEERING therefore MyCity_ENG = 1.)&lt;/p&gt;
&lt;p&gt;&lt;img border="0" src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/8468.showhidepick.jpg" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Do the same for the &lt;i&gt;FACILITIES User&lt;/i&gt; task. Choose &lt;i&gt;MyCity FACILITIES&lt;/i&gt; from the available named expressions and verify that the test returns False.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You&amp;#39;ll also notice that the FACILITIES User task has now been removed from the Tasks dialog on the interface!&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 8:&amp;nbsp; Test &lt;/b&gt;&lt;/p&gt;
&lt;p&gt;To further test this, close MicroStation and change the workspace to FACILITIES/MyCity.&amp;nbsp; Open any file and notice that you only have the FACILITIES User in the task dialog.&lt;/p&gt;
&lt;p&gt;Close MicroStation and change the workspace to ENGINEERING/MyCity.&amp;nbsp; This time, only the ENGINEERING User task is made available in the interface.&lt;/p&gt;
&lt;p&gt;The obvious benefit of the method is that CAD Administrators can maintain a single DGNLIB for all customizations and simply use Named Expressions to turn on or off tasks.&amp;nbsp; &amp;nbsp;In this case, we used a simple configuration variable to drive the show/hide test.&lt;/p&gt;
&lt;p&gt;The following content explores how to add the ENGINEERING User and FACILITIES User to the right click menu.&amp;nbsp; Since this customization will also use a Show/Hide test based on the named expressions, the right click menu will change its content based upon the active workspace.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 9:&amp;nbsp; Add ENGINEERING and FACILITIES to right-click &amp;nbsp;menu&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Using either the Engineering or Facilities workspace, and the MyCity project, re-open the UI dgnlib and navigate back to the customize dialog.&lt;/p&gt;
&lt;p&gt;Then go to the &lt;i&gt;Context Menus &lt;/i&gt;pane and add two new items, one for ENGINEERING and the other for FACILITIES.&amp;nbsp; Add the appropriate Show/Hide Test and finally populate the items with the desired user tools as shown.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img border="0" src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/4426.Context-Menu.jpg" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Testing this is going to produce similar results to the tasks.&amp;nbsp; When the workspace is set to ENGINEERING/MyCity, the right-click menu will show the ENGINEERING User content, and when the workspace is set to FACILITIES/MyCity, it flip for the FACILITIES User.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img border="0" src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2046.rightclickeng.jpg" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 10:&amp;nbsp; Add Switch User item to the right-click menu&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;As a final touch to the right-click menu, let&amp;#39;s add a Switch User item that performs the following tasks:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Show tasks from both the engineering and facilities users.&lt;/li&gt;
&lt;li&gt;Show only the ENGINEERING User tasks.&lt;/li&gt;
&lt;li&gt;Show only the FACILITIES User tasks&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&lt;img border="0" src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/1273.bonus.jpg" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This can be very useful for those users who are not running the ENGINEERING or FACILITIES workspace.&amp;nbsp; For example, perhaps there&amp;#39;s a &lt;em&gt;CAD&amp;nbsp;&lt;/em&gt; workspace that needs access to all items of both interfaces.&lt;/p&gt;
&lt;p&gt;To start, create a new user workspace called &lt;em&gt;CAD&amp;nbsp;&lt;/em&gt;and open the UI dgnlib that contains the interface items for both ENGINEERING and FACILITIES.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img border="0" src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/5078.cad.jpg" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;There&amp;#39;s no need to set any variables in the UCF file since this will be done by utilizing the &lt;em&gt;expand set&lt;/em&gt; MicroStation keyin.&lt;/p&gt;
&lt;p&gt;Navigate to the Customize dialog,&amp;nbsp;and add a new menu called &lt;i&gt;Switch User &lt;/i&gt;in the Context Menu.&amp;nbsp; Then add three menu items that execute the following MicroStation key ins:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Show Both Users:&amp;nbsp; &lt;em&gt;expand set MYCITY_ENG = 1;expand set MYCITY_FAC = 1;task reload&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;ENGINEERING:&amp;nbsp; &lt;em&gt;expand set MYCITY_ENG = 1;expand set MYCITY_FAC = 2;task reload&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;FACILITIES:&amp;nbsp; &lt;em&gt;expand set MYCITY_ENG = 2;expand set MYCITY_FAC = 1;task reload&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img border="0" src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2465._3B00_lk.jpg" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;To finish this off, let&amp;#39;s take a quick look at the keyins:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Expand set&lt;/em&gt; sets a temporary configuration variable for the active design session.&amp;nbsp; Remember, the CAD user does not have MYCITY_ENG or MYCITY_FAC defined in the UCF file.&amp;nbsp;&amp;nbsp;Note that this is an excellent example of&amp;nbsp;using the&amp;nbsp; &lt;em&gt;expand set &lt;/em&gt;keyin to set a variable that&amp;#39;s not defined elsewhere.&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Task reload&lt;/em&gt;, does exactly what it implies - it reloads all of the tasks.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This tutorial is only a small sampling of what can be done with named expressions, and with a little curiosity and creativity the possibilities are seemingly endless.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks for reading and have fun!&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Sample files:&lt;/p&gt;
&lt;p&gt;&lt;a href="/communities/other_communities/askinga/m/askinga-files/149094/download.aspx"&gt;http://communities.bentley.com/communities/other_communities/askinga/m/askinga-files/149094/download.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Related Link:&lt;/p&gt;
&lt;p&gt;&lt;a href="/communities/other_communities/askinga/w/askinga/set-temporary-variables-with-the-expand-set-keyin.aspx"&gt;http://communities.bentley.com/communities/other_communities/askinga/w/askinga/set-temporary-variables-with-the-expand-set-keyin.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Related Video:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://communities.bentley.com/cfs-file.ashx/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/3603.DC_5F00_Binary.mp4"&gt;communities.bentley.com/.../3603.DC_5F00_Binary.mp4&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;

&lt;div style="font-size: 90%;"&gt;Tags: Named Expression, Properties&lt;/div&gt;
</description></item><item><title>Using Named Expressions to drive interface items – A sample	</title><link>https://communities.bentley.com/products/microstation/w/askinga/4541/using-named-expressions-to-drive-interface-items-a-sample/revision/24</link><pubDate>Wed, 03 Nov 2010 19:29:13 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:5bae2907-f0ef-4c23-8c9a-213531402e1d</guid><dc:creator>Inga Morozoff</dc:creator><comments>https://communities.bentley.com/products/microstation/w/askinga/4541/using-named-expressions-to-drive-interface-items-a-sample#comments</comments><description>Revision 24 posted to [Archived] AskInga Wiki by Inga Morozoff on 11/3/2010 7:29:13 PM&lt;br /&gt;
&lt;p&gt;&lt;img height="76" width="230" src="/askIngaPics/askingalogo.gif" alt="AskInga logo" border="0" title="AskInga" /&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Using Named Expressions to drive interface items - A Sample&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;With thanks to Bentley&amp;#39;s &lt;a href="/members/sam-hendrick/default.aspx"&gt;Sam Hendrick&lt;/a&gt; for this article suggestion and content.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;By now you&amp;#39;ve heard and read about &lt;i&gt;Named Expressions&lt;/i&gt;, but might not have had the inspiration to experiment with them.&amp;nbsp; If this describes you, then the following tutorial might be just what you need to kick-start your learning and exploration of Named Expressions.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Named expressions can be used with the Customize utility to perform the following tasks:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;define rules that control when a tool is available, &lt;/li&gt;
&lt;li&gt;define rules to control when a task is available and to ,&lt;/li&gt;
&lt;li&gt;define rules for right-click context menus, such as conditions under which a context menu item is hidden.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;nbsp;Knowing this, we&amp;#39;ll use a couple of named expressions to load a different user interface depending upon the value of configuration variables defined in a pair UCF files:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;a href="http://communities.bentley.com/cfs-file.ashx/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/5751.NE2.mp4"&gt;communities.bentley.com/.../5751.NE2.mp4&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;The following instructions can be used as a guide to work through this tutorial.&amp;nbsp; Of course this is just a sample workflow, what you employ to create your customized interface may differ.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 1:&amp;nbsp; Create two UCFs and one PCF&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Using the File Open dialog, or what us old-timers still call the MicroStation Manager dialog, create two new users and one new project.&amp;nbsp; In this example, I&amp;#39;m using ENGINEERING and FACILITIES as the users and MyCity as the project.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/3554.new-user.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;From there you can locate and open each of the UCF files and add a couple of new variables which will be used by the named expressions to drive the interface items.&amp;nbsp; In this example, MYCITY_ENG is for the Engineering user and MYCITY_FAC is for the facilities user.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 2:&amp;nbsp; Define variables &lt;/b&gt;&lt;/p&gt;
&lt;p&gt;In the UCF file for the Engineering, we define MYCITY_ENG=1 and MYCITY_FAC=2 while the variables for the facilities user would be the exact opposite (MYCITY_ENG=2 and MYCITY_FAC=1).&amp;nbsp; Note, setting a variable to 1 is True, and when setting it to any value other than 1 is recognized as &amp;quot;False&amp;quot; when dealing with named expressions.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/0081.facucf.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 3:&amp;nbsp; Create named expressions&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Back in the MicroStation Manager, navigate to the DGNLIB folder and create a new file to hold the named expression definitions.&amp;nbsp; Note that this is optional, if you prefer you can add them to any dgnlib that&amp;#39;s in a location pointed to by MS_DGNLIBLIST.&lt;/p&gt;
&lt;p&gt;In the File Open dialog, ensure that you&amp;#39;re set to the new ENGINEERING user and the MyCity project.&amp;nbsp; Then open the dgnlib that will hold the named expressions and select &lt;i&gt;Utilities &amp;gt; Named Expressions&lt;/i&gt;.&amp;nbsp; The resulting dialog is used to define and manage named expressions in the active DGN library.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2538.Named-Expresssion-dialog.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The next step is to create two named expressions that test for the presence of the variables created above.&amp;nbsp; To do that, click on the New button and enter the following information.&lt;/p&gt;
&lt;p&gt;Internal Name - sets the name of the named expression:&amp;nbsp; MyCity_ENG&lt;/p&gt;
&lt;p&gt;External Name - sets the text label that appears in the user interface to describe the test that will be applied when evaluating the named expression:&amp;nbsp; &lt;em&gt;MyCity ENGINEERING &lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Description:&amp;nbsp;&lt;em&gt; Is this user in Engineering Services?&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Keywords - enables the named expression to be used in specific areas:&amp;nbsp;&lt;em&gt; File, Task, Tool, User Interface&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Symbol Sets - defines the values and properties of the named expression:&amp;nbsp; &lt;em&gt;ConfigVar&lt;/em&gt; &lt;/p&gt;
&lt;p&gt;Expression - is the text string that&amp;#39;s to be evaluated. The expression is a single-line statement that contains symbols and operators: &amp;nbsp;&amp;nbsp;&lt;em&gt;ConfigVar.GetExpandedConfigVar(&amp;quot;MYCITY_ENG&amp;quot;)=1&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 4:&amp;nbsp; Test expressions&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Since you&amp;#39;re using the ENGINEERING workspace, the test button should return &lt;i&gt;True.&amp;nbsp; &lt;/i&gt;This makes sense since the variable MyCity_ENG is set to 1 in the UCF file.&amp;nbsp; This named expression will be used to control the display an ENGEERING User task that will be created in the next section.&lt;/p&gt;
&lt;p&gt;You can repeat these steps to create a second named expression for MyCity_FAC.&amp;nbsp; Testing this variable returns false since the variable is not set to 1.&amp;nbsp; This named expression will be used to control the display of a FACILITIES User task that will be created later.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/0116.fale.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;To determine what the expression should be, select &lt;i&gt;Utilities &amp;gt; Report Symbols &lt;/i&gt;which opens expression_symbols.html in your browser.&amp;nbsp;&amp;nbsp; This is an index of available expression symbols that includes information such as the syntax to use, the description and an example.&amp;nbsp; The symbol being used in this exercise is &lt;i&gt;ConfigVar, &lt;/i&gt;which has four available expressions&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;ExpandConfigVar - returns string where all MicroStation configuration variables are expanded.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;GetExpandedConfigVar - returns the expanded variable.&lt;/p&gt;
&lt;p&gt;GetUnexpandedConfigVar - returns unexpanded variables.&lt;/p&gt;
&lt;p&gt;IsConfigVarDefined - returns true if the variable is defined.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;The named expressions can now be used for creating a show/hide test for tasks, tools, and other interface items.&amp;nbsp;&amp;nbsp; In this tutorial we&amp;#39;ll be creating two tasks:&lt;/p&gt;
&lt;p&gt;&lt;i&gt;ENGINEERING User&lt;/i&gt; which contains specific tasks for Engineering Services users, and&lt;/p&gt;
&lt;p&gt;&lt;i&gt;FACILITIES User&lt;/i&gt; which contains tasks for the Facility Maintenance users.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;The availability of these tasks will be driven by a Show/Hide test using the named expressions created earlier.&amp;nbsp; Let&amp;#39;s take a closer look.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 5:&amp;nbsp; Create UI dgnlib&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Start by creating a new DGN library to hold the interface customizations.&amp;nbsp; You&amp;#39;ll want to put this file in the projects .../dgnlib/ folder so it will be found by MS_DGNLIBLIST. &amp;nbsp;Note that this is defined at the project level, so all customizations in this dgnlib file will be read by all user workspaces using this project.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 6:&amp;nbsp; Create user tools and tasks&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Once open, navigate to the Customize dialog and create several new tool boxes under User Tools.&amp;nbsp; In this example, I created the following tool boxes and populated them with relevant tools:&amp;nbsp;&lt;em&gt; Annotation, Display, Draw, Measure, Modify, and Publishing.&amp;nbsp; &amp;nbsp;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/6740.User-Tools.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Once the User Tools have been created, go to the &lt;i&gt;Tasks&lt;/i&gt; pane and create a new task called &lt;i&gt;ENGINEERING User&lt;/i&gt;.&amp;nbsp; You can then populate this task with some or all of the user tools created above.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;Likewise, create a new task called &lt;i&gt;FACILITIES User&lt;/i&gt; and populate this task with some of the user tools.&amp;nbsp; &amp;nbsp;&amp;nbsp;Since MicroStation builds the interface on-the-fly, you can easily verify your UI design as you go. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/5504.fac.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 7:&amp;nbsp; Add Show/Hide test&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Tasks and workflows have a variety of properties that are defined in the Tool Container pane of the Customize dialog.&amp;nbsp; One of available properties is a &lt;i&gt;Show/Hide Test&lt;/i&gt; which determines whether the item is displayed in the Tasks dialog.&amp;nbsp; The tests are based on named expressions, and since we&amp;#39;ve already created those in Step 3, we can now define these tests.&lt;/p&gt;
&lt;p&gt;In the Customize dialog, highlight &lt;i&gt;ENGINEERING User&lt;/i&gt; in the Tasks pane, and note the available properties in the Tool Container.&amp;nbsp; Since there is no Show/Hide test, add one via the right click menu. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2260.Add-test.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Select the drop-down of the new Show/Hide test item and choose &lt;i&gt;MyCity ENGINEERING&lt;/i&gt; from the pop-up dialog.&amp;nbsp; At this time you may also want to click the Test button to ensure it returns True.&amp;nbsp; (Remember, your active user workspace is ENGINEERING therefore MyCity_ENG = 1.)&lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/8468.showhidepick.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Do the same for the &lt;i&gt;FACILITIES User&lt;/i&gt; task. Choose &lt;i&gt;MyCity FACILITIES&lt;/i&gt; from the available named expressions and verify that the test returns False.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;You&amp;#39;ll also notice that the FACILITIES User task has now been removed from the Tasks dialog on the interface!&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 8:&amp;nbsp; Test &lt;/b&gt;&lt;/p&gt;
&lt;p&gt;To further test this, close MicroStation and change the workspace to FACILITIES/MyCity.&amp;nbsp; Open any file and notice that you only have the FACILITIES User in the task dialog.&lt;/p&gt;
&lt;p&gt;Close MicroStation and change the workspace to ENGINEERING/MyCity.&amp;nbsp; This time, only the ENGINEERING User task is made available in the interface. &lt;/p&gt;
&lt;p&gt;The obvious benefit of the method is that CAD Administrators can maintain a single DGNLIB for all customizations and simply use Named Expressions to turn on or off tasks.&amp;nbsp; &amp;nbsp;In this case, we used a simple configuration variable to drive the show/hide test.&lt;/p&gt;
&lt;p&gt;The following content explores how to add the ENGINEERING User and FACILITIES User to the right click menu.&amp;nbsp; Since this customization will also use a Show/Hide test based on the named expressions, the right click menu will change its content based upon the active workspace. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 9:&amp;nbsp; Add ENGINEERING and FACILITIES to right-click &amp;nbsp;menu&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Using either the Engineering or Facilities workspace, and the MyCity project, re-open the UI dgnlib and navigate back to the customize dialog.&lt;/p&gt;
&lt;p&gt;Then go to the &lt;i&gt;Context Menus &lt;/i&gt;pane and add two new items, one for ENGINEERING and the other for FACILITIES.&amp;nbsp; Add the appropriate Show/Hide Test and finally populate the items with the desired user tools as shown.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/4426.Context-Menu.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Testing this is going to produce similar results to the tasks.&amp;nbsp; When the workspace is set to ENGINEERING/MyCity, the right-click menu will show the ENGINEERING User content, and when the workspace is set to FACILITIES/MyCity, it flip for the FACILITIES User.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2046.rightclickeng.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 10:&amp;nbsp; Add Switch User item to the right-click menu&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;As a final touch to the right-click menu, let&amp;#39;s add a Switch User item that performs the following tasks:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Show tasks from both the engineering and facilities users.&lt;/li&gt;
&lt;li&gt;Show only the ENGINEERING User tasks.&lt;/li&gt;
&lt;li&gt;Show only the FACILITIES User tasks&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/1273.bonus.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This can be very useful for those users who are not running the ENGINEERING or FACILITIES workspace.&amp;nbsp; For example, perhaps there&amp;#39;s a &lt;em&gt;CAD&amp;nbsp;&lt;/em&gt; workspace that needs access to all items of both interfaces. &lt;/p&gt;
&lt;p&gt;To start, create a new user workspace called &lt;em&gt;CAD&amp;nbsp;&lt;/em&gt;and open the UI dgnlib that contains the interface items for both ENGINEERING and FACILITIES.&amp;nbsp;&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/5078.cad.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;There&amp;#39;s no need to set any variables in the UCF file since this will be done by utilizing the &lt;em&gt;expand set&lt;/em&gt; MicroStation keyin.&lt;/p&gt;
&lt;p&gt;Navigate to the Customize dialog,&amp;nbsp;and add a new menu called &lt;i&gt;Switch User &lt;/i&gt;in the Context Menu.&amp;nbsp; Then add three menu items that execute the following MicroStation key ins:&amp;nbsp; &lt;/p&gt;
&lt;p&gt;Show Both Users:&amp;nbsp; &lt;em&gt;expand set MYCITY_ENG = 1;expand set MYCITY_FAC = 1;task reload&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;ENGINEERING:&amp;nbsp; &lt;em&gt;expand set MYCITY_ENG = 1;expand set MYCITY_FAC = 2;task reload&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;FACILITIES:&amp;nbsp; &lt;em&gt;expand set MYCITY_ENG = 2;expand set MYCITY_FAC = 1;task reload&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2465._3B00_lk.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;To finish this off, let&amp;#39;s take a quick look at the keyins:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Expand set&lt;/em&gt; sets a temporary configuration variable for the active design session.&amp;nbsp; Remember, the CAD user does not have MYCITY_ENG or MYCITY_FAC defined in the UCF file.&amp;nbsp;&amp;nbsp;Note that this is an excellent example of&amp;nbsp;using the&amp;nbsp; &lt;em&gt;expand set &lt;/em&gt;keyin to set a variable that&amp;#39;s not defined elsewhere.&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Task reload&lt;/em&gt;, does exactly what it implies - it reloads all of the tasks.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This tutorial is only a small sampling of what can be done with named expressions, and with a little curiosity and creativity the possibilities are seemingly endless.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;Thanks for reading and have fun!&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Sample files: &lt;/p&gt;
&lt;p&gt;&lt;a href="/communities/other_communities/askinga/m/askinga-files/149094/download.aspx"&gt;http://communities.bentley.com/communities/other_communities/askinga/m/askinga-files/149094/download.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Related Link:&lt;/p&gt;
&lt;p&gt;&lt;a href="/communities/other_communities/askinga/w/askinga/set-temporary-variables-with-the-expand-set-keyin.aspx"&gt;http://communities.bentley.com/communities/other_communities/askinga/w/askinga/set-temporary-variables-with-the-expand-set-keyin.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Related Video:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://communities.bentley.com/cfs-file.ashx/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/3603.DC_5F00_Binary.mp4"&gt;communities.bentley.com/.../3603.DC_5F00_Binary.mp4&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;
</description></item><item><title>Using Named Expressions to drive interface items – A sample	</title><link>https://communities.bentley.com/products/microstation/w/askinga/4541/using-named-expressions-to-drive-interface-items-a-sample/revision/23</link><pubDate>Wed, 03 Nov 2010 16:06:02 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:5bae2907-f0ef-4c23-8c9a-213531402e1d</guid><dc:creator>Phil Chouinard</dc:creator><comments>https://communities.bentley.com/products/microstation/w/askinga/4541/using-named-expressions-to-drive-interface-items-a-sample#comments</comments><description>Revision 23 posted to [Archived] AskInga Wiki by Phil Chouinard on 11/3/2010 4:06:02 PM&lt;br /&gt;
&lt;p&gt;&lt;img height="76" width="230" src="/askIngaPics/askingalogo.gif" alt="AskInga logo" border="0" title="AskInga" /&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Using Named Expressions to drive interface items - A Sample&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;With thanks to Bentley&amp;#39;s &lt;a href="/members/sam-hendrick/default.aspx"&gt;Sam Hendrick&lt;/a&gt; for this article suggestion and content.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;By now you&amp;#39;ve heard and read about &lt;i&gt;Named Expressions&lt;/i&gt;, but might not have had the inspiration to experiment with them.&amp;nbsp; If this describes you, then the following tutorial might be just what you need to kick-start your learning and exploration of Named Expressions.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Named expressions can be used with the Customize utility to perform the following tasks:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;define rules that control when a tool is available, &lt;/li&gt;
&lt;li&gt;define rules to control when a task is available and to ,&lt;/li&gt;
&lt;li&gt;define rules for right-click context menus, such as conditions under which a context menu item is hidden.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;nbsp;Knowing this, we&amp;#39;ll use a couple of named expressions to load a different user interface depending upon the value of configuration variables defined in a pair UCF files:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;a href="http://communities.bentley.com/cfs-file.ashx/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/5751.NE2.mp4"&gt;communities.bentley.com/.../5751.NE2.mp4&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;The following instructions can be used as a guide to work through this tutorial.&amp;nbsp; Of course this is just a sample workflow, what you employ to create your customized interface may differ.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 1:&amp;nbsp; Create two UCFs and one PCF&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Using the File Open dialog, or what us old-timers still call the MicroStation Manager dialog, create two new users and one new project.&amp;nbsp; In this example, I&amp;#39;m using ENGINEERING and FACILITIES as the users and MyCity as the project.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/3554.new-user.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;From there you can locate and open each of the UCF files and add a couple of new variables which will be used by the named expressions to drive the interface items.&amp;nbsp; In this example, MYCITY_ENG is for the Engineering user and MYCITY_FAC is for the facilities user.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 2:&amp;nbsp; Define variables &lt;/b&gt;&lt;/p&gt;
&lt;p&gt;In the UCF file for the Engineering, we define MYCITY_ENG=1 and MYCITY_FAC=2 while the variables for the facilities user would be the exact opposite (MYCITY_ENG=2 and MYCITY_FAC=1).&amp;nbsp; Note, setting a variable to 1 is True, and when setting it to any value other than 1 is recognized as &amp;quot;False&amp;quot; when dealing with named expressions.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/0081.facucf.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 3:&amp;nbsp; Create named expressions&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Back in the MicroStation Manager, navigate to the DGNLIB folder and create a new file to hold the named expression definitions.&amp;nbsp; Note that this is optional, if you prefer you can add them to any dgnlib that&amp;#39;s in a location pointed to by MS_DGNLIBLIST.&lt;/p&gt;
&lt;p&gt;In the File Open dialog, ensure that you&amp;#39;re set to the new ENGINEERING user and the MyCity project.&amp;nbsp; Then open the dgnlib that will hold the named expressions and select &lt;i&gt;Utilities &amp;gt; Named Expressions&lt;/i&gt;.&amp;nbsp; The resulting dialog is used to define and manage named expressions in the active DGN library.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2538.Named-Expresssion-dialog.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The next step is to create two named expressions that test for the presence of the variables created above.&amp;nbsp; To do that, click on the New button and enter the following information.&lt;/p&gt;
&lt;p&gt;Internal Name - sets the name of the named expression:&amp;nbsp; MyCity_ENG&lt;/p&gt;
&lt;p&gt;External Name - sets the text label that appears in the user interface to describe the test that will be applied when evaluating the named expression:&amp;nbsp; &lt;em&gt;MyCity ENGINEERING &lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Description:&amp;nbsp;&lt;em&gt; Is this user in Engineering Services?&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Keywords - enables the named expression to be used in specific areas:&amp;nbsp;&lt;em&gt; File, Task, Tool, User Interface&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Symbol Sets - defines the values and properties of the named expression:&amp;nbsp; &lt;em&gt;ConfigVar&lt;/em&gt; &lt;/p&gt;
&lt;p&gt;Expression - is the text string that&amp;#39;s to be evaluated. The expression is a single-line statement that contains symbols and operators: &amp;nbsp;&amp;nbsp;&lt;em&gt;ConfigVar.GetExpandedConfigVar(&amp;quot;MYCITY_ENG&amp;quot;)=1&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 4:&amp;nbsp; Test expressions&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Since you&amp;#39;re using the ENGINEERING workspace, the test button should return &lt;i&gt;True.&amp;nbsp; &lt;/i&gt;This makes sense since the variable MyCity_ENG is set to 1 in the UCF file.&amp;nbsp; This named expression will be used to control the display an ENGEERING User task that will be created in the next section.&lt;/p&gt;
&lt;p&gt;You can repeat these steps to create a second named expression for MyCity_FAC.&amp;nbsp; Testing this variable returns false since the variable is not set to 1.&amp;nbsp; This named expression will be used to control the display of a FACILITIES User task that will be created later.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/0116.fale.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;To determine what the expression should be, select &lt;i&gt;Utilities &amp;gt; Report Symbols &lt;/i&gt;which opens expression_symbols.html in your browser.&amp;nbsp;&amp;nbsp; This is an index of available expression symbols that includes information such as the syntax to use, the description and an example.&amp;nbsp; The symbol being used in this exercise is &lt;i&gt;ConfigVar, &lt;/i&gt;which has four available expressions&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;ExpandConfigVar - returns string where all MicroStation configuration variables are expanded.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;GetExpandedConfigVar - returns the expanded variable.&lt;/p&gt;
&lt;p&gt;GetUnexpandedConfigVar - returns unexpanded variables.&lt;/p&gt;
&lt;p&gt;IsConfigVarDefined - returns true if the variable is defined.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;The named expressions can now be used for creating a show/hide test for tasks, tools, and other interface items.&amp;nbsp;&amp;nbsp; In this tutorial we&amp;#39;ll be creating two tasks:&lt;/p&gt;
&lt;p&gt;&lt;i&gt;ENGINEERING User&lt;/i&gt; which contains specific tasks for Engineering Services users, and&lt;/p&gt;
&lt;p&gt;&lt;i&gt;FACILITIES User&lt;/i&gt; which contains tasks for the Facility Maintenance users.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;The availability of these tasks will be driven by a Show/Hide test using the named expressions created earlier.&amp;nbsp; Let&amp;#39;s take a closer look.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 5:&amp;nbsp; Create UI dgnlib&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Start by creating a new DGN library to hold the interface customizations.&amp;nbsp; You&amp;#39;ll want to put this file in the projects .../dgnlib/ folder so it will be found by MS_DGNLIBLIST. &amp;nbsp;Note that this is defined at the project level, so all customizations in this dgnlib file will be read by all user workspaces using this project.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 6:&amp;nbsp; Create user tools and tasks&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Once open, navigate to the Customize dialog and create several new tool boxes under User Tools.&amp;nbsp; In this example, I created the following tool boxes and populated them with relevant tools:&amp;nbsp;&lt;em&gt; Annotation, Display, Draw, Measure, Modify, and Publishing.&amp;nbsp; &amp;nbsp;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/6740.User-Tools.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Once the User Tools have been created, go to the &lt;i&gt;Tasks&lt;/i&gt; pane and create a new task called &lt;i&gt;ENGINEERING User&lt;/i&gt;.&amp;nbsp; You can then populate this task with some or all of the user tools created above.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;Likewise, create a new task called &lt;i&gt;FACILITIES User&lt;/i&gt; and populate this task with some of the user tools.&amp;nbsp; &amp;nbsp;&amp;nbsp;Since MicroStation builds the interface on-the-fly, you can easily verify your UI design as you go. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/5504.fac.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 7:&amp;nbsp; Add Show/Hide test&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Tasks and workflows have a variety of properties that are defined in the Tool Container pane of the Customize dialog.&amp;nbsp; One of available properties is a &lt;i&gt;Show/Hide Test&lt;/i&gt; which determines whether the item is displayed in the Tasks dialog.&amp;nbsp; The tests are based on named expressions, and since we&amp;#39;ve already created those in Step 3, we can now define these tests.&lt;/p&gt;
&lt;p&gt;In the Customize dialog, highlight &lt;i&gt;ENGINEERING User&lt;/i&gt; in the Tasks pane, and note the available properties in the Tool Container.&amp;nbsp; Since there is no Show/Hide test, add one via the right click menu. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2260.Add-test.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Select the drop-down of the new Show/Hide test item and choose &lt;i&gt;MyCity ENGINEERING&lt;/i&gt; from the pop-up dialog.&amp;nbsp; At this time you may also want to click the Test button to ensure it returns True.&amp;nbsp; (Remember, your active user workspace is ENGINEERING therefore MyCity_ENG = 1.)&lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/8468.showhidepick.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Do the same for the &lt;i&gt;FACILITIES User&lt;/i&gt; task. Choose &lt;i&gt;MyCity FACILITIES&lt;/i&gt; from the available named expressions and verify that the test returns False.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;You&amp;#39;ll also notice that the FACILITIES User task has now been removed from the Tasks dialog on the interface!&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 8:&amp;nbsp; Test &lt;/b&gt;&lt;/p&gt;
&lt;p&gt;To further test this, close MicroStation and change the workspace to FACILITIES/MyCity.&amp;nbsp; Open any file and notice that you only have the FACILITIES User in the task dialog.&lt;/p&gt;
&lt;p&gt;Close MicroStation and change the workspace to ENGINEERING/MyCity.&amp;nbsp; This time, only the ENGINEERING User task is made available in the interface. &lt;/p&gt;
&lt;p&gt;The obvious benefit of the method is that CAD Administrators can maintain a single DGNLIB for all customizations and simply use Named Expressions to turn on or off tasks.&amp;nbsp; &amp;nbsp;In this case, we used a simple configuration variable to drive the show/hide test.&lt;/p&gt;
&lt;p&gt;The following content explores how to add the ENGINEERING User and FACILITIES User to the right click menu.&amp;nbsp; Since this customization will also use a Show/Hide test based on the named expressions, the right click menu will change its content based upon the active workspace. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 9:&amp;nbsp; Add ENGINEERING and FACILITIES to right-click &amp;nbsp;menu&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Using either the Engineering or Facilities workspace, and the MyCity project, re-open the UI dgnlib and navigate back to the customize dialog.&lt;/p&gt;
&lt;p&gt;Then go to the &lt;i&gt;Context Menus &lt;/i&gt;pane and add two new items, one for ENGINEERING and the other for FACILITIES.&amp;nbsp; Add the appropriate Show/Hide Test and finally populate the items with the desired user tools as shown.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/4426.Context-Menu.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Testing this is going to produce similar results to the tasks.&amp;nbsp; When the workspace is set to ENGINEERING/MyCity, the right-click menu will show the ENGINEERING User content, and when the workspace is set to FACILITIES/MyCity, it flip for the FACILITIES User.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2046.rightclickeng.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 10:&amp;nbsp; Add Switch User item to the right-click menu&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;As a final touch to the right-click menu, let&amp;#39;s add a Switch User item that performs the following tasks:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Show tasks from both the engineering and facilities users.&lt;/li&gt;
&lt;li&gt;Show only the ENGINEERING User tasks.&lt;/li&gt;
&lt;li&gt;Show only the FACILITIES User tasks&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/1273.bonus.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This can be very useful for those users who are not running the ENGINEERING or FACILITIES workspace.&amp;nbsp; For example, perhaps there&amp;#39;s a &lt;em&gt;CAD&amp;nbsp;&lt;/em&gt; workspace that needs access to all items of both interfaces. &lt;/p&gt;
&lt;p&gt;To start, create a new user workspace called &lt;em&gt;CAD&amp;nbsp;&lt;/em&gt;and open the UI dgnlib that contains the interface items for both ENGINEERING and FACILITIES.&amp;nbsp;&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/5078.cad.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;There&amp;#39;s no need to set any variables in the UCF file since this will be done by utilizing the &lt;em&gt;expand set&lt;/em&gt; MicroStation keyin.&lt;/p&gt;
&lt;p&gt;Navigate to the Customize dialog,&amp;nbsp;and add a new menu called &lt;i&gt;Switch User &lt;/i&gt;in the Context Menu.&amp;nbsp; Then add three menu items that execute the following MicroStation key ins:&amp;nbsp; &lt;/p&gt;
&lt;p&gt;Show Both Users:&amp;nbsp; &lt;em&gt;expand set MYCITY_ENG = 1;expand set MYCITY_FAC = 1;task reload&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;ENGINEERING:&amp;nbsp; &lt;em&gt;expand set MYCITY_ENG = 1;expand set MYCITY_FAC = 2;task reload&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;FACILITIES:&amp;nbsp; &lt;em&gt;expand set MYCITY_ENG = 2;expand set MYCITY_FAC = 1;task reload&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2465._3B00_lk.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;To finish this off, let&amp;#39;s take a quick look at the keyins:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Expand set&lt;/em&gt; sets a temporary configuration variable for the active design session.&amp;nbsp; Remember, the CAD user does not have MYCITY_ENG or MYCITY_FAC defined in the UCF file.&amp;nbsp;&amp;nbsp;Note that this is an excellent example of&amp;nbsp;using the&amp;nbsp; &lt;em&gt;expand set &lt;/em&gt;keyin to set a variable that&amp;#39;s not defined elsewhere.&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Task reload&lt;/em&gt;, does exactly what it implies - it reloads all of the tasks.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This tutorial is only a small sampling of what can be done with named expressions, and with a little curiosity and creativity the possibilities are seemingly endless.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;Thanks for reading and have fun!&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Sample files: &lt;/p&gt;
&lt;p&gt;&lt;a href="/communities/other_communities/askinga/m/askinga-files/149094/download.aspx"&gt;http://communities.bentley.com/communities/other_communities/askinga/m/askinga-files/149094/download.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Related Link:&lt;/p&gt;
&lt;p&gt;&lt;a href="/communities/other_communities/askinga/w/askinga/set-temporary-variables-with-the-expand-set-keyin.aspx"&gt;http://communities.bentley.com/communities/other_communities/askinga/w/askinga/set-temporary-variables-with-the-expand-set-keyin.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;
</description></item><item><title>Using Named Expressions to drive interface items – A sample	</title><link>https://communities.bentley.com/products/microstation/w/askinga/4541/using-named-expressions-to-drive-interface-items-a-sample/revision/22</link><pubDate>Wed, 03 Nov 2010 16:05:13 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:5bae2907-f0ef-4c23-8c9a-213531402e1d</guid><dc:creator>Phil Chouinard</dc:creator><comments>https://communities.bentley.com/products/microstation/w/askinga/4541/using-named-expressions-to-drive-interface-items-a-sample#comments</comments><description>Revision 22 posted to [Archived] AskInga Wiki by Phil Chouinard on 11/3/2010 4:05:13 PM&lt;br /&gt;
&lt;p&gt;&lt;img height="76" width="230" src="/askIngaPics/askingalogo.gif" alt="AskInga logo" border="0" title="AskInga" /&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Using Named Expressions to drive interface items - A Sample&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;With thanks to Bentley&amp;#39;s &lt;a href="/members/sam-hendrick/default.aspx"&gt;Sam Hendrick&lt;/a&gt; for this article suggestion and content.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;By now you&amp;#39;ve heard and read about &lt;i&gt;Named Expressions&lt;/i&gt;, but might not have had the inspiration to experiment with them.&amp;nbsp; If this describes you, then the following tutorial might be just what you need to kick-start your learning and exploration of Named Expressions.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Named expressions can be used with the Customize utility to perform the following tasks:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;define rules that control when a tool is available, &lt;/li&gt;
&lt;li&gt;define rules to control when a task is available and to ,&lt;/li&gt;
&lt;li&gt;define rules for right-click context menus, such as conditions under which a context menu item is hidden.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;nbsp;Knowing this, we&amp;#39;ll use a couple of named expressions to load a different user interface depending upon the value of configuration variables defined in a pair UCF files:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;a href="http://communities.bentley.com/cfs-file.ashx/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/5751.NE2.mp4"&gt;communities.bentley.com/.../5751.NE2.mp4&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;The following instructions can be used as a guide to work through this tutorial.&amp;nbsp; Of course this is just a sample workflow, what you employ to create your customized interface may differ.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 1:&amp;nbsp; Create two UCFs and one PCF&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Using the File Open dialog, or what us old-timers still call the MicroStation Manager dialog, create two new users and one new project.&amp;nbsp; In this example, I&amp;#39;m using ENGINEERING and FACILITIES as the users and MyCity as the project.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/3554.new-user.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;From there you can locate and open each of the UCF files and add a couple of new variables which will be used by the named expressions to drive the interface items.&amp;nbsp; In this example, MYCITY_ENG is for the Engineering user and MYCITY_FAC is for the facilities user.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 2:&amp;nbsp; Define variables &lt;/b&gt;&lt;/p&gt;
&lt;p&gt;In the UCF file for the Engineering, we define MYCITY_ENG=1 and MYCITY_FAC=2 while the variables for the facilities user would be the exact opposite (MYCITY_ENG=2 and MYCITY_FAC=1).&amp;nbsp; Note, setting a variable to 1 is True, and when setting it to any value other than 1 is recognized as &amp;quot;False&amp;quot; when dealing with named expressions.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/0081.facucf.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 3:&amp;nbsp; Create named expressions&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Back in the MicroStation Manager, navigate to the DGNLIB folder and create a new file to hold the named expression definitions.&amp;nbsp; Note that this is optional, if you prefer you can add them to any dgnlib that&amp;#39;s in a location pointed to by MS_DGNLIBLIST.&lt;/p&gt;
&lt;p&gt;In the File Open dialog, ensure that you&amp;#39;re set to the new ENGINEERING user and the MyCity project.&amp;nbsp; Then open the dgnlib that will hold the named expressions and select &lt;i&gt;Utilities &amp;gt; Named Expressions&lt;/i&gt;.&amp;nbsp; The resulting dialog is used to define and manage named expressions in the active DGN library.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2538.Named-Expresssion-dialog.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The next step is to create two named expressions that test for the presence of the variables created above.&amp;nbsp; To do that, click on the New button and enter the following information.&lt;/p&gt;
&lt;p&gt;Internal Name - sets the name of the named expression:&amp;nbsp; MyCity_ENG&lt;/p&gt;
&lt;p&gt;External Name - sets the text label that appears in the user interface to describe the test that will be applied when evaluating the named expression:&amp;nbsp; &lt;em&gt;MyCity ENGINEERING &lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Description:&amp;nbsp;&lt;em&gt; Is this user in Engineering Services?&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Keywords - enables the named expression to be used in specific areas:&amp;nbsp;&lt;em&gt; File, Task, Tool, User Interface&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Symbol Sets - defines the values and properties of the named expression:&amp;nbsp; &lt;em&gt;ConfigVar&lt;/em&gt; &lt;/p&gt;
&lt;p&gt;Expression - is the text string that&amp;#39;s to be evaluated. The expression is a single-line statement that contains symbols and operators: &amp;nbsp;&amp;nbsp;&lt;em&gt;ConfigVar.GetExpandedConfigVar(&amp;quot;MYCITY_ENG&amp;quot;)=1&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 4:&amp;nbsp; Test expressions&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Since you&amp;#39;re using the ENGINEERING workspace, the test button should return &lt;i&gt;True.&amp;nbsp; &lt;/i&gt;This makes sense since the variable MyCity_ENG is set to 1 in the UCF file.&amp;nbsp; This named expression will be used to control the display an ENGEERING User task that will be created in the next section.&lt;/p&gt;
&lt;p&gt;You can repeat these steps to create a second named expression for MyCity_FAC.&amp;nbsp; Testing this variable returns false since the variable is not set to 1.&amp;nbsp; This named expression will be used to control the display of a FACILITIES User task that will be created later.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/0116.fale.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;To determine what the expression should be, select &lt;i&gt;Utilities &amp;gt; Report Symbols &lt;/i&gt;which opens expression_symbols.html in your browser.&amp;nbsp;&amp;nbsp; This is an index of available expression symbols that includes information such as the syntax to use, the description and an example.&amp;nbsp; The symbol being used in this exercise is &lt;i&gt;ConfigVar, &lt;/i&gt;which has four available expressions&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;ExpandConfigVar - returns string where all MicroStation configuration variables are expanded.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;GetExpandedConfigVar - returns the expanded variable.&lt;/p&gt;
&lt;p&gt;GetUnexpandedConfigVar - returns unexpanded variables.&lt;/p&gt;
&lt;p&gt;IsConfigVarDefined - returns true if the variable is defined.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;The named expressions can now be used for creating a show/hide test for tasks, tools, and other interface items.&amp;nbsp;&amp;nbsp; In this tutorial we&amp;#39;ll be creating two tasks:&lt;/p&gt;
&lt;p&gt;&lt;i&gt;ENGINEERING User&lt;/i&gt; which contains specific tasks for Engineering Services users, and&lt;/p&gt;
&lt;p&gt;&lt;i&gt;FACILITIES User&lt;/i&gt; which contains tasks for the Facility Maintenance users.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;The availability of these tasks will be driven by a Show/Hide test using the named expressions created earlier.&amp;nbsp; Let&amp;#39;s take a closer look.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 5:&amp;nbsp; Create UI dgnlib&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Start by creating a new DGN library to hold the interface customizations.&amp;nbsp; You&amp;#39;ll want to put this file in the projects .../dgnlib/ folder so it will be found by MS_DGNLIBLIST. &amp;nbsp;Note that this is defined at the project level, so all customizations in this dgnlib file will be read by all user workspaces using this project.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 6:&amp;nbsp; Create user tools and tasks&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Once open, navigate to the Customize dialog and create several new tool boxes under User Tools.&amp;nbsp; In this example, I created the following tool boxes and populated them with relevant tools:&amp;nbsp;&lt;em&gt; Annotation, Display, Draw, Measure, Modify, and Publishing.&amp;nbsp; &amp;nbsp;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/6740.User-Tools.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Once the User Tools have been created, go to the &lt;i&gt;Tasks&lt;/i&gt; pane and create a new task called &lt;i&gt;ENGINEERING User&lt;/i&gt;.&amp;nbsp; You can then populate this task with some or all of the user tools created above.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;Likewise, create a new task called &lt;i&gt;FACILITIES User&lt;/i&gt; and populate this task with some of the user tools.&amp;nbsp; &amp;nbsp;&amp;nbsp;Since MicroStation builds the interface on-the-fly, you can easily verify your UI design as you go. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/5504.fac.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 7:&amp;nbsp; Add Show/Hide test&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Tasks and workflows have a variety of properties that are defined in the Tool Container pane of the Customize dialog.&amp;nbsp; One of available properties is a &lt;i&gt;Show/Hide Test&lt;/i&gt; which determines whether the item is displayed in the Tasks dialog.&amp;nbsp; The tests are based on named expressions, and since we&amp;#39;ve already created those in Step 3, we can now define these tests.&lt;/p&gt;
&lt;p&gt;In the Customize dialog, highlight &lt;i&gt;ENGINEERING User&lt;/i&gt; in the Tasks pane, and note the available properties in the Tool Container.&amp;nbsp; Since there is no Show/Hide test, add one via the right click menu. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2260.Add-test.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Select the drop-down of the new Show/Hide test item and choose &lt;i&gt;MyCity ENGINEERING&lt;/i&gt; from the pop-up dialog.&amp;nbsp; At this time you may also want to click the Test button to ensure it returns True.&amp;nbsp; (Remember, your active user workspace is ENGINEERING therefore MyCity_ENG = 1.)&lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/8468.showhidepick.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Do the same for the &lt;i&gt;FACILITIES User&lt;/i&gt; task. Choose &lt;i&gt;MyCity FACILITIES&lt;/i&gt; from the available named expressions and verify that the test returns False.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;You&amp;#39;ll also notice that the FACILITIES User task has now been removed from the Tasks dialog on the interface!&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 8:&amp;nbsp; Test &lt;/b&gt;&lt;/p&gt;
&lt;p&gt;To further test this, close MicroStation and change the workspace to FACILITIES/MyCity.&amp;nbsp; Open any file and notice that you only have the FACILITIES User in the task dialog.&lt;/p&gt;
&lt;p&gt;Close MicroStation and change the workspace to ENGINEERING/MyCity.&amp;nbsp; This time, only the ENGINEERING User task is made available in the interface. &lt;/p&gt;
&lt;p&gt;The obvious benefit of the method is that CAD Administrators can maintain a single DGNLIB for all customizations and simply use Named Expressions to turn on or off tasks.&amp;nbsp; &amp;nbsp;In this case, we used a simple configuration variable to drive the show/hide test.&lt;/p&gt;
&lt;p&gt;The following content explores how to add the ENGINEERING User and FACILITIES User to the right click menu.&amp;nbsp; Since this customization will also use a Show/Hide test based on the named expressions, the right click menu will change its content based upon the active workspace. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 9:&amp;nbsp; Add ENGINEERING and FACILITIES to right-click &amp;nbsp;menu&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Using either the Engineering or Facilities workspace, and the MyCity project, re-open the UI dgnlib and navigate back to the customize dialog.&lt;/p&gt;
&lt;p&gt;Then go to the &lt;i&gt;Context Menus &lt;/i&gt;pane and add two new items, one for ENGINEERING and the other for FACILITIES.&amp;nbsp; Add the appropriate Show/Hide Test and finally populate the items with the desired user tools as shown.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/4426.Context-Menu.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Testing this is going to produce similar results to the tasks.&amp;nbsp; When the workspace is set to ENGINEERING/MyCity, the right-click menu will show the ENGINEERING User content, and when the workspace is set to FACILITIES/MyCity, it flip for the FACILITIES User.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2046.rightclickeng.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 10:&amp;nbsp; Add Switch User item to the right-click menu&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;As a final touch to the right-click menu, let&amp;#39;s add a Switch User item that performs the following tasks:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Show tasks from both the engineering and facilities users.&lt;/li&gt;
&lt;li&gt;Show only the ENGINEERING User tasks.&lt;/li&gt;
&lt;li&gt;Show only the FACILITIES User tasks&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/1273.bonus.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This can be very useful for those users who are not running the ENGINEERING or FACILITIES workspace.&amp;nbsp; For example, perhaps there&amp;#39;s a &lt;em&gt;CAD&amp;nbsp;&lt;/em&gt; workspace that needs access to all items of both interfaces. &lt;/p&gt;
&lt;p&gt;To start, create a new user workspace called &lt;em&gt;CAD&amp;nbsp;&lt;/em&gt;and open the UI dgnlib that contains the interface items for both ENGINEERING and FACILITIES.&amp;nbsp;&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/5078.cad.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;There&amp;#39;s no need to set any variables in the UCF file since this will be done by utilizing the &lt;em&gt;expand set&lt;/em&gt; MicroStation keyin.&lt;/p&gt;
&lt;p&gt;Navigate to the Customize dialog,&amp;nbsp;and add a new menu called &lt;i&gt;Switch User &lt;/i&gt;in the Context Menu.&amp;nbsp; Then add three menu items that execute the following MicroStation key ins:&amp;nbsp; &lt;/p&gt;
&lt;p&gt;Show Both Users:&amp;nbsp; &lt;em&gt;expand set MYCITY_ENG = 1;expand set MYCITY_FAC = 1;task reload&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;ENGINEERING:&amp;nbsp; &lt;em&gt;expand set MYCITY_ENG = 1;expand set MYCITY_FAC = 2;task reload&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;FACILITIES:&amp;nbsp; &lt;em&gt;expand set MYCITY_ENG = 2;expand set MYCITY_FAC = 1;task reload&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2465._3B00_lk.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;To finish this off, let&amp;#39;s take a quick look at the keyins:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Expand set&lt;/em&gt; sets a temporary configuration variable for the active design session.&amp;nbsp; Remember, the CAD user does not have MYCITY_ENG or MYCITY_FAC defined in the UCF file.&amp;nbsp;&amp;nbsp;Note that this is an excellent example of&amp;nbsp;using the&amp;nbsp; &lt;em&gt;expand set &lt;/em&gt;keyin to set a variable that&amp;#39;s not defined elsewhere.&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Task reload&lt;/em&gt;, does exactly what it implies - it reloads all of the tasks.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This tutorial is only a small sampling of what can be done with named expressions, and with a little curiosity and creativity the possibilities are seemingly endless.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;Thanks for reading and have fun!&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Sample files: &lt;/p&gt;
&lt;p&gt;&lt;a href="/communities/other_communities/askinga/m/askinga-files/149094/download.aspx"&gt;http://communities.bentley.com/communities/other_communities/askinga/m/askinga-files/149094/download.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Related Link:&lt;/p&gt;
&lt;p&gt;&lt;a href="/communities/other_communities/askinga/w/askinga/set-temporary-variables-with-the-expand-set-keyin.aspx"&gt;http://communities.bentley.com/communities/other_communities/askinga/w/askinga/set-temporary-variables-with-the-expand-set-keyin.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;
</description></item><item><title>Using Named Expressions to drive interface items – A sample	</title><link>https://communities.bentley.com/products/microstation/w/askinga/4541/using-named-expressions-to-drive-interface-items-a-sample/revision/21</link><pubDate>Wed, 03 Nov 2010 15:42:33 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:5bae2907-f0ef-4c23-8c9a-213531402e1d</guid><dc:creator>Inga Morozoff</dc:creator><comments>https://communities.bentley.com/products/microstation/w/askinga/4541/using-named-expressions-to-drive-interface-items-a-sample#comments</comments><description>Revision 21 posted to [Archived] AskInga Wiki by Inga Morozoff on 11/3/2010 3:42:33 PM&lt;br /&gt;
&lt;p&gt;&lt;img height="76" width="230" src="/askIngaPics/askingalogo.gif" alt="AskInga logo" border="0" title="AskInga" /&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Using Named Expressions to drive interface items - A Sample&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;With thanks to Bentley&amp;#39;s &lt;a href="/members/sam-hendrick/default.aspx"&gt;Sam Hendrick&lt;/a&gt; for this article suggestion and content.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;By now you&amp;#39;ve heard and read about &lt;i&gt;Named Expressions&lt;/i&gt;, but might not have had the inspiration to experiment with them.&amp;nbsp; If this describes you, then the following tutorial might be just what you need to kick-start your learning and exploration of Named Expressions.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Named expressions can be used with the Customize utility to perform the following tasks:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;define rules that control when a tool is available, &lt;/li&gt;
&lt;li&gt;define rules to control when a task is available and to ,&lt;/li&gt;
&lt;li&gt;define rules for right-click context menus, such as conditions under which a context menu item is hidden.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;nbsp;Knowing this, we&amp;#39;ll use a couple of named expressions to load a different user interface depending upon the value of configuration variables defined in a pair UCF files:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;a href="http://communities.bentley.com/cfs-file.ashx/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/5751.NE2.mp4"&gt;communities.bentley.com/.../5751.NE2.mp4&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;The following instructions can be used as a guide to work through this tutorial.&amp;nbsp; Of course this is just a sample workflow, what you employ to create your customized interface may differ.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 1:&amp;nbsp; Create two UCFs and one PCF&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Using the File Open dialog, or what us old-timers still call the MicroStation Manager dialog, create two new users and one new project.&amp;nbsp; In this example, I&amp;#39;m using ENGINEERING and FACILITIES as the users and MyCity as the project.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/3554.new-user.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;From there you can locate and open each of the UCF files and add a couple of new variables which will be used by the named expressions to drive the interface items.&amp;nbsp; In this example, MYCITY_ENG is for the Engineering user and MYCITY_FAC is for the facilities user.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 2:&amp;nbsp; Define variables &lt;/b&gt;&lt;/p&gt;
&lt;p&gt;In the UCF file for the Engineering, we define MYCITY_ENG=1 and MYCITY_FAC=2 while the variables for the facilities user would be the exact opposite (MYCITY_ENG=2 and MYCITY_FAC=1).&amp;nbsp; Note, setting a variable to 1 is True, and when setting it to any value other than 1 is recognized as &amp;quot;False&amp;quot; when dealing with named expressions.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/0081.facucf.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 3:&amp;nbsp; Create named expressions&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Back in the MicroStation Manager, navigate to the DGNLIB folder and create a new file to hold the named expression definitions.&amp;nbsp; Note that this is optional, if you prefer you can add them to any dgnlib that&amp;#39;s in a location pointed to by MS_DGNLIBLIST.&lt;/p&gt;
&lt;p&gt;In the File Open dialog, ensure that you&amp;#39;re set to the new ENGINEERING user and the MyCity project.&amp;nbsp; Then open the dgnlib that will hold the named expressions and select &lt;i&gt;Utilities &amp;gt; Named Expressions&lt;/i&gt;.&amp;nbsp; The resulting dialog is used to define and manage named expressions in the active DGN library.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2538.Named-Expresssion-dialog.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The next step is to create two named expressions that test for the presence of the variables created above.&amp;nbsp; To do that, click on the New button and enter the following information.&lt;/p&gt;
&lt;p&gt;Internal Name - sets the name of the named expression:&amp;nbsp; MyCity_ENG&lt;/p&gt;
&lt;p&gt;External Name - sets the text label that appears in the user interface to describe the test that will be applied when evaluating the named expression:&amp;nbsp; &lt;em&gt;MyCity ENGINEERING &lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Description:&amp;nbsp;&lt;em&gt; Is this user in Engineering Services?&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Keywords - enables the named expression to be used in specific areas:&amp;nbsp;&lt;em&gt; File, Task, Tool, User Interface&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Symbol Sets - defines the values and properties of the named expression:&amp;nbsp; &lt;em&gt;ConfigVar&lt;/em&gt; &lt;/p&gt;
&lt;p&gt;Expression - is the text string that&amp;#39;s to be evaluated. The expression is a single-line statement that contains symbols and operators: &amp;nbsp;&amp;nbsp;&lt;em&gt;ConfigVar.GetExpandedConfigVar(&amp;quot;MYCITY_ENG&amp;quot;)=1&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 4:&amp;nbsp; Test expressions&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Since you&amp;#39;re using the ENGINEERING workspace, the test button should return &lt;i&gt;True.&amp;nbsp; &lt;/i&gt;This makes sense since the variable MyCity_ENG is set to 1 in the UCF file.&amp;nbsp; This named expression will be used to control the display an ENGEERING User task that will be created in the next section.&lt;/p&gt;
&lt;p&gt;You can repeat these steps to create a second named expression for MyCity_FAC.&amp;nbsp; Testing this variable returns false since the variable is not set to 1.&amp;nbsp; This named expression will be used to control the display of a FACILITIES User task that will be created later.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/0116.fale.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;To determine what the expression should be, select &lt;i&gt;Utilities &amp;gt; Report Symbols &lt;/i&gt;which opens expression_symbols.html in your browser.&amp;nbsp;&amp;nbsp; This is an index of available expression symbols that includes information such as the syntax to use, the description and an example.&amp;nbsp; The symbol being used in this exercise is &lt;i&gt;ConfigVar, &lt;/i&gt;which has four available expressions&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;ExpandConfigVar - returns string where all MicroStation configuration variables are expanded.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;GetExpandedConfigVar - returns the expanded variable.&lt;/p&gt;
&lt;p&gt;GetUnexpandedConfigVar - returns unexpanded variables.&lt;/p&gt;
&lt;p&gt;IsConfigVarDefined - returns true if the variable is defined.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;The named expressions can now be used for creating a show/hide test for tasks, tools, and other interface items.&amp;nbsp;&amp;nbsp; In this tutorial we&amp;#39;ll be creating two tasks:&lt;/p&gt;
&lt;p&gt;&lt;i&gt;ENGINEERING User&lt;/i&gt; which contains specific tasks for Engineering Services users, and&lt;/p&gt;
&lt;p&gt;&lt;i&gt;FACILITIES User&lt;/i&gt; which contains tasks for the Facility Maintenance users.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;The availability of these tasks will be driven by a Show/Hide test using the named expressions created earlier.&amp;nbsp; Let&amp;#39;s take a closer look.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 5:&amp;nbsp; Create UI dgnlib&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Start by creating a new DGN library to hold the interface customizations.&amp;nbsp; You&amp;#39;ll want to put this file in the projects .../dgnlib/ folder so it will be found by MS_DGNLIBLIST. &amp;nbsp;Note that this is defined at the project level, so all customizations in this dgnlib file will be read by all user workspaces using this project.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 6:&amp;nbsp; Create user tools and tasks&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Once open, navigate to the Customize dialog and create several new tool boxes under User Tools.&amp;nbsp; In this example, I created the following tool boxes and populated them with relevant tools:&amp;nbsp;&lt;em&gt; Annotation, Display, Draw, Measure, Modify, and Publishing.&amp;nbsp; &amp;nbsp;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/6740.User-Tools.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Once the User Tools have been created, go to the &lt;i&gt;Tasks&lt;/i&gt; pane and create a new task called &lt;i&gt;ENGINEERING User&lt;/i&gt;.&amp;nbsp; You can then populate this task with some or all of the user tools created above.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;Likewise, create a new task called &lt;i&gt;FACILITIES User&lt;/i&gt; and populate this task with some of the user tools.&amp;nbsp; &amp;nbsp;&amp;nbsp;Since MicroStation builds the interface on-the-fly, you can easily verify your UI design as you go. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/5504.fac.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 7:&amp;nbsp; Add Show/Hide test&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Tasks and workflows have a variety of properties that are defined in the Tool Container pane of the Customize dialog.&amp;nbsp; One of available properties is a &lt;i&gt;Show/Hide Test&lt;/i&gt; which determines whether the item is displayed in the Tasks dialog.&amp;nbsp; The tests are based on named expressions, and since we&amp;#39;ve already created those in Step 3, we can now define these tests.&lt;/p&gt;
&lt;p&gt;In the Customize dialog, highlight &lt;i&gt;ENGINEERING User&lt;/i&gt; in the Tasks pane, and note the available properties in the Tool Container.&amp;nbsp; Since there is no Show/Hide test, add one via the right click menu. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2260.Add-test.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Select the drop-down of the new Show/Hide test item and choose &lt;i&gt;MyCity ENGINEERING&lt;/i&gt; from the pop-up dialog.&amp;nbsp; At this time you may also want to click the Test button to ensure it returns True.&amp;nbsp; (Remember, your active user workspace is ENGINEERING therefore MyCity_ENG = 1.)&lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/8468.showhidepick.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Do the same for the &lt;i&gt;FACILITIES User&lt;/i&gt; task. Choose &lt;i&gt;MyCity FACILITIES&lt;/i&gt; from the available named expressions and verify that the test returns False.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;You&amp;#39;ll also notice that the FACILITIES User task has now been removed from the Tasks dialog on the interface!&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 8:&amp;nbsp; Test &lt;/b&gt;&lt;/p&gt;
&lt;p&gt;To further test this, close MicroStation and change the workspace to FACILITIES/MyCity.&amp;nbsp; Open any file and notice that you only have the FACILITIES User in the task dialog.&lt;/p&gt;
&lt;p&gt;Close MicroStation and change the workspace to ENGINEERING/MyCity.&amp;nbsp; This time, only the ENGINEERING User task is made available in the interface. &lt;/p&gt;
&lt;p&gt;The obvious benefit of the method is that CAD Administrators can maintain a single DGNLIB for all customizations and simply use Named Expressions to turn on or off tasks.&amp;nbsp; &amp;nbsp;In this case, we used a simple configuration variable to drive the show/hide test.&lt;/p&gt;
&lt;p&gt;The following content explores how to add the ENGINEERING User and FACILITIES User to the right click menu.&amp;nbsp; Since this customization will also use a Show/Hide test based on the named expressions, the right click menu will change its content based upon the active workspace. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 9:&amp;nbsp; Add ENGINEERING and FACILITIES to right-click &amp;nbsp;menu&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Using either the Engineering or Facilities workspace, and the MyCity project, re-open the UI dgnlib and navigate back to the customize dialog.&lt;/p&gt;
&lt;p&gt;Then go to the &lt;i&gt;Context Menus &lt;/i&gt;pane and add two new items, one for ENGINEERING and the other for FACILITIES.&amp;nbsp; Add the appropriate Show/Hide Test and finally populate the items with the desired user tools as shown.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/4426.Context-Menu.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Testing this is going to produce similar results to the tasks.&amp;nbsp; When the workspace is set to ENGINEERING/MyCity, the right-click menu will show the ENGINEERING User content, and when the workspace is set to FACILITIES/MyCity, it flip for the FACILITIES User.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2046.rightclickeng.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 10:&amp;nbsp; Add Switch User item to the right-click menu&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;As a final touch to the right-click menu, let&amp;#39;s add a Switch User item that performs the following tasks:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Show tasks from both the engineering and facilities users.&lt;/li&gt;
&lt;li&gt;Show only the ENGINEERING User tasks.&lt;/li&gt;
&lt;li&gt;Show only the FACILITIES User tasks&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/1273.bonus.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This can be very useful for those users who are not running the ENGINEERING or FACILITIES workspace.&amp;nbsp; For example, perhaps there&amp;#39;s a &lt;em&gt;CAD&amp;nbsp;&lt;/em&gt; workspace that needs access to all items of both interfaces. &lt;/p&gt;
&lt;p&gt;To start, create a new user workspace called &lt;em&gt;CAD&amp;nbsp;&lt;/em&gt;and open the UI dgnlib that contains the interface items for both ENGINEERING and FACILITIES.&amp;nbsp;&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/5078.cad.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;There&amp;#39;s no need to set any variables in the UCF file since this will be done by utilizing the &lt;em&gt;expand set&lt;/em&gt; MicroStation keyin.&lt;/p&gt;
&lt;p&gt;Navigate to the Customize dialog,&amp;nbsp;and add a new menu called &lt;i&gt;Switch User &lt;/i&gt;in the Context Menu.&amp;nbsp; Then add three menu items that execute the following MicroStation key ins:&amp;nbsp; &lt;/p&gt;
&lt;p&gt;Show Both Users:&amp;nbsp; &lt;em&gt;expand set MYCITY_ENG = 1;expand set MYCITY_FAC = 1;task reload&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;ENGINEERING:&amp;nbsp; &lt;em&gt;expand set MYCITY_ENG = 1;expand set MYCITY_FAC = 2;task reload&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;FACILITIES:&amp;nbsp; &lt;em&gt;expand set MYCITY_ENG = 2;expand set MYCITY_FAC = 1;task reload&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2465._3B00_lk.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;To finish this off, let&amp;#39;s take a quick look at the keyins:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Expand set&lt;/em&gt; sets a temporary configuration variable for the active design session.&amp;nbsp; Remember, the CAD user does not have MYCITY_ENG or MYCITY_FAC defined in the UCF file.&amp;nbsp;&amp;nbsp;Note that this is an excellent example of&amp;nbsp;using the&amp;nbsp; &lt;em&gt;expand set &lt;/em&gt;keyin to set a variable that&amp;#39;s not defined elsewhere.&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Task reload&lt;/em&gt;, does exactly what it implies - it reloads all of the tasks.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This tutorial is only a small sampling of what can be done with named expressions, and with a little curiosity and creativity the possibilities are seemingly endless.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;Thanks for reading and have fun!&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Sample files: &lt;/p&gt;
&lt;p&gt;&lt;a href="/communities/other_communities/askinga/m/askinga-files/149094/download.aspx"&gt;http://communities.bentley.com/communities/other_communities/askinga/m/askinga-files/149094/download.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Related Link:&lt;/p&gt;
&lt;p&gt;&lt;a href="/communities/other_communities/askinga/w/askinga/set-temporary-variables-with-the-expand-set-keyin.aspx"&gt;http://communities.bentley.com/communities/other_communities/askinga/w/askinga/set-temporary-variables-with-the-expand-set-keyin.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;
</description></item><item><title>Using Named Expressions to drive interface items – A sample	</title><link>https://communities.bentley.com/products/microstation/w/askinga/4541/using-named-expressions-to-drive-interface-items-a-sample/revision/20</link><pubDate>Wed, 03 Nov 2010 15:37:16 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:5bae2907-f0ef-4c23-8c9a-213531402e1d</guid><dc:creator>Inga Morozoff</dc:creator><comments>https://communities.bentley.com/products/microstation/w/askinga/4541/using-named-expressions-to-drive-interface-items-a-sample#comments</comments><description>Revision 20 posted to [Archived] AskInga Wiki by Inga Morozoff on 11/3/2010 3:37:16 PM&lt;br /&gt;
&lt;p&gt;&lt;img height="76" width="230" src="/askIngaPics/askingalogo.gif" alt="AskInga logo" border="0" title="AskInga" /&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Using Named Expressions to drive interface items - A Sample&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;With thanks to Bentley&amp;#39;s &lt;a href="/members/sam-hendrick/default.aspx"&gt;Sam Hendrick&lt;/a&gt; for this article suggestion and content.&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;By now you&amp;#39;ve heard and read about &lt;i&gt;Named Expressions&lt;/i&gt;, but might not have had the inspiration to experiment with them.&amp;nbsp; If this describes you, then the following tutorial might be just what you need to kick-start your learning and exploration of Named Expressions.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Named expressions can be used with the Customize utility to perform the following tasks:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;define rules that control when a tool is available, &lt;/li&gt;
&lt;li&gt;define rules to control when a task is available and to ,&lt;/li&gt;
&lt;li&gt;define rules for right-click context menus, such as conditions under which a context menu item is hidden.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;nbsp;Knowing this, we&amp;#39;ll use a couple of named expressions to load a different user interface depending upon the value of configuration variables defined in a pair UCF files:&lt;/p&gt;
&lt;p&gt;&lt;a href="http://communities.bentley.com/cfs-file.ashx/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/1222.Named-Expressions.mp4"&gt;communities.bentley.com/.../1222.Named-Expressions.mp4&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;The following instructions can be used as a guide to work through this tutorial.&amp;nbsp; Of course this is just a sample workflow, what you employ to create your customized interface may differ.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 1:&amp;nbsp; Create two UCFs and one PCF&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Using the File Open dialog, or what us old-timers still call the MicroStation Manager dialog, create two new users and one new project.&amp;nbsp; In this example, I&amp;#39;m using ENGINEERING and FACILITIES as the users and MyCity as the project.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/3554.new-user.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;From there you can locate and open each of the UCF files and add a couple of new variables which will be used by the named expressions to drive the interface items.&amp;nbsp; In this example, MYCITY_ENG is for the Engineering user and MYCITY_FAC is for the facilities user.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 2:&amp;nbsp; Define variables &lt;/b&gt;&lt;/p&gt;
&lt;p&gt;In the UCF file for the Engineering, we define MYCITY_ENG=1 and MYCITY_FAC=2 while the variables for the facilities user would be the exact opposite (MYCITY_ENG=2 and MYCITY_FAC=1).&amp;nbsp; Note, setting a variable to 1 is True, and when setting it to any value other than 1 is recognized as &amp;quot;False&amp;quot; when dealing with named expressions.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/0081.facucf.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 3:&amp;nbsp; Create named expressions&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Back in the MicroStation Manager, navigate to the DGNLIB folder and create a new file to hold the named expression definitions.&amp;nbsp; Note that this is optional, if you prefer you can add them to any dgnlib that&amp;#39;s in a location pointed to by MS_DGNLIBLIST.&lt;/p&gt;
&lt;p&gt;In the File Open dialog, ensure that you&amp;#39;re set to the new ENGINEERING user and the MyCity project.&amp;nbsp; Then open the dgnlib that will hold the named expressions and select &lt;i&gt;Utilities &amp;gt; Named Expressions&lt;/i&gt;.&amp;nbsp; The resulting dialog is used to define and manage named expressions in the active DGN library.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2538.Named-Expresssion-dialog.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The next step is to create two named expressions that test for the presence of the variables created above.&amp;nbsp; To do that, click on the New button and enter the following information.&lt;/p&gt;
&lt;p&gt;Internal Name - sets the name of the named expression:&amp;nbsp; MyCity_ENG&lt;/p&gt;
&lt;p&gt;External Name - sets the text label that appears in the user interface to describe the test that will be applied when evaluating the named expression:&amp;nbsp; &lt;em&gt;MyCity ENGINEERING &lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Description:&amp;nbsp;&lt;em&gt; Is this user in Engineering Services?&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Keywords - enables the named expression to be used in specific areas:&amp;nbsp;&lt;em&gt; File, Task, Tool, User Interface&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Symbol Sets - defines the values and properties of the named expression:&amp;nbsp; &lt;em&gt;ConfigVar&lt;/em&gt; &lt;/p&gt;
&lt;p&gt;Expression - is the text string that&amp;#39;s to be evaluated. The expression is a single-line statement that contains symbols and operators: &amp;nbsp;&amp;nbsp;&lt;em&gt;ConfigVar.GetExpandedConfigVar(&amp;quot;MYCITY_ENG&amp;quot;)=1&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 4:&amp;nbsp; Test expressions&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Since you&amp;#39;re using the ENGINEERING workspace, the test button should return &lt;i&gt;True.&amp;nbsp; &lt;/i&gt;This makes sense since the variable MyCity_ENG is set to 1 in the UCF file.&amp;nbsp; This named expression will be used to control the display an ENGEERING User task that will be created in the next section.&lt;/p&gt;
&lt;p&gt;You can repeat these steps to create a second named expression for MyCity_FAC.&amp;nbsp; Testing this variable returns false since the variable is not set to 1.&amp;nbsp; This named expression will be used to control the display of a FACILITIES User task that will be created later.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/0116.fale.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;To determine what the expression should be, select &lt;i&gt;Utilities &amp;gt; Report Symbols &lt;/i&gt;which opens expression_symbols.html in your browser.&amp;nbsp;&amp;nbsp; This is an index of available expression symbols that includes information such as the syntax to use, the description and an example.&amp;nbsp; The symbol being used in this exercise is &lt;i&gt;ConfigVar, &lt;/i&gt;which has four available expressions&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;ExpandConfigVar - returns string where all MicroStation configuration variables are expanded.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;GetExpandedConfigVar - returns the expanded variable.&lt;/p&gt;
&lt;p&gt;GetUnexpandedConfigVar - returns unexpanded variables.&lt;/p&gt;
&lt;p&gt;IsConfigVarDefined - returns true if the variable is defined.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;The named expressions can now be used for creating a show/hide test for tasks, tools, and other interface items.&amp;nbsp;&amp;nbsp; In this tutorial we&amp;#39;ll be creating two tasks:&lt;/p&gt;
&lt;p&gt;&lt;i&gt;ENGINEERING User&lt;/i&gt; which contains specific tasks for Engineering Services users, and&lt;/p&gt;
&lt;p&gt;&lt;i&gt;FACILITIES User&lt;/i&gt; which contains tasks for the Facility Maintenance users.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;The availability of these tasks will be driven by a Show/Hide test using the named expressions created earlier.&amp;nbsp; Let&amp;#39;s take a closer look.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 5:&amp;nbsp; Create UI dgnlib&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Start by creating a new DGN library to hold the interface customizations.&amp;nbsp; You&amp;#39;ll want to put this file in the projects .../dgnlib/ folder so it will be found by MS_DGNLIBLIST. &amp;nbsp;Note that this is defined at the project level, so all customizations in this dgnlib file will be read by all user workspaces using this project.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 6:&amp;nbsp; Create user tools and tasks&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Once open, navigate to the Customize dialog and create several new tool boxes under User Tools.&amp;nbsp; In this example, I created the following tool boxes and populated them with relevant tools:&amp;nbsp;&lt;em&gt; Annotation, Display, Draw, Measure, Modify, and Publishing.&amp;nbsp; &amp;nbsp;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/6740.User-Tools.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Once the User Tools have been created, go to the &lt;i&gt;Tasks&lt;/i&gt; pane and create a new task called &lt;i&gt;ENGINEERING User&lt;/i&gt;.&amp;nbsp; You can then populate this task with some or all of the user tools created above.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;Likewise, create a new task called &lt;i&gt;FACILITIES User&lt;/i&gt; and populate this task with some of the user tools.&amp;nbsp; &amp;nbsp;&amp;nbsp;Since MicroStation builds the interface on-the-fly, you can easily verify your UI design as you go. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/5504.fac.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 7:&amp;nbsp; Add Show/Hide test&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Tasks and workflows have a variety of properties that are defined in the Tool Container pane of the Customize dialog.&amp;nbsp; One of available properties is a &lt;i&gt;Show/Hide Test&lt;/i&gt; which determines whether the item is displayed in the Tasks dialog.&amp;nbsp; The tests are based on named expressions, and since we&amp;#39;ve already created those in Step 3, we can now define these tests.&lt;/p&gt;
&lt;p&gt;In the Customize dialog, highlight &lt;i&gt;ENGINEERING User&lt;/i&gt; in the Tasks pane, and note the available properties in the Tool Container.&amp;nbsp; Since there is no Show/Hide test, add one via the right click menu. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2260.Add-test.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Select the drop-down of the new Show/Hide test item and choose &lt;i&gt;MyCity ENGINEERING&lt;/i&gt; from the pop-up dialog.&amp;nbsp; At this time you may also want to click the Test button to ensure it returns True.&amp;nbsp; (Remember, your active user workspace is ENGINEERING therefore MyCity_ENG = 1.)&lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/8468.showhidepick.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Do the same for the &lt;i&gt;FACILITIES User&lt;/i&gt; task. Choose &lt;i&gt;MyCity FACILITIES&lt;/i&gt; from the available named expressions and verify that the test returns False.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;You&amp;#39;ll also notice that the FACILITIES User task has now been removed from the Tasks dialog on the interface!&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 8:&amp;nbsp; Test &lt;/b&gt;&lt;/p&gt;
&lt;p&gt;To further test this, close MicroStation and change the workspace to FACILITIES/MyCity.&amp;nbsp; Open any file and notice that you only have the FACILITIES User in the task dialog.&lt;/p&gt;
&lt;p&gt;Close MicroStation and change the workspace to ENGINEERING/MyCity.&amp;nbsp; This time, only the ENGINEERING User task is made available in the interface. &lt;/p&gt;
&lt;p&gt;The obvious benefit of the method is that CAD Administrators can maintain a single DGNLIB for all customizations and simply use Named Expressions to turn on or off tasks.&amp;nbsp; &amp;nbsp;In this case, we used a simple configuration variable to drive the show/hide test.&lt;/p&gt;
&lt;p&gt;The following content explores how to add the ENGINEERING User and FACILITIES User to the right click menu.&amp;nbsp; Since this customization will also use a Show/Hide test based on the named expressions, the right click menu will change its content based upon the active workspace. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 9:&amp;nbsp; Add ENGINEERING and FACILITIES to right-click &amp;nbsp;menu&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Using either the Engineering or Facilities workspace, and the MyCity project, re-open the UI dgnlib and navigate back to the customize dialog.&lt;/p&gt;
&lt;p&gt;Then go to the &lt;i&gt;Context Menus &lt;/i&gt;pane and add two new items, one for ENGINEERING and the other for FACILITIES.&amp;nbsp; Add the appropriate Show/Hide Test and finally populate the items with the desired user tools as shown.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/4426.Context-Menu.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Testing this is going to produce similar results to the tasks.&amp;nbsp; When the workspace is set to ENGINEERING/MyCity, the right-click menu will show the ENGINEERING User content, and when the workspace is set to FACILITIES/MyCity, it flip for the FACILITIES User.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2046.rightclickeng.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 10:&amp;nbsp; Add Switch User item to the right-click menu&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;As a final touch to the right-click menu, let&amp;#39;s add a Switch User item that performs the following tasks:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Show tasks from both the engineering and facilities users.&lt;/li&gt;
&lt;li&gt;Show only the ENGINEERING User tasks.&lt;/li&gt;
&lt;li&gt;Show only the FACILITIES User tasks&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/1273.bonus.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This can be very useful for those users who are not running the ENGINEERING or FACILITIES workspace.&amp;nbsp; For example, perhaps there&amp;#39;s a &lt;em&gt;CAD&amp;nbsp;&lt;/em&gt; workspace that needs access to all items of both interfaces. &lt;/p&gt;
&lt;p&gt;To start, create a new user workspace called &lt;em&gt;CAD&amp;nbsp;&lt;/em&gt;and open the UI dgnlib that contains the interface items for both ENGINEERING and FACILITIES.&amp;nbsp;&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/5078.cad.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;There&amp;#39;s no need to set any variables in the UCF file since this will be done by utilizing the &lt;em&gt;expand set&lt;/em&gt; MicroStation keyin.&lt;/p&gt;
&lt;p&gt;Navigate to the Customize dialog,&amp;nbsp;and add a new menu called &lt;i&gt;Switch User &lt;/i&gt;in the Context Menu.&amp;nbsp; Then add three menu items that execute the following MicroStation key ins:&amp;nbsp; &lt;/p&gt;
&lt;p&gt;Show Both Users:&amp;nbsp; &lt;em&gt;expand set MYCITY_ENG = 1;expand set MYCITY_FAC = 1;task reload&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;ENGINEERING:&amp;nbsp; &lt;em&gt;expand set MYCITY_ENG = 1;expand set MYCITY_FAC = 2;task reload&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;FACILITIES:&amp;nbsp; &lt;em&gt;expand set MYCITY_ENG = 2;expand set MYCITY_FAC = 1;task reload&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2465._3B00_lk.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;To finish this off, let&amp;#39;s take a quick look at the keyins:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Expand set&lt;/em&gt; sets a temporary configuration variable for the active design session.&amp;nbsp; Remember, the CAD user does not have MYCITY_ENG or MYCITY_FAC defined in the UCF file.&amp;nbsp;&amp;nbsp;Note that this is an excellent example of&amp;nbsp;using the&amp;nbsp; &lt;em&gt;expand set &lt;/em&gt;keyin to set a variable that&amp;#39;s not defined elsewhere.&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Task reload&lt;/em&gt;, does exactly what it implies - it reloads all of the tasks.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This tutorial is only a small sampling of what can be done with named expressions, and with a little curiosity and creativity the possibilities are seemingly endless.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;Thanks for reading and have fun!&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Sample files: &lt;/p&gt;
&lt;p&gt;&lt;a href="/communities/other_communities/askinga/m/askinga-files/149094/download.aspx"&gt;http://communities.bentley.com/communities/other_communities/askinga/m/askinga-files/149094/download.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Related Link:&lt;/p&gt;
&lt;p&gt;&lt;a href="/communities/other_communities/askinga/w/askinga/set-temporary-variables-with-the-expand-set-keyin.aspx"&gt;http://communities.bentley.com/communities/other_communities/askinga/w/askinga/set-temporary-variables-with-the-expand-set-keyin.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;
</description></item><item><title>Using Named Expressions to drive interface items – A sample	</title><link>https://communities.bentley.com/products/microstation/w/askinga/4541/using-named-expressions-to-drive-interface-items-a-sample/revision/19</link><pubDate>Wed, 03 Nov 2010 15:07:00 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:5bae2907-f0ef-4c23-8c9a-213531402e1d</guid><dc:creator>Inga Morozoff</dc:creator><comments>https://communities.bentley.com/products/microstation/w/askinga/4541/using-named-expressions-to-drive-interface-items-a-sample#comments</comments><description>Revision 19 posted to [Archived] AskInga Wiki by Inga Morozoff on 11/3/2010 3:07:00 PM&lt;br /&gt;
&lt;p&gt;&lt;img height="76" width="230" src="/askIngaPics/askingalogo.gif" alt="AskInga logo" border="0" title="AskInga" /&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Using Named Expressions to drive interface items - A Sample&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;With thanks to Bentley&amp;#39;s &lt;a href="/members/sam-hendrick/default.aspx"&gt;Sam Hendrick&lt;/a&gt; for this article suggestion and content.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;By now you&amp;#39;ve heard and read about &lt;i&gt;Named Expressions&lt;/i&gt;, but might not have had the inspiration to experiment with them.&amp;nbsp; If this describes you, then the following tutorial might be just what you need to kick-start your learning and exploration of Named Expressions.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Named expressions can be used with the Customize utility to perform the following tasks:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;define rules that control when a tool is available, &lt;/li&gt;
&lt;li&gt;define rules to control when a task is available and to ,&lt;/li&gt;
&lt;li&gt;define rules for right-click context menus, such as conditions under which a context menu item is hidden.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;nbsp;Knowing this, we&amp;#39;ll use a couple of named expressions to load a different user interface depending upon the value of configuration variables defined in a pair UCF files &lt;/p&gt;
&lt;p&gt;&amp;nbsp;The following instructions can be used as a guide to work through this tutorial.&amp;nbsp; Of course this is just a sample workflow, what you employ to create your customized interface may differ.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 1:&amp;nbsp; Create two UCFs and one PCF&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Using the File Open dialog, or what us old-timers still call the MicroStation Manager dialog, create two new users and one new project.&amp;nbsp; In this example, I&amp;#39;m using ENGINEERING and FACILITIES as the users and MyCity as the project.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/3554.new-user.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;From there you can locate and open each of the UCF files and add a couple of new variables which will be used by the named expressions to drive the interface items.&amp;nbsp; In this example, MYCITY_ENG is for the Engineering user and MYCITY_FAC is for the facilities user.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 2:&amp;nbsp; Define variables &lt;/b&gt;&lt;/p&gt;
&lt;p&gt;In the UCF file for the Engineering, we define MYCITY_ENG=1 and MYCITY_FAC=2 while the variables for the facilities user would be the exact opposite (MYCITY_ENG=2 and MYCITY_FAC=1).&amp;nbsp; Note, setting a variable to 1 is True, and when setting it to any value other than 1 is recognized as &amp;quot;False&amp;quot; when dealing with named expressions.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/0081.facucf.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 3:&amp;nbsp; Create named expressions&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Back in the MicroStation Manager, navigate to the DGNLIB folder and create a new file to hold the named expression definitions.&amp;nbsp; Note that this is optional, if you prefer you can add them to any dgnlib that&amp;#39;s in a location pointed to by MS_DGNLIBLIST.&lt;/p&gt;
&lt;p&gt;In the File Open dialog, ensure that you&amp;#39;re set to the new ENGINEERING user and the MyCity project.&amp;nbsp; Then open the dgnlib that will hold the named expressions and select &lt;i&gt;Utilities &amp;gt; Named Expressions&lt;/i&gt;.&amp;nbsp; The resulting dialog is used to define and manage named expressions in the active DGN library.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2538.Named-Expresssion-dialog.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The next step is to create two named expressions that test for the presence of the variables created above.&amp;nbsp; To do that, click on the New button and enter the following information.&lt;/p&gt;
&lt;p&gt;Internal Name - sets the name of the named expression:&amp;nbsp; MyCity_ENG&lt;/p&gt;
&lt;p&gt;External Name - sets the text label that appears in the user interface to describe the test that will be applied when evaluating the named expression:&amp;nbsp; &lt;em&gt;MyCity ENGINEERING &lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Description:&amp;nbsp;&lt;em&gt; Is this user in Engineering Services?&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Keywords - enables the named expression to be used in specific areas:&amp;nbsp;&lt;em&gt; File, Task, Tool, User Interface&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Symbol Sets - defines the values and properties of the named expression:&amp;nbsp; &lt;em&gt;ConfigVar&lt;/em&gt; &lt;/p&gt;
&lt;p&gt;Expression - is the text string that&amp;#39;s to be evaluated. The expression is a single-line statement that contains symbols and operators: &amp;nbsp;&amp;nbsp;&lt;em&gt;ConfigVar.GetExpandedConfigVar(&amp;quot;MYCITY_ENG&amp;quot;)=1&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 4:&amp;nbsp; Test expressions&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Since you&amp;#39;re using the ENGINEERING workspace, the test button should return &lt;i&gt;True.&amp;nbsp; &lt;/i&gt;This makes sense since the variable MyCity_ENG is set to 1 in the UCF file.&amp;nbsp; This named expression will be used to control the display an ENGEERING User task that will be created in the next section.&lt;/p&gt;
&lt;p&gt;You can repeat these steps to create a second named expression for MyCity_FAC.&amp;nbsp; Testing this variable returns false since the variable is not set to 1.&amp;nbsp; This named expression will be used to control the display of a FACILITIES User task that will be created later.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/0116.fale.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;To determine what the expression should be, select &lt;i&gt;Utilities &amp;gt; Report Symbols &lt;/i&gt;which opens expression_symbols.html in your browser.&amp;nbsp;&amp;nbsp; This is an index of available expression symbols that includes information such as the syntax to use, the description and an example.&amp;nbsp; The symbol being used in this exercise is &lt;i&gt;ConfigVar, &lt;/i&gt;which has four available expressions&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;ExpandConfigVar - returns string where all MicroStation configuration variables are expanded.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;GetExpandedConfigVar - returns the expanded variable.&lt;/p&gt;
&lt;p&gt;GetUnexpandedConfigVar - returns unexpanded variables.&lt;/p&gt;
&lt;p&gt;IsConfigVarDefined - returns true if the variable is defined.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;The named expressions can now be used for creating a show/hide test for tasks, tools, and other interface items.&amp;nbsp;&amp;nbsp; In this tutorial we&amp;#39;ll be creating two tasks:&lt;/p&gt;
&lt;p&gt;&lt;i&gt;ENGINEERING User&lt;/i&gt; which contains specific tasks for Engineering Services users, and&lt;/p&gt;
&lt;p&gt;&lt;i&gt;FACILITIES User&lt;/i&gt; which contains tasks for the Facility Maintenance users.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;The availability of these tasks will be driven by a Show/Hide test using the named expressions created earlier.&amp;nbsp; Let&amp;#39;s take a closer look.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 5:&amp;nbsp; Create UI dgnlib&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Start by creating a new DGN library to hold the interface customizations.&amp;nbsp; You&amp;#39;ll want to put this file in the projects .../dgnlib/ folder so it will be found by MS_DGNLIBLIST. &amp;nbsp;Note that this is defined at the project level, so all customizations in this dgnlib file will be read by all user workspaces using this project.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 6:&amp;nbsp; Create user tools and tasks&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Once open, navigate to the Customize dialog and create several new tool boxes under User Tools.&amp;nbsp; In this example, I created the following tool boxes and populated them with relevant tools:&amp;nbsp;&lt;em&gt; Annotation, Display, Draw, Measure, Modify, and Publishing.&amp;nbsp; &amp;nbsp;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/6740.User-Tools.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Once the User Tools have been created, go to the &lt;i&gt;Tasks&lt;/i&gt; pane and create a new task called &lt;i&gt;ENGINEERING User&lt;/i&gt;.&amp;nbsp; You can then populate this task with some or all of the user tools created above.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;Likewise, create a new task called &lt;i&gt;FACILITIES User&lt;/i&gt; and populate this task with some of the user tools.&amp;nbsp; &amp;nbsp;&amp;nbsp;Since MicroStation builds the interface on-the-fly, you can easily verify your UI design as you go. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/5504.fac.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 7:&amp;nbsp; Add Show/Hide test&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Tasks and workflows have a variety of properties that are defined in the Tool Container pane of the Customize dialog.&amp;nbsp; One of available properties is a &lt;i&gt;Show/Hide Test&lt;/i&gt; which determines whether the item is displayed in the Tasks dialog.&amp;nbsp; The tests are based on named expressions, and since we&amp;#39;ve already created those in Step 3, we can now define these tests.&lt;/p&gt;
&lt;p&gt;In the Customize dialog, highlight &lt;i&gt;ENGINEERING User&lt;/i&gt; in the Tasks pane, and note the available properties in the Tool Container.&amp;nbsp; Since there is no Show/Hide test, add one via the right click menu. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2260.Add-test.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Select the drop-down of the new Show/Hide test item and choose &lt;i&gt;MyCity ENGINEERING&lt;/i&gt; from the pop-up dialog.&amp;nbsp; At this time you may also want to click the Test button to ensure it returns True.&amp;nbsp; (Remember, your active user workspace is ENGINEERING therefore MyCity_ENG = 1.)&lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/8468.showhidepick.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Do the same for the &lt;i&gt;FACILITIES User&lt;/i&gt; task. Choose &lt;i&gt;MyCity FACILITIES&lt;/i&gt; from the available named expressions and verify that the test returns False.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;You&amp;#39;ll also notice that the FACILITIES User task has now been removed from the Tasks dialog on the interface!&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 8:&amp;nbsp; Test &lt;/b&gt;&lt;/p&gt;
&lt;p&gt;To further test this, close MicroStation and change the workspace to FACILITIES/MyCity.&amp;nbsp; Open any file and notice that you only have the FACILITIES User in the task dialog.&lt;/p&gt;
&lt;p&gt;Close MicroStation and change the workspace to ENGINEERING/MyCity.&amp;nbsp; This time, only the ENGINEERING User task is made available in the interface. &lt;/p&gt;
&lt;p&gt;The obvious benefit of the method is that CAD Administrators can maintain a single DGNLIB for all customizations and simply use Named Expressions to turn on or off tasks.&amp;nbsp; &amp;nbsp;In this case, we used a simple configuration variable to drive the show/hide test.&lt;/p&gt;
&lt;p&gt;The following content explores how to add the ENGINEERING User and FACILITIES User to the right click menu.&amp;nbsp; Since this customization will also use a Show/Hide test based on the named expressions, the right click menu will change its content based upon the active workspace. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 9:&amp;nbsp; Add ENGINEERING and FACILITIES to right-click &amp;nbsp;menu&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Using either the Engineering or Facilities workspace, and the MyCity project, re-open the UI dgnlib and navigate back to the customize dialog.&lt;/p&gt;
&lt;p&gt;Then go to the &lt;i&gt;Context Menus &lt;/i&gt;pane and add two new items, one for ENGINEERING and the other for FACILITIES.&amp;nbsp; Add the appropriate Show/Hide Test and finally populate the items with the desired user tools as shown.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/4426.Context-Menu.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Testing this is going to produce similar results to the tasks.&amp;nbsp; When the workspace is set to ENGINEERING/MyCity, the right-click menu will show the ENGINEERING User content, and when the workspace is set to FACILITIES/MyCity, it flip for the FACILITIES User.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2046.rightclickeng.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 10:&amp;nbsp; Add Switch User item to the right-click menu&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;As a final touch to the right-click menu, let&amp;#39;s add a Switch User item that performs the following tasks:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Show tasks from both the engineering and facilities users.&lt;/li&gt;
&lt;li&gt;Show only the ENGINEERING User tasks.&lt;/li&gt;
&lt;li&gt;Show only the FACILITIES User tasks&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/1273.bonus.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This can be very useful for those users who are not running the ENGINEERING or FACILITIES workspace.&amp;nbsp; For example, perhaps there&amp;#39;s a &lt;em&gt;CAD&amp;nbsp;&lt;/em&gt; workspace that needs access to all items of both interfaces. &lt;/p&gt;
&lt;p&gt;To start, create a new user workspace called &lt;em&gt;CAD&amp;nbsp;&lt;/em&gt;and open the UI dgnlib that contains the interface items for both ENGINEERING and FACILITIES.&amp;nbsp;&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/5078.cad.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;There&amp;#39;s no need to set any variables in the UCF file since this will be done by utilizing the &lt;em&gt;expand set&lt;/em&gt; MicroStation keyin.&lt;/p&gt;
&lt;p&gt;Navigate to the Customize dialog,&amp;nbsp;and add a new menu called &lt;i&gt;Switch User &lt;/i&gt;in the Context Menu.&amp;nbsp; Then add three menu items that execute the following MicroStation key ins:&amp;nbsp; &lt;/p&gt;
&lt;p&gt;Show Both Users:&amp;nbsp; &lt;em&gt;expand set MYCITY_ENG = 1;expand set MYCITY_FAC = 1;task reload&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;ENGINEERING:&amp;nbsp; &lt;em&gt;expand set MYCITY_ENG = 1;expand set MYCITY_FAC = 2;task reload&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;FACILITIES:&amp;nbsp; &lt;em&gt;expand set MYCITY_ENG = 2;expand set MYCITY_FAC = 1;task reload&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2465._3B00_lk.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;To finish this off, let&amp;#39;s take a quick look at the keyins:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Expand set&lt;/em&gt; sets a temporary configuration variable for the active design session.&amp;nbsp; Remember, the CAD user does not have MYCITY_ENG or MYCITY_FAC defined in the UCF file.&amp;nbsp;&amp;nbsp;Note that this is an excellent example of&amp;nbsp;using the&amp;nbsp; &lt;em&gt;expand set &lt;/em&gt;keyin to set a variable that&amp;#39;s not defined elsewhere.&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Task reload&lt;/em&gt;, does exactly what it implies - it reloads all of the tasks.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This tutorial is only a small sampling of what can be done with named expressions, and with a little curiosity and creativity the possibilities are seemingly endless.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;Thanks for reading and have fun!&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Sample files: &lt;/p&gt;
&lt;p&gt;&lt;a href="/communities/other_communities/askinga/m/askinga-files/149094/download.aspx"&gt;http://communities.bentley.com/communities/other_communities/askinga/m/askinga-files/149094/download.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Related Link:&lt;/p&gt;
&lt;p&gt;&lt;a href="/communities/other_communities/askinga/w/askinga/set-temporary-variables-with-the-expand-set-keyin.aspx"&gt;http://communities.bentley.com/communities/other_communities/askinga/w/askinga/set-temporary-variables-with-the-expand-set-keyin.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;
</description></item><item><title>Using Named Expressions to drive interface items – A sample	</title><link>https://communities.bentley.com/products/microstation/w/askinga/4541/using-named-expressions-to-drive-interface-items-a-sample/revision/18</link><pubDate>Wed, 03 Nov 2010 14:40:12 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:5bae2907-f0ef-4c23-8c9a-213531402e1d</guid><dc:creator>Inga Morozoff</dc:creator><comments>https://communities.bentley.com/products/microstation/w/askinga/4541/using-named-expressions-to-drive-interface-items-a-sample#comments</comments><description>Revision 18 posted to [Archived] AskInga Wiki by Inga Morozoff on 11/3/2010 2:40:12 PM&lt;br /&gt;
&lt;p&gt;&lt;img height="76" width="230" src="/askIngaPics/askingalogo.gif" alt="AskInga logo" border="0" title="AskInga" /&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Using Named Expressions to drive interface items - A Sample&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;With thanks to Bentley&amp;#39;s &lt;a href="/members/sam-hendrick/default.aspx"&gt;Sam Hendrick&lt;/a&gt; for this article suggestion and content.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;By now you&amp;#39;ve heard and read about &lt;i&gt;Named Expressions&lt;/i&gt;, but might not have had the inspiration to experiment with them.&amp;nbsp; If this describes you, then the following tutorial might be just what you need to kick-start your learning and exploration of Named Expressions.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Named expressions can be used with the Customize utility to perform the following tasks:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;define rules that control when a tool is available, &lt;/li&gt;
&lt;li&gt;define rules to control when a task is available and to ,&lt;/li&gt;
&lt;li&gt;define rules for right-click context menus, such as conditions under which a context menu item is hidden.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;nbsp;Knowing this, we&amp;#39;ll use a couple of named expressions to load a different user interface depending upon the value of configuration variables defined in a pair UCF files &lt;/p&gt;
&lt;p&gt;&amp;nbsp;The following instructions can be used as a guide to work through this tutorial.&amp;nbsp; Of course this is just a sample workflow, what you employ to create your customized interface may differ.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 1:&amp;nbsp; Create two UCFs and one PCF&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Using the File Open dialog, or what us old-timers still call the MicroStation Manager dialog, create two new users and one new project.&amp;nbsp; In this example, I&amp;#39;m using ENGINEERING and FACILITIES as the users and MyCity as the project.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/3554.new-user.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;From there you can locate and open each of the UCF files and add a couple of new variables which will be used by the named expressions to drive the interface items.&amp;nbsp; In this example, MYCITY_ENG is for the Engineering user and MYCITY_FAC is for the facilities user.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 2:&amp;nbsp; Define variables &lt;/b&gt;&lt;/p&gt;
&lt;p&gt;In the UCF file for the Engineering, we define MYCITY_ENG=1 and MYCITY_FAC=2 while the variables for the facilities user would be the exact opposite (MYCITY_ENG=2 and MYCITY_FAC=1).&amp;nbsp; Note, setting a variable to 1 is True, and when setting it to any value other than 1 is recognized as &amp;quot;False&amp;quot; when dealing with named expressions.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/0081.facucf.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 3:&amp;nbsp; Create named expressions&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Back in the MicroStation Manager, navigate to the DGNLIB folder and create a new file to hold the named expression definitions.&amp;nbsp; Note that this is optional, if you prefer you can add them to any dgnlib that&amp;#39;s in a location pointed to by MS_DGNLIBLIST.&lt;/p&gt;
&lt;p&gt;In the File Open dialog, ensure that you&amp;#39;re set to the new ENGINEERING user and the MyCity project.&amp;nbsp; Then open the dgnlib that will hold the named expressions and select &lt;i&gt;Utilities &amp;gt; Named Expressions&lt;/i&gt;.&amp;nbsp; The resulting dialog is used to define and manage named expressions in the active DGN library.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2538.Named-Expresssion-dialog.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The next step is to create two named expressions that test for the presence of the variables created above.&amp;nbsp; To do that, click on the New button and enter the following information.&lt;/p&gt;
&lt;p&gt;Internal Name - sets the name of the named expression:&amp;nbsp; MyCity_ENG&lt;/p&gt;
&lt;p&gt;External Name - sets the text label that appears in the user interface to describe the test that will be applied when evaluating the named expression:&amp;nbsp; &lt;em&gt;MyCity ENGINEERING &lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Description:&amp;nbsp;&lt;em&gt; Is this user in Engineering Services?&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Keywords - enables the named expression to be used in specific areas:&amp;nbsp;&lt;em&gt; File, Task, Tool, User Interface&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Symbol Sets - defines the values and properties of the named expression:&amp;nbsp; &lt;em&gt;ConfigVar&lt;/em&gt; &lt;/p&gt;
&lt;p&gt;Expression - is the text string that&amp;#39;s to be evaluated. The expression is a single-line statement that contains symbols and operators: &amp;nbsp;&amp;nbsp;&lt;em&gt;ConfigVar.GetExpandedConfigVar(&amp;quot;MYCITY_ENG&amp;quot;)=1&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 4:&amp;nbsp; Test expressions&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Since you&amp;#39;re using the ENGINEERING workspace, the test button should return &lt;i&gt;True.&amp;nbsp; &lt;/i&gt;This makes sense since the variable MyCity_ENG is set to 1 in the UCF file.&amp;nbsp; This named expression will be used to control the display an ENGEERING User task that will be created in the next section.&lt;/p&gt;
&lt;p&gt;You can repeat these steps to create a second named expression for MyCity_FAC.&amp;nbsp; Testing this variable returns false since the variable is not set to 1.&amp;nbsp; This named expression will be used to control the display of a FACILITIES User task that will be created later.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/0116.fale.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;To determine what the expression should be, select &lt;i&gt;Utilities &amp;gt; Report Symbols &lt;/i&gt;which opens expression_symbols.html in your browser.&amp;nbsp;&amp;nbsp; This is an index of available expression symbols that includes information such as the syntax to use, the description and an example.&amp;nbsp; The symbol being used in this exercise is &lt;i&gt;ConfigVar, &lt;/i&gt;which has four available expressions&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;ExpandConfigVar - returns string where all MicroStation configuration variables are expanded.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;GetExpandedConfigVar - returns the expanded variable.&lt;/p&gt;
&lt;p&gt;GetUnexpandedConfigVar - returns unexpanded variables.&lt;/p&gt;
&lt;p&gt;IsConfigVarDefined - returns true if the variable is defined.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;The named expressions can now be used for creating a show/hide test for tasks, tools, and other interface items.&amp;nbsp;&amp;nbsp; In this tutorial we&amp;#39;ll be creating two tasks:&lt;/p&gt;
&lt;p&gt;&lt;i&gt;ENGINEERING User&lt;/i&gt; which contains specific tasks for Engineering Services users, and&lt;/p&gt;
&lt;p&gt;&lt;i&gt;FACILITIES User&lt;/i&gt; which contains tasks for the Facility Maintenance users.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;The availability of these tasks will be driven by a Show/Hide test using the named expressions created earlier.&amp;nbsp; Let&amp;#39;s take a closer look.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 5:&amp;nbsp; Create UI dgnlib&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Start by creating a new DGN library to hold the interface customizations.&amp;nbsp; You&amp;#39;ll want to put this file in the projects .../dgnlib/ folder so it will be found by MS_DGNLIBLIST. &amp;nbsp;Note that this is defined at the project level, so all customizations in this dgnlib file will be read by all user workspaces using this project.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 6:&amp;nbsp; Create user tools and tasks&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Once open, navigate to the Customize dialog and create several new tool boxes under User Tools.&amp;nbsp; In this example, I created the following tool boxes and populated them with relevant tools:&amp;nbsp;&lt;em&gt; Annotation, Display, Draw, Measure, Modify, and Publishing.&amp;nbsp; &amp;nbsp;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/6740.User-Tools.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Once the User Tools have been created, go to the &lt;i&gt;Tasks&lt;/i&gt; pane and create a new task called &lt;i&gt;ENGINEERING User&lt;/i&gt;.&amp;nbsp; You can then populate this task with some or all of the user tools created above.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;Likewise, create a new task called &lt;i&gt;FACILITIES User&lt;/i&gt; and populate this task with some of the user tools.&amp;nbsp; &amp;nbsp;&amp;nbsp;Since MicroStation builds the interface on-the-fly, you can easily verify your UI design as you go. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/5504.fac.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 7:&amp;nbsp; Add Show/Hide test&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Tasks and workflows have a variety of properties that are defined in the Tool Container pane of the Customize dialog.&amp;nbsp; One of available properties is a &lt;i&gt;Show/Hide Test&lt;/i&gt; which determines whether the item is displayed in the Tasks dialog.&amp;nbsp; The tests are based on named expressions, and since we&amp;#39;ve already created those in Step 3, we can now define these tests.&lt;/p&gt;
&lt;p&gt;In the Customize dialog, highlight &lt;i&gt;ENGINEERING User&lt;/i&gt; in the Tasks pane, and note the available properties in the Tool Container.&amp;nbsp; Since there is no Show/Hide test, add one via the right click menu. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2260.Add-test.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Select the drop-down of the new Show/Hide test item and choose &lt;i&gt;MyCity ENGINEERING&lt;/i&gt; from the pop-up dialog.&amp;nbsp; At this time you may also want to click the Test button to ensure it returns True.&amp;nbsp; (Remember, your active user workspace is ENGINEERING therefore MyCity_ENG = 1.)&lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/8468.showhidepick.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Do the same for the &lt;i&gt;FACILITIES User&lt;/i&gt; task. Choose &lt;i&gt;MyCity FACILITIES&lt;/i&gt; from the available named expressions and verify that the test returns False.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;You&amp;#39;ll also notice that the FACILITIES User task has now been removed from the Tasks dialog on the interface!&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 8:&amp;nbsp; Test &lt;/b&gt;&lt;/p&gt;
&lt;p&gt;To further test this, close MicroStation and change the workspace to FACILITIES/MyCity.&amp;nbsp; Open any file and notice that you only have the FACILITIES User in the task dialog.&lt;/p&gt;
&lt;p&gt;Close MicroStation and change the workspace to ENGINEERING/MyCity.&amp;nbsp; This time, only the ENGINEERING User task is made available in the interface. &lt;/p&gt;
&lt;p&gt;The obvious benefit of the method is that CAD Administrators can maintain a single DGNLIB for all customizations and simply use Named Expressions to turn on or off tasks.&amp;nbsp; &amp;nbsp;In this case, we used a simple configuration variable to drive the show/hide test.&lt;/p&gt;
&lt;p&gt;The following content explores how to add the ENGINEERING User and FACILITIES User to the right click menu.&amp;nbsp; Since this customization will also use a Show/Hide test based on the named expressions, the right click menu will change its content based upon the active workspace. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 9:&amp;nbsp; Add ENGINEERING and FACILITIES to right-click &amp;nbsp;menu&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Using either the Engineering or Facilities workspace, and the MyCity project, re-open the UI dgnlib and navigate back to the customize dialog.&lt;/p&gt;
&lt;p&gt;Then go to the &lt;i&gt;Context Menus &lt;/i&gt;pane and add two new items, one for ENGINEERING and the other for FACILITIES.&amp;nbsp; Add the appropriate Show/Hide Test and finally populate the items with the desired user tools as shown.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/4426.Context-Menu.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Testing this is going to produce similar results to the tasks.&amp;nbsp; When the workspace is set to ENGINEERING/MyCity, the right-click menu will show the ENGINEERING User content, and when the workspace is set to FACILITIES/MyCity, it flip for the FACILITIES User.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2046.rightclickeng.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 10:&amp;nbsp; Add Switch User item to the right-click menu&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;As a final touch to the right-click menu, let&amp;#39;s add a Switch User item that performs the following tasks:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Show tasks from both the engineering and facilities users.&lt;/li&gt;
&lt;li&gt;Show only the ENGINEERING User tasks.&lt;/li&gt;
&lt;li&gt;Show only the FACILITIES User tasks&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/1273.bonus.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;To do that, add a new menu called &lt;i&gt;Switch User &lt;/i&gt;in the Context Menu.&amp;nbsp; Then add three menu items that execute the following MicroStation key ins:&amp;nbsp; &lt;/p&gt;
&lt;p&gt;Show Both Users:&amp;nbsp; &lt;em&gt;expand set MYCITY_ENG = 1;expand set MYCITY_FAC = 1;task reload&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;ENGINEERING:&amp;nbsp; &lt;em&gt;expand set MYCITY_ENG = 1;expand set MYCITY_FAC = 2;task reload&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;FACILITIES:&amp;nbsp; &lt;em&gt;expand set MYCITY_ENG = 2;expand set MYCITY_FAC = 1;task reload&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2465._3B00_lk.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;To finish this off, let&amp;#39;s take a quick look at the keyins:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Expand set&lt;/em&gt; sets a temporary configuration variable for the active design session.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Task reload&lt;/em&gt;, does exactly what it implies - it reloads all of the tasks.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This tutorial is only a small sampling of what can be done with named expressions, and with a little curiosity and creativity the possibilities are seemingly endless.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;Thanks for reading and have fun!&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Sample files: &lt;/p&gt;
&lt;p&gt;&lt;a href="/communities/other_communities/askinga/m/askinga-files/149094/download.aspx"&gt;http://communities.bentley.com/communities/other_communities/askinga/m/askinga-files/149094/download.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Related Link:&lt;/p&gt;
&lt;p&gt;&lt;a href="/communities/other_communities/askinga/w/askinga/set-temporary-variables-with-the-expand-set-keyin.aspx"&gt;http://communities.bentley.com/communities/other_communities/askinga/w/askinga/set-temporary-variables-with-the-expand-set-keyin.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;
</description></item><item><title>Using Named Expressions to drive interface items – A sample	</title><link>https://communities.bentley.com/products/microstation/w/askinga/4541/using-named-expressions-to-drive-interface-items-a-sample/revision/17</link><pubDate>Tue, 02 Nov 2010 19:09:53 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:5bae2907-f0ef-4c23-8c9a-213531402e1d</guid><dc:creator>Inga Morozoff</dc:creator><comments>https://communities.bentley.com/products/microstation/w/askinga/4541/using-named-expressions-to-drive-interface-items-a-sample#comments</comments><description>Revision 17 posted to [Archived] AskInga Wiki by Inga Morozoff on 11/2/2010 7:09:53 PM&lt;br /&gt;
&lt;p&gt;&lt;img height="76" width="230" src="/askIngaPics/askingalogo.gif" alt="AskInga logo" border="0" title="AskInga" /&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Using Named Expressions to drive interface items - A Sample&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;With thanks to Bentley&amp;#39;s Sam Hendrick for this article suggestion and content.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;By now you&amp;#39;ve heard and read about &lt;i&gt;Named Expressions&lt;/i&gt;, but might not have had the inspiration to experiment with them.&amp;nbsp; If this describes you, then the following tutorial might be just what you need to kick-start your learning and exploration of Named Expressions.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Named expressions can be used with the Customize utility to perform the following tasks:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;define rules that control when a tool is available, &lt;/li&gt;
&lt;li&gt;define rules to control when a task is available and to ,&lt;/li&gt;
&lt;li&gt;define rules for right-click context menus, such as conditions under which a context menu item is hidden.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;nbsp;Knowing this, we&amp;#39;ll use a couple of named expressions to load a different user interface depending upon the value of configuration variables defined in a pair UCF files &lt;/p&gt;
&lt;p&gt;&amp;nbsp;The following instructions can be used as a guide to work through this tutorial.&amp;nbsp; Of course this is just a sample workflow, what you employ to create your customized interface may differ.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 1:&amp;nbsp; Create two UCFs and one PCF&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Using the File Open dialog, or what us old-timers still call the MicroStation Manager dialog, create two new users and one new project.&amp;nbsp; In this example, I&amp;#39;m using ENGINEERING and FACILITIES as the users and MyCity as the project.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/3554.new-user.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;From there you can locate and open each of the UCF files and add a couple of new variables which will be used by the named expressions to drive the interface items.&amp;nbsp; In this example, MYCITY_ENG is for the Engineering user and MYCITY_FAC is for the facilities user.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 2:&amp;nbsp; Define variables &lt;/b&gt;&lt;/p&gt;
&lt;p&gt;In the UCF file for the Engineering, we define MYCITY_ENG=1 and MYCITY_FAC=2 while the variables for the facilities user would be the exact opposite (MYCITY_ENG=2 and MYCITY_FAC=1).&amp;nbsp; Note, setting a variable to 1 is True, and when setting it to any value other than 1 is recognized as &amp;quot;False&amp;quot; when dealing with named expressions.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/0081.facucf.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 3:&amp;nbsp; Create named expressions&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Back in the MicroStation Manager, navigate to the DGNLIB folder and create a new file to hold the named expression definitions.&amp;nbsp; Note that this is optional, if you prefer you can add them to any dgnlib that&amp;#39;s in a location pointed to by MS_DGNLIBLIST.&lt;/p&gt;
&lt;p&gt;In the File Open dialog, ensure that you&amp;#39;re set to the new ENGINEERING user and the MyCity project.&amp;nbsp; Then open the dgnlib that will hold the named expressions and select &lt;i&gt;Utilities &amp;gt; Named Expressions&lt;/i&gt;.&amp;nbsp; The resulting dialog is used to define and manage named expressions in the active DGN library.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2538.Named-Expresssion-dialog.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The next step is to create two named expressions that test for the presence of the variables created above.&amp;nbsp; To do that, click on the New button and enter the following information.&lt;/p&gt;
&lt;p&gt;Internal Name - sets the name of the named expression:&amp;nbsp; MyCity_ENG&lt;/p&gt;
&lt;p&gt;External Name - sets the text label that appears in the user interface to describe the test that will be applied when evaluating the named expression:&amp;nbsp; &lt;em&gt;MyCity ENGINEERING &lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Description:&amp;nbsp;&lt;em&gt; Is this user in Engineering Services?&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Keywords - enables the named expression to be used in specific areas:&amp;nbsp;&lt;em&gt; File, Task, Tool, User Interface&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Symbol Sets - defines the values and properties of the named expression:&amp;nbsp; &lt;em&gt;ConfigVar&lt;/em&gt; &lt;/p&gt;
&lt;p&gt;Expression - is the text string that&amp;#39;s to be evaluated. The expression is a single-line statement that contains symbols and operators: &amp;nbsp;&amp;nbsp;&lt;em&gt;ConfigVar.GetExpandedConfigVar(&amp;quot;MYCITY_ENG&amp;quot;)=1&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 4:&amp;nbsp; Test expressions&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Since you&amp;#39;re using the ENGINEERING workspace, the test button should return &lt;i&gt;True.&amp;nbsp; &lt;/i&gt;This makes sense since the variable MyCity_ENG is set to 1 in the UCF file.&amp;nbsp; This named expression will be used to control the display an ENGEERING User task that will be created in the next section.&lt;/p&gt;
&lt;p&gt;You can repeat these steps to create a second named expression for MyCity_FAC.&amp;nbsp; Testing this variable returns false since the variable is not set to 1.&amp;nbsp; This named expression will be used to control the display of a FACILITIES User task that will be created later.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/0116.fale.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;To determine what the expression should be, select &lt;i&gt;Utilities &amp;gt; Report Symbols &lt;/i&gt;which opens expression_symbols.html in your browser.&amp;nbsp;&amp;nbsp; This is an index of available expression symbols that includes information such as the syntax to use, the description and an example.&amp;nbsp; The symbol being used in this exercise is &lt;i&gt;ConfigVar, &lt;/i&gt;which has four available expressions&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;ExpandConfigVar - returns string where all MicroStation configuration variables are expanded.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;GetExpandedConfigVar - returns the expanded variable.&lt;/p&gt;
&lt;p&gt;GetUnexpandedConfigVar - returns unexpanded variables.&lt;/p&gt;
&lt;p&gt;IsConfigVarDefined - returns true if the variable is defined.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;The named expressions can now be used for creating a show/hide test for tasks, tools, and other interface items.&amp;nbsp;&amp;nbsp; In this tutorial we&amp;#39;ll be creating two tasks:&lt;/p&gt;
&lt;p&gt;&lt;i&gt;ENGINEERING User&lt;/i&gt; which contains specific tasks for Engineering Services users, and&lt;/p&gt;
&lt;p&gt;&lt;i&gt;FACILITIES User&lt;/i&gt; which contains tasks for the Facility Maintenance users.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;The availability of these tasks will be driven by a Show/Hide test using the named expressions created earlier.&amp;nbsp; Let&amp;#39;s take a closer look.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 5:&amp;nbsp; Create UI dgnlib&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Start by creating a new DGN library to hold the interface customizations.&amp;nbsp; You&amp;#39;ll want to put this file in the projects .../dgnlib/ folder so it will be found by MS_DGNLIBLIST. &amp;nbsp;Note that this is defined at the project level, so all customizations in this dgnlib file will be read by all user workspaces using this project.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 6:&amp;nbsp; Create user tools and tasks&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Once open, navigate to the Customize dialog and create several new tool boxes under User Tools.&amp;nbsp; In this example, I created the following tool boxes and populated them with relevant tools:&amp;nbsp;&lt;em&gt; Annotation, Display, Draw, Measure, Modify, and Publishing.&amp;nbsp; &amp;nbsp;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/6740.User-Tools.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Once the User Tools have been created, go to the &lt;i&gt;Tasks&lt;/i&gt; pane and create a new task called &lt;i&gt;ENGINEERING User&lt;/i&gt;.&amp;nbsp; You can then populate this task with some or all of the user tools created above.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;Likewise, create a new task called &lt;i&gt;FACILITIES User&lt;/i&gt; and populate this task with some of the user tools.&amp;nbsp; &amp;nbsp;&amp;nbsp;Since MicroStation builds the interface on-the-fly, you can easily verify your UI design as you go. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/5504.fac.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 7:&amp;nbsp; Add Show/Hide test&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Tasks and workflows have a variety of properties that are defined in the Tool Container pane of the Customize dialog.&amp;nbsp; One of available properties is a &lt;i&gt;Show/Hide Test&lt;/i&gt; which determines whether the item is displayed in the Tasks dialog.&amp;nbsp; The tests are based on named expressions, and since we&amp;#39;ve already created those in Step 3, we can now define these tests.&lt;/p&gt;
&lt;p&gt;In the Customize dialog, highlight &lt;i&gt;ENGINEERING User&lt;/i&gt; in the Tasks pane, and note the available properties in the Tool Container.&amp;nbsp; Since there is no Show/Hide test, add one via the right click menu. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2260.Add-test.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Select the drop-down of the new Show/Hide test item and choose &lt;i&gt;MyCity ENGINEERING&lt;/i&gt; from the pop-up dialog.&amp;nbsp; At this time you may also want to click the Test button to ensure it returns True.&amp;nbsp; (Remember, your active user workspace is ENGINEERING therefore MyCity_ENG = 1.)&lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/8468.showhidepick.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Do the same for the &lt;i&gt;FACILITIES User&lt;/i&gt; task. Choose &lt;i&gt;MyCity FACILITIES&lt;/i&gt; from the available named expressions and verify that the test returns False.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;You&amp;#39;ll also notice that the FACILITIES User task has now been removed from the Tasks dialog on the interface!&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 8:&amp;nbsp; Test &lt;/b&gt;&lt;/p&gt;
&lt;p&gt;To further test this, close MicroStation and change the workspace to FACILITIES/MyCity.&amp;nbsp; Open any file and notice that you only have the FACILITIES User in the task dialog.&lt;/p&gt;
&lt;p&gt;Close MicroStation and change the workspace to ENGINEERING/MyCity.&amp;nbsp; This time, only the ENGINEERING User task is made available in the interface. &lt;/p&gt;
&lt;p&gt;The obvious benefit of the method is that CAD Administrators can maintain a single DGNLIB for all customizations and simply use Named Expressions to turn on or off tasks.&amp;nbsp; &amp;nbsp;In this case, we used a simple configuration variable to drive the show/hide test.&lt;/p&gt;
&lt;p&gt;The following content explores how to add the ENGINEERING User and FACILITIES User to the right click menu.&amp;nbsp; Since this customization will also use a Show/Hide test based on the named expressions, the right click menu will change its content based upon the active workspace. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 9:&amp;nbsp; Add ENGINEERING and FACILITIES to right-click &amp;nbsp;menu&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Using either the Engineering or Facilities workspace, and the MyCity project, re-open the UI dgnlib and navigate back to the customize dialog.&lt;/p&gt;
&lt;p&gt;Then go to the &lt;i&gt;Context Menus &lt;/i&gt;pane and add two new items, one for ENGINEERING and the other for FACILITIES.&amp;nbsp; Add the appropriate Show/Hide Test and finally populate the items with the desired user tools as shown.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/4426.Context-Menu.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Testing this is going to produce similar results to the tasks.&amp;nbsp; When the workspace is set to ENGINEERING/MyCity, the right-click menu will show the ENGINEERING User content, and when the workspace is set to FACILITIES/MyCity, it flip for the FACILITIES User.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2046.rightclickeng.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 10:&amp;nbsp; Add Switch User item to the right-click menu&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;As a final touch to the right-click menu, let&amp;#39;s add a Switch User item that performs the following tasks:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Show tasks from both the engineering and facilities users.&lt;/li&gt;
&lt;li&gt;Show only the ENGINEERING User tasks.&lt;/li&gt;
&lt;li&gt;Show only the FACILITIES User tasks&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/1273.bonus.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;To do that, add a new menu called &lt;i&gt;Switch User &lt;/i&gt;in the Context Menu.&amp;nbsp; Then add three menu items that execute the following MicroStation key ins:&amp;nbsp; &lt;/p&gt;
&lt;p&gt;Show Both Users:&amp;nbsp; &lt;em&gt;expand set MYCITY_ENG = 1;expand set MYCITY_FAC = 1;task reload&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;ENGINEERING:&amp;nbsp; &lt;em&gt;expand set MYCITY_ENG = 1;expand set MYCITY_FAC = 2;task reload&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;FACILITIES:&amp;nbsp; &lt;em&gt;expand set MYCITY_ENG = 2;expand set MYCITY_FAC = 1;task reload&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2465._3B00_lk.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;To finish this off, let&amp;#39;s take a quick look at the keyins:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Expand set&lt;/em&gt; sets a temporary configuration variable for the active design session.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Task reload&lt;/em&gt;, does exactly what it implies - it reloads all of the tasks.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This tutorial is only a small sampling of what can be done with named expressions, and with a little curiosity and creativity the possibilities are seemingly endless.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;Thanks for reading and have fun!&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Sample files: &lt;/p&gt;
&lt;p&gt;&lt;a href="/communities/other_communities/askinga/m/askinga-files/149094/download.aspx"&gt;http://communities.bentley.com/communities/other_communities/askinga/m/askinga-files/149094/download.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Related Link:&lt;/p&gt;
&lt;p&gt;&lt;a href="/communities/other_communities/askinga/w/askinga/set-temporary-variables-with-the-expand-set-keyin.aspx"&gt;http://communities.bentley.com/communities/other_communities/askinga/w/askinga/set-temporary-variables-with-the-expand-set-keyin.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;
</description></item><item><title>Using Named Expressions to drive interface items – A sample	</title><link>https://communities.bentley.com/products/microstation/w/askinga/4541/using-named-expressions-to-drive-interface-items-a-sample/revision/16</link><pubDate>Tue, 02 Nov 2010 19:08:49 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:5bae2907-f0ef-4c23-8c9a-213531402e1d</guid><dc:creator>Inga Morozoff</dc:creator><comments>https://communities.bentley.com/products/microstation/w/askinga/4541/using-named-expressions-to-drive-interface-items-a-sample#comments</comments><description>Revision 16 posted to [Archived] AskInga Wiki by Inga Morozoff on 11/2/2010 7:08:49 PM&lt;br /&gt;
&lt;p&gt;&lt;img height="76" width="230" src="/askIngaPics/askingalogo.gif" alt="AskInga logo" border="0" title="AskInga" /&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Using Named Expressions to drive interface items - A Sample&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;With thanks to Bentley&amp;#39;s Sam Hendrick for this article suggestion and content.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;By now you&amp;#39;ve heard and read about &lt;i&gt;Named Expressions&lt;/i&gt;, but might not have had the inspiration to experiment with them.&amp;nbsp; If this describes you, then the following tutorial might be just what you need to kick-start your learning and exploration of Named Expressions.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Named expressions can be used with the Customize utility to perform the following tasks:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;define rules that control when a tool is available, &lt;/li&gt;
&lt;li&gt;define rules to control when a task is available and to ,&lt;/li&gt;
&lt;li&gt;define rules for right-click context menus, such as conditions under which a context menu item is hidden.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;nbsp;Knowing this, we&amp;#39;ll use a couple of named expressions to load a different user interface depending upon the value of configuration variables defined in a pair UCF files &lt;/p&gt;
&lt;p&gt;&amp;nbsp;The following instructions can be used as a guide to work through this tutorial.&amp;nbsp; Of course this is just a sample workflow, what you employ to create your customized interface may differ.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 1:&amp;nbsp; Create two UCFs and one PCF&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Using the File Open dialog, or what us old-timers still call the MicroStation Manager dialog, create two new users and one new project.&amp;nbsp; In this example, I&amp;#39;m using ENGINEERING and FACILITIES as the users and MyCity as the project.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/3554.new-user.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;From there you can locate and open each of the UCF files and add a couple of new variables which will be used by the named expressions to drive the interface items.&amp;nbsp; In this example, MYCITY_ENG is for the Engineering user and MYCITY_FAC is for the facilities user.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 2:&amp;nbsp; Define variables &lt;/b&gt;&lt;/p&gt;
&lt;p&gt;In the UCF file for the Engineering, we define MYCITY_ENG=1 and MYCITY_FAC=2 while the variables for the facilities user would be the exact opposite (MYCITY_ENG=2 and MYCITY_FAC=1).&amp;nbsp; Note, setting a variable to 1 is True, and when setting it to any value other than 1 is recognized as &amp;quot;False&amp;quot; when dealing with named expressions.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/0081.facucf.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 3:&amp;nbsp; Create named expressions&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Back in the MicroStation Manager, navigate to the DGNLIB folder and create a new file to hold the named expression definitions.&amp;nbsp; Note that this is optional, if you prefer you can add them to any dgnlib that&amp;#39;s in a location pointed to by MS_DGNLIBLIST.&lt;/p&gt;
&lt;p&gt;In the File Open dialog, ensure that you&amp;#39;re set to the new ENGINEERING user and the MyCity project.&amp;nbsp; Then open the dgnlib that will hold the named expressions and select &lt;i&gt;Utilities &amp;gt; Named Expressions&lt;/i&gt;.&amp;nbsp; The resulting dialog is used to define and manage named expressions in the active DGN library.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2538.Named-Expresssion-dialog.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The next step is to create two named expressions that test for the presence of the variables created above.&amp;nbsp; To do that, click on the New button and enter the following information.&lt;/p&gt;
&lt;p&gt;Internal Name - sets the name of the named expression:&amp;nbsp; MyCity_ENG&lt;/p&gt;
&lt;p&gt;External Name - sets the text label that appears in the user interface to describe the test that will be applied when evaluating the named expression:&amp;nbsp; &lt;em&gt;MyCity ENGINEERING &lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Description:&amp;nbsp;&lt;em&gt; Is this user in Engineering Services?&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Keywords - enables the named expression to be used in specific areas:&amp;nbsp;&lt;em&gt; File, Task, Tool, User Interface&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Symbol Sets - defines the values and properties of the named expression:&amp;nbsp; &lt;em&gt;ConfigVar&lt;/em&gt; &lt;/p&gt;
&lt;p&gt;Expression - is the text string that&amp;#39;s to be evaluated. The expression is a single-line statement that contains symbols and operators: &amp;nbsp;&amp;nbsp;&lt;em&gt;ConfigVar.GetExpandedConfigVar(&amp;quot;MYCITY_ENG&amp;quot;)=1&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 4:&amp;nbsp; Test expressions&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Since you&amp;#39;re using the ENGINEERING workspace, the test button should return &lt;i&gt;True.&amp;nbsp; &lt;/i&gt;This makes sense since the variable MyCity_ENG is set to 1 in the UCF file.&amp;nbsp; This named expression will be used to control the display an ENGEERING User task that will be created in the next section.&lt;/p&gt;
&lt;p&gt;You can repeat these steps to create a second named expression for MyCity_FAC.&amp;nbsp; Testing this variable returns false since the variable is not set to 1.&amp;nbsp; This named expression will be used to control the display of a FACILITIES User task that will be created later.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/0116.fale.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;To determine what the expression should be, select &lt;i&gt;Utilities &amp;gt; Report Symbols &lt;/i&gt;which opens expression_symbols.html in your browser.&amp;nbsp;&amp;nbsp; This is an index of available expression symbols that includes information such as the syntax to use, the description and an example.&amp;nbsp; The symbol being used in this exercise is &lt;i&gt;ConfigVar, &lt;/i&gt;which has four available expressions&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;ExpandConfigVar - returns string where all MicroStation configuration variables are expanded.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;GetExpandedConfigVar - returns the expanded variable.&lt;/p&gt;
&lt;p&gt;GetUnexpandedConfigVar - returns unexpanded variables.&lt;/p&gt;
&lt;p&gt;IsConfigVarDefined - returns true if the variable is defined.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;The named expressions can now be used for creating a show/hide test for tasks, tools, and other interface items.&amp;nbsp;&amp;nbsp; In this tutorial we&amp;#39;ll be creating two tasks:&lt;/p&gt;
&lt;p&gt;&lt;i&gt;ENGINEERING User&lt;/i&gt; which contains specific tasks for Engineering Services users, and&lt;/p&gt;
&lt;p&gt;&lt;i&gt;FACILITIES User&lt;/i&gt; which contains tasks for the Facility Maintenance users.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;The availability of these tasks will be driven by a Show/Hide test using the named expressions created earlier.&amp;nbsp; Let&amp;#39;s take a closer look.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 5:&amp;nbsp; Create UI dgnlib&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Start by creating a new DGN library to hold the interface customizations.&amp;nbsp; You&amp;#39;ll want to put this file in the projects .../dgnlib/ folder so it will be found by MS_DGNLIBLIST. &amp;nbsp;Note that this is defined at the project level, so all customizations in this dgnlib file will be read by all user workspaces using this project.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 6:&amp;nbsp; Create user tools and tasks&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Once open, navigate to the Customize dialog and create several new tool boxes under User Tools.&amp;nbsp; In this example, I created the following tool boxes and populated them with relevant tools:&amp;nbsp;&lt;em&gt; Annotation, Display, Draw, Measure, Modify, and Publishing.&amp;nbsp; &amp;nbsp;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/6740.User-Tools.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Once the User Tools have been created, go to the &lt;i&gt;Tasks&lt;/i&gt; pane and create a new task called &lt;i&gt;ENGINEERING User&lt;/i&gt;.&amp;nbsp; You can then populate this task with some or all of the user tools created above.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;Likewise, create a new task called &lt;i&gt;FACILITIES User&lt;/i&gt; and populate this task with some of the user tools.&amp;nbsp; &amp;nbsp;&amp;nbsp;Since MicroStation builds the interface on-the-fly, you can easily verify your UI design as you go. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/5504.fac.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 7:&amp;nbsp; Add Show/Hide test&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Tasks and workflows have a variety of properties that are defined in the Tool Container pane of the Customize dialog.&amp;nbsp; One of available properties is a &lt;i&gt;Show/Hide Test&lt;/i&gt; which determines whether the item is displayed in the Tasks dialog.&amp;nbsp; The tests are based on named expressions, and since we&amp;#39;ve already created those in Step 3, we can now define these tests.&lt;/p&gt;
&lt;p&gt;In the Customize dialog, highlight &lt;i&gt;ENGINEERING User&lt;/i&gt; in the Tasks pane, and note the available properties in the Tool Container.&amp;nbsp; Since there is no Show/Hide test, add one via the right click menu. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2260.Add-test.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Select the drop-down of the new Show/Hide test item and choose &lt;i&gt;MyCity ENGINEERING&lt;/i&gt; from the pop-up dialog.&amp;nbsp; At this time you may also want to click the Test button to ensure it returns True.&amp;nbsp; (Remember, your active user workspace is ENGINEERING therefore MyCity_ENG = 1.)&lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/8468.showhidepick.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Do the same for the &lt;i&gt;FACILITIES User&lt;/i&gt; task. Choose &lt;i&gt;MyCity FACILITIES&lt;/i&gt; from the available named expressions and verify that the test returns False.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;You&amp;#39;ll also notice that the FACILITIES User task has now been removed from the Tasks dialog on the interface!&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 8:&amp;nbsp; Test &lt;/b&gt;&lt;/p&gt;
&lt;p&gt;To further test this, close MicroStation and change the workspace to FACILITIES/MyCity.&amp;nbsp; Open any file and notice that you only have the FACILITIES User in the task dialog.&lt;/p&gt;
&lt;p&gt;Close MicroStation and change the workspace to ENGINEERING/MyCity.&amp;nbsp; This time, only the ENGINEERING User task is made available in the interface. &lt;/p&gt;
&lt;p&gt;The obvious benefit of the method is that CAD Administrators can maintain a single DGNLIB for all customizations and simply use Named Expressions to turn on or off tasks.&amp;nbsp; &amp;nbsp;In this case, we used a simple configuration variable to drive the show/hide test.&lt;/p&gt;
&lt;p&gt;The following content explores how to add the ENGINEERING User and FACILITIES User to the right click menu.&amp;nbsp; Since this customization will also use a Show/Hide test based on the named expressions, the right click menu will change its content based upon the active workspace. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 9:&amp;nbsp; Add ENGINEERING and FACILITIES to right-click &amp;nbsp;menu&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Using either the Engineering or Facilities workspace, and the MyCity project, re-open the UI dgnlib and navigate back to the customize dialog.&lt;/p&gt;
&lt;p&gt;Then go to the &lt;i&gt;Context Menus &lt;/i&gt;pane and add two new items, one for ENGINEERING and the other for FACILITIES.&amp;nbsp; Add the appropriate Show/Hide Test and finally populate the items with the desired user tools as shown.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/4426.Context-Menu.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Testing this is going to produce similar results to the tasks.&amp;nbsp; When the workspace is set to ENGINEERING/MyCity, the right-click menu will show the ENGINEERING User content, and when the workspace is set to FACILITIES/MyCity, it flip for the FACILITIES User.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2046.rightclickeng.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 10:&amp;nbsp; Add Switch User item to the right-click menu&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;As a final touch to the right-click menu, let&amp;#39;s add a Switch User item that performs the following tasks:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Show tasks from both the engineering and facilities users.&lt;/li&gt;
&lt;li&gt;Show only the ENGINEERING User tasks.&lt;/li&gt;
&lt;li&gt;Show only the FACILITIES User tasks&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/1273.bonus.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;To do that, add a new menu called &lt;i&gt;Switch User &lt;/i&gt;in the Context Menu.&amp;nbsp; Then add three menu items that execute the following MicroStation key ins:&amp;nbsp; &lt;/p&gt;
&lt;p&gt;Show Both Users:&amp;nbsp; &lt;em&gt;expand set MYCITY_ENG = 1;expand set MYCITY_FAC = 1;task reload&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;ENGINEERING:&amp;nbsp; &lt;em&gt;expand set MYCITY_ENG = 1;expand set MYCITY_FAC = 2;task reload&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;FACILITIES:&amp;nbsp; &lt;em&gt;expand set MYCITY_ENG = 2;expand set MYCITY_FAC = 1;task reload&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2465._3B00_lk.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;To finish this off, let&amp;#39;s take a quick look at the keyins:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Expand set&lt;/em&gt; sets a temporary configuration variable for the active design session.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Task reload&lt;/em&gt;, does exactly what it implies - it reloads all of the tasks.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This tutorial is only a small sampling of what can be done with named expressions, and with a little curiosity and creativity the possibilities are seemingly endless.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;Thanks for reading and have fun!&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Related Link:&lt;/p&gt;
&lt;p&gt;Sample files: &lt;a href="http://communities.bentley.com/communities/other_communities/askinga/m/askinga-files/149094/download.aspx"&gt;http://communities.bentley.com/communities/other_communities/askinga/m/askinga-files/149094/download.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="/communities/other_communities/askinga/w/askinga/set-temporary-variables-with-the-expand-set-keyin.aspx"&gt;http://communities.bentley.com/communities/other_communities/askinga/w/askinga/set-temporary-variables-with-the-expand-set-keyin.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;
</description></item><item><title>Using Named Expressions to drive interface items – A sample	</title><link>https://communities.bentley.com/products/microstation/w/askinga/4541/using-named-expressions-to-drive-interface-items-a-sample/revision/15</link><pubDate>Tue, 02 Nov 2010 19:06:37 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:5bae2907-f0ef-4c23-8c9a-213531402e1d</guid><dc:creator>Inga Morozoff</dc:creator><comments>https://communities.bentley.com/products/microstation/w/askinga/4541/using-named-expressions-to-drive-interface-items-a-sample#comments</comments><description>Revision 15 posted to [Archived] AskInga Wiki by Inga Morozoff on 11/2/2010 7:06:37 PM&lt;br /&gt;
&lt;p&gt;&lt;img height="76" width="230" src="/askIngaPics/askingalogo.gif" alt="AskInga logo" border="0" title="AskInga" /&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Using Named Expressions to drive interface items - A Sample&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;With thanks to Bentley&amp;#39;s Sam Hendrick for this article suggestion and content.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;By now you&amp;#39;ve heard and read about &lt;i&gt;Named Expressions&lt;/i&gt;, but might not have had the inspiration to experiment with them.&amp;nbsp; If this describes you, then the following tutorial might be just what you need to kick-start your learning and exploration of Named Expressions.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Named expressions can be used with the Customize utility to perform the following tasks:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;define rules that control when a tool is available, &lt;/li&gt;
&lt;li&gt;define rules to control when a task is available and to ,&lt;/li&gt;
&lt;li&gt;define rules for right-click context menus, such as conditions under which a context menu item is hidden.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;nbsp;Knowing this, we&amp;#39;ll use a couple of named expressions to load a different user interface depending upon the value of configuration variables defined in a pair UCF files &lt;/p&gt;
&lt;p&gt;&amp;nbsp;The following instructions can be used as a guide to work through this tutorial.&amp;nbsp; Of course this is just a sample workflow, what you employ to create your customized interface may differ.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 1:&amp;nbsp; Create two UCFs and one PCF&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Using the File Open dialog, or what us old-timers still call the MicroStation Manager dialog, create two new users and one new project.&amp;nbsp; In this example, I&amp;#39;m using ENGINEERING and FACILITIES as the users and MyCity as the project.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/3554.new-user.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;From there you can locate and open each of the UCF files and add a couple of new variables which will be used by the named expressions to drive the interface items.&amp;nbsp; In this example, MYCITY_ENG is for the Engineering user and MYCITY_FAC is for the facilities user.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 2:&amp;nbsp; Define variables &lt;/b&gt;&lt;/p&gt;
&lt;p&gt;In the UCF file for the Engineering, we define MYCITY_ENG=1 and MYCITY_FAC=2 while the variables for the facilities user would be the exact opposite (MYCITY_ENG=2 and MYCITY_FAC=1).&amp;nbsp; Note, setting a variable to 1 is True, and when setting it to any value other than 1 is recognized as &amp;quot;False&amp;quot; when dealing with named expressions.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/0081.facucf.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 3:&amp;nbsp; Create named expressions&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Back in the MicroStation Manager, navigate to the DGNLIB folder and create a new file to hold the named expression definitions.&amp;nbsp; Note that this is optional, if you prefer you can add them to any dgnlib that&amp;#39;s in a location pointed to by MS_DGNLIBLIST.&lt;/p&gt;
&lt;p&gt;In the File Open dialog, ensure that you&amp;#39;re set to the new ENGINEERING user and the MyCity project.&amp;nbsp; Then open the dgnlib that will hold the named expressions and select &lt;i&gt;Utilities &amp;gt; Named Expressions&lt;/i&gt;.&amp;nbsp; The resulting dialog is used to define and manage named expressions in the active DGN library.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2538.Named-Expresssion-dialog.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The next step is to create two named expressions that test for the presence of the variables created above.&amp;nbsp; To do that, click on the New button and enter the following information.&lt;/p&gt;
&lt;p&gt;Internal Name - sets the name of the named expression:&amp;nbsp; MyCity_ENG&lt;/p&gt;
&lt;p&gt;External Name - sets the text label that appears in the user interface to describe the test that will be applied when evaluating the named expression:&amp;nbsp; &lt;em&gt;MyCity ENGINEERING &lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Description:&amp;nbsp;&lt;em&gt; Is this user in Engineering Services?&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Keywords - enables the named expression to be used in specific areas:&amp;nbsp;&lt;em&gt; File, Task, Tool, User Interface&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Symbol Sets - defines the values and properties of the named expression:&amp;nbsp; &lt;em&gt;ConfigVar&lt;/em&gt; &lt;/p&gt;
&lt;p&gt;Expression - is the text string that&amp;#39;s to be evaluated. The expression is a single-line statement that contains symbols and operators: &amp;nbsp;&amp;nbsp;&lt;em&gt;ConfigVar.GetExpandedConfigVar(&amp;quot;MYCITY_ENG&amp;quot;)=1&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 4:&amp;nbsp; Test expressions&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Since you&amp;#39;re using the ENGINEERING workspace, the test button should return &lt;i&gt;True.&amp;nbsp; &lt;/i&gt;This makes sense since the variable MyCity_ENG is set to 1 in the UCF file.&amp;nbsp; This named expression will be used to control the display an ENGEERING User task that will be created in the next section.&lt;/p&gt;
&lt;p&gt;You can repeat these steps to create a second named expression for MyCity_FAC.&amp;nbsp; Testing this variable returns false since the variable is not set to 1.&amp;nbsp; This named expression will be used to control the display of a FACILITIES User task that will be created later.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/0116.fale.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;To determine what the expression should be, select &lt;i&gt;Utilities &amp;gt; Report Symbols &lt;/i&gt;which opens expression_symbols.html in your browser.&amp;nbsp;&amp;nbsp; This is an index of available expression symbols that includes information such as the syntax to use, the description and an example.&amp;nbsp; The symbol being used in this exercise is &lt;i&gt;ConfigVar, &lt;/i&gt;which has four available expressions&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;ExpandConfigVar - returns string where all MicroStation configuration variables are expanded.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;GetExpandedConfigVar - returns the expanded variable.&lt;/p&gt;
&lt;p&gt;GetUnexpandedConfigVar - returns unexpanded variables.&lt;/p&gt;
&lt;p&gt;IsConfigVarDefined - returns true if the variable is defined.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;The named expressions can now be used for creating a show/hide test for tasks, tools, and other interface items.&amp;nbsp;&amp;nbsp; In this tutorial we&amp;#39;ll be creating two tasks:&lt;/p&gt;
&lt;p&gt;&lt;i&gt;ENGINEERING User&lt;/i&gt; which contains specific tasks for Engineering Services users, and&lt;/p&gt;
&lt;p&gt;&lt;i&gt;FACILITIES User&lt;/i&gt; which contains tasks for the Facility Maintenance users.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;The availability of these tasks will be driven by a Show/Hide test using the named expressions created earlier.&amp;nbsp; Let&amp;#39;s take a closer look.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 5:&amp;nbsp; Create UI dgnlib&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Start by creating a new DGN library to hold the interface customizations.&amp;nbsp; You&amp;#39;ll want to put this file in the projects .../dgnlib/ folder so it will be found by MS_DGNLIBLIST. &amp;nbsp;Note that this is defined at the project level, so all customizations in this dgnlib file will be read by all user workspaces using this project.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 6:&amp;nbsp; Create user tools and tasks&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Once open, navigate to the Customize dialog and create several new tool boxes under User Tools.&amp;nbsp; In this example, I created the following tool boxes and populated them with relevant tools:&amp;nbsp;&lt;em&gt; Annotation, Display, Draw, Measure, Modify, and Publishing.&amp;nbsp; &amp;nbsp;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/6740.User-Tools.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Once the User Tools have been created, go to the &lt;i&gt;Tasks&lt;/i&gt; pane and create a new task called &lt;i&gt;ENGINEERING User&lt;/i&gt;.&amp;nbsp; You can then populate this task with some or all of the user tools created above.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;Likewise, create a new task called &lt;i&gt;FACILITIES User&lt;/i&gt; and populate this task with some of the user tools.&amp;nbsp; &amp;nbsp;&amp;nbsp;Since MicroStation builds the interface on-the-fly, you can easily verify your UI design as you go. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/5504.fac.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 7:&amp;nbsp; Add Show/Hide test&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Tasks and workflows have a variety of properties that are defined in the Tool Container pane of the Customize dialog.&amp;nbsp; One of available properties is a &lt;i&gt;Show/Hide Test&lt;/i&gt; which determines whether the item is displayed in the Tasks dialog.&amp;nbsp; The tests are based on named expressions, and since we&amp;#39;ve already created those in Step 3, we can now define these tests.&lt;/p&gt;
&lt;p&gt;In the Customize dialog, highlight &lt;i&gt;ENGINEERING User&lt;/i&gt; in the Tasks pane, and note the available properties in the Tool Container.&amp;nbsp; Since there is no Show/Hide test, add one via the right click menu. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2260.Add-test.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Select the drop-down of the new Show/Hide test item and choose &lt;i&gt;MyCity ENGINEERING&lt;/i&gt; from the pop-up dialog.&amp;nbsp; At this time you may also want to click the Test button to ensure it returns True.&amp;nbsp; (Remember, your active user workspace is ENGINEERING therefore MyCity_ENG = 1.)&lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/8468.showhidepick.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Do the same for the &lt;i&gt;FACILITIES User&lt;/i&gt; task. Choose &lt;i&gt;MyCity FACILITIES&lt;/i&gt; from the available named expressions and verify that the test returns False.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;You&amp;#39;ll also notice that the FACILITIES User task has now been removed from the Tasks dialog on the interface!&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 8:&amp;nbsp; Test &lt;/b&gt;&lt;/p&gt;
&lt;p&gt;To further test this, close MicroStation and change the workspace to FACILITIES/MyCity.&amp;nbsp; Open any file and notice that you only have the FACILITIES User in the task dialog.&lt;/p&gt;
&lt;p&gt;Close MicroStation and change the workspace to ENGINEERING/MyCity.&amp;nbsp; This time, only the ENGINEERING User task is made available in the interface. &lt;/p&gt;
&lt;p&gt;The obvious benefit of the method is that CAD Administrators can maintain a single DGNLIB for all customizations and simply use Named Expressions to turn on or off tasks.&amp;nbsp; &amp;nbsp;In this case, we used a simple configuration variable to drive the show/hide test.&lt;/p&gt;
&lt;p&gt;The following content explores how to add the ENGINEERING User and FACILITIES User to the right click menu.&amp;nbsp; Since this customization will also use a Show/Hide test based on the named expressions, the right click menu will change its content based upon the active workspace. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 9:&amp;nbsp; Add ENGINEERING and FACILITIES to right-click &amp;nbsp;menu&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Using either the Engineering or Facilities workspace, and the MyCity project, re-open the UI dgnlib and navigate back to the customize dialog.&lt;/p&gt;
&lt;p&gt;Then go to the &lt;i&gt;Context Menus &lt;/i&gt;pane and add two new items, one for ENGINEERING and the other for FACILITIES.&amp;nbsp; Add the appropriate Show/Hide Test and finally populate the items with the desired user tools as shown.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/4426.Context-Menu.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Testing this is going to produce similar results to the tasks.&amp;nbsp; When the workspace is set to ENGINEERING/MyCity, the right-click menu will show the ENGINEERING User content, and when the workspace is set to FACILITIES/MyCity, it flip for the FACILITIES User.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2046.rightclickeng.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 10:&amp;nbsp; Add Switch User item to the right-click menu&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;As a final touch to the right-click menu, let&amp;#39;s add a Switch User item that performs the following tasks:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Show tasks from both the engineering and facilities users.&lt;/li&gt;
&lt;li&gt;Show only the ENGINEERING User tasks.&lt;/li&gt;
&lt;li&gt;Show only the FACILITIES User tasks&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/1273.bonus.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;To do that, add a new menu called &lt;i&gt;Switch User &lt;/i&gt;in the Context Menu.&amp;nbsp; Then add three menu items that execute the following MicroStation key ins:&amp;nbsp; &lt;/p&gt;
&lt;p&gt;Show Both Users:&amp;nbsp; &lt;em&gt;expand set MYCITY_ENG = 1;expand set MYCITY_FAC = 1;task reload&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;ENGINEERING:&amp;nbsp; &lt;em&gt;expand set MYCITY_ENG = 1;expand set MYCITY_FAC = 2;task reload&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;FACILITIES:&amp;nbsp; &lt;em&gt;expand set MYCITY_ENG = 2;expand set MYCITY_FAC = 1;task reload&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2465._3B00_lk.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;To finish this off, let&amp;#39;s take a quick look at the keyins:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Expand set&lt;/em&gt; sets a temporary configuration variable for the active design session.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Task reload&lt;/em&gt;, does exactly what it implies - it reloads all of the tasks.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This tutorial is only a small sampling of what can be done with named expressions, and with a little curiosity and creativity the possibilities are seemingly endless.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;Thanks for reading and have fun!&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Related Link:&lt;/p&gt;
&lt;p&gt;&lt;a href="/communities/other_communities/askinga/w/askinga/set-temporary-variables-with-the-expand-set-keyin.aspx"&gt;http://communities.bentley.com/communities/other_communities/askinga/w/askinga/set-temporary-variables-with-the-expand-set-keyin.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;
</description></item><item><title>Using Named Expressions to drive interface items – A sample	</title><link>https://communities.bentley.com/products/microstation/w/askinga/4541/using-named-expressions-to-drive-interface-items-a-sample/revision/14</link><pubDate>Tue, 02 Nov 2010 19:03:31 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:5bae2907-f0ef-4c23-8c9a-213531402e1d</guid><dc:creator>Inga Morozoff</dc:creator><comments>https://communities.bentley.com/products/microstation/w/askinga/4541/using-named-expressions-to-drive-interface-items-a-sample#comments</comments><description>Revision 14 posted to [Archived] AskInga Wiki by Inga Morozoff on 11/2/2010 7:03:31 PM&lt;br /&gt;
&lt;p&gt;&lt;img height="76" width="230" src="/askIngaPics/askingalogo.gif" alt="AskInga logo" border="0" title="AskInga" /&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;
&lt;p&gt;&lt;strong&gt;Using Named Expressions to drive interface items - A Sample&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;With thanks to Bentley&amp;#39;s Sam Hendrick for this article suggestion and content.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;By now you&amp;#39;ve heard and read about &lt;i&gt;Named Expressions&lt;/i&gt;, but might not have had the inspiration to experiment with them.&amp;nbsp; If this describes you, then the following tutorial might be just what you need to kick-start your learning and exploration of Named Expressions.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Named expressions can be used with the Customize utility to perform the following tasks:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;define rules that control when a tool is available, &lt;/li&gt;
&lt;li&gt;define rules to control when a task is available and to ,&lt;/li&gt;
&lt;li&gt;define rules for right-click context menus, such as conditions under which a context menu item is hidden.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;nbsp;Knowing this, we&amp;#39;ll use a couple of named expressions to load a different user interface depending upon the value of configuration variables defined in a pair UCF files &lt;/p&gt;
&lt;p&gt;&amp;nbsp;The following instructions can be used as a guide to work through this tutorial.&amp;nbsp; Of course this is just a sample workflow, what you employ to create your customized interface may differ.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 1:&amp;nbsp; Create two UCFs and one PCF&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Using the File Open dialog, or what us old-timers still call the MicroStation Manager dialog, create two new users and one new project.&amp;nbsp; In this example, I&amp;#39;m using ENGINEERING and FACILITIES as the users and MyCity as the project.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/3554.new-user.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;From there you can locate and open each of the UCF files and add a couple of new variables which will be used by the named expressions to drive the interface items.&amp;nbsp; In this example, MYCITY_ENG is for the Engineering user and MYCITY_FAC is for the facilities user.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 2:&amp;nbsp; Define variables &lt;/b&gt;&lt;/p&gt;
&lt;p&gt;In the UCF file for the Engineering, we define MYCITY_ENG=1 and MYCITY_FAC=2 while the variables for the facilities user would be the exact opposite (MYCITY_ENG=2 and MYCITY_FAC=1).&amp;nbsp; Note, setting a variable to 1 is True, and when setting it to any value other than 1 is recognized as &amp;quot;False&amp;quot; when dealing with named expressions.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/0081.facucf.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 3:&amp;nbsp; Create named expressions&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Back in the MicroStation Manager, navigate to the DGNLIB folder and create a new file to hold the named expression definitions.&amp;nbsp; Note that this is optional, if you prefer you can add them to any dgnlib that&amp;#39;s in a location pointed to by MS_DGNLIBLIST.&lt;/p&gt;
&lt;p&gt;In the File Open dialog, ensure that you&amp;#39;re set to the new ENGINEERING user and the MyCity project.&amp;nbsp; Then open the dgnlib that will hold the named expressions and select &lt;i&gt;Utilities &amp;gt; Named Expressions&lt;/i&gt;.&amp;nbsp; The resulting dialog is used to define and manage named expressions in the active DGN library.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2538.Named-Expresssion-dialog.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The next step is to create two named expressions that test for the presence of the variables created above.&amp;nbsp; To do that, click on the New button and enter the following information.&lt;/p&gt;
&lt;p&gt;Internal Name - sets the name of the named expression:&amp;nbsp; MyCity_ENG&lt;/p&gt;
&lt;p&gt;External Name - sets the text label that appears in the user interface to describe the test that will be applied when evaluating the named expression:&amp;nbsp; &lt;em&gt;MyCity ENGINEERING &lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Description:&amp;nbsp;&lt;em&gt; Is this user in Engineering Services?&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Keywords - enables the named expression to be used in specific areas:&amp;nbsp;&lt;em&gt; File, Task, Tool, User Interface&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Symbol Sets - defines the values and properties of the named expression:&amp;nbsp; &lt;em&gt;ConfigVar&lt;/em&gt; &lt;/p&gt;
&lt;p&gt;Expression - is the text string that&amp;#39;s to be evaluated. The expression is a single-line statement that contains symbols and operators: &amp;nbsp;&amp;nbsp;&lt;em&gt;ConfigVar.GetExpandedConfigVar(&amp;quot;MYCITY_ENG&amp;quot;)=1&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 4:&amp;nbsp; Test expressions&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Since you&amp;#39;re using the ENGINEERING workspace, the test button should return &lt;i&gt;True.&amp;nbsp; &lt;/i&gt;This makes sense since the variable MyCity_ENG is set to 1 in the UCF file.&amp;nbsp; This named expression will be used to control the display an ENGEERING User task that will be created in the next section.&lt;/p&gt;
&lt;p&gt;You can repeat these steps to create a second named expression for MyCity_FAC.&amp;nbsp; Testing this variable returns false since the variable is not set to 1.&amp;nbsp; This named expression will be used to control the display of a FACILITIES User task that will be created later.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/0116.fale.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;To determine what the expression should be, select &lt;i&gt;Utilities &amp;gt; Report Symbols &lt;/i&gt;which opens expression_symbols.html in your browser.&amp;nbsp;&amp;nbsp; This is an index of available expression symbols that includes information such as the syntax to use, the description and an example.&amp;nbsp; The symbol being used in this exercise is &lt;i&gt;ConfigVar, &lt;/i&gt;which has four available expressions&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;ExpandConfigVar - returns string where all MicroStation configuration variables are expanded.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;GetExpandedConfigVar - returns the expanded variable.&lt;/p&gt;
&lt;p&gt;GetUnexpandedConfigVar - returns unexpanded variables.&lt;/p&gt;
&lt;p&gt;IsConfigVarDefined - returns true if the variable is defined.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;The named expressions can now be used for creating a show/hide test for tasks, tools, and other interface items.&amp;nbsp;&amp;nbsp; In this tutorial we&amp;#39;ll be creating two tasks:&lt;/p&gt;
&lt;p&gt;&lt;i&gt;ENGINEERING User&lt;/i&gt; which contains specific tasks for Engineering Services users, and&lt;/p&gt;
&lt;p&gt;&lt;i&gt;FACILITIES User&lt;/i&gt; which contains tasks for the Facility Maintenance users.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;The availability of these tasks will be driven by a Show/Hide test using the named expressions created earlier.&amp;nbsp; Let&amp;#39;s take a closer look.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 5:&amp;nbsp; Create UI dgnlib&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Start by creating a new DGN library to hold the interface customizations.&amp;nbsp; You&amp;#39;ll want to put this file in the projects .../dgnlib/ folder so it will be found by MS_DGNLIBLIST. &amp;nbsp;Note that this is defined at the project level, so all customizations in this dgnlib file will be read by all user workspaces using this project.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 6:&amp;nbsp; Create user tools and tasks&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Once open, navigate to the Customize dialog and create several new tool boxes under User Tools.&amp;nbsp; In this example, I created the following tool boxes and populated them with relevant tools:&amp;nbsp;&lt;em&gt; Annotation, Display, Draw, Measure, Modify, and Publishing.&amp;nbsp; &amp;nbsp;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/6740.User-Tools.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Once the User Tools have been created, go to the &lt;i&gt;Tasks&lt;/i&gt; pane and create a new task called &lt;i&gt;ENGINEERING User&lt;/i&gt;.&amp;nbsp; You can then populate this task with some or all of the user tools created above.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;Likewise, create a new task called &lt;i&gt;FACILITIES User&lt;/i&gt; and populate this task with some of the user tools.&amp;nbsp; &amp;nbsp;&amp;nbsp;Since MicroStation builds the interface on-the-fly, you can easily verify your UI design as you go. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/5504.fac.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 7:&amp;nbsp; Add Show/Hide test&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Tasks and workflows have a variety of properties that are defined in the Tool Container pane of the Customize dialog.&amp;nbsp; One of available properties is a &lt;i&gt;Show/Hide Test&lt;/i&gt; which determines whether the item is displayed in the Tasks dialog.&amp;nbsp; The tests are based on named expressions, and since we&amp;#39;ve already created those in Step 3, we can now define these tests.&lt;/p&gt;
&lt;p&gt;In the Customize dialog, highlight &lt;i&gt;ENGINEERING User&lt;/i&gt; in the Tasks pane, and note the available properties in the Tool Container.&amp;nbsp; Since there is no Show/Hide test, add one via the right click menu. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2260.Add-test.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Select the drop-down of the new Show/Hide test item and choose &lt;i&gt;MyCity ENGINEERING&lt;/i&gt; from the pop-up dialog.&amp;nbsp; At this time you may also want to click the Test button to ensure it returns True.&amp;nbsp; (Remember, your active user workspace is ENGINEERING therefore MyCity_ENG = 1.)&lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/8468.showhidepick.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Do the same for the &lt;i&gt;FACILITIES User&lt;/i&gt; task. Choose &lt;i&gt;MyCity FACILITIES&lt;/i&gt; from the available named expressions and verify that the test returns False.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;You&amp;#39;ll also notice that the FACILITIES User task has now been removed from the Tasks dialog on the interface!&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 8:&amp;nbsp; Test &lt;/b&gt;&lt;/p&gt;
&lt;p&gt;To further test this, close MicroStation and change the workspace to FACILITIES/MyCity.&amp;nbsp; Open any file and notice that you only have the FACILITIES User in the task dialog.&lt;/p&gt;
&lt;p&gt;Close MicroStation and change the workspace to ENGINEERING/MyCity.&amp;nbsp; This time, only the ENGINEERING User task is made available in the interface. &lt;/p&gt;
&lt;p&gt;The obvious benefit of the method is that CAD Administrators can maintain a single DGNLIB for all customizations and simply use Named Expressions to turn on or off tasks.&amp;nbsp; &amp;nbsp;In this case, we used a simple configuration variable to drive the show/hide test.&lt;/p&gt;
&lt;p&gt;The following content explores how to add the ENGINEERING User and FACILITIES User to the right click menu.&amp;nbsp; Since this customization will also use a Show/Hide test based on the named expressions, the right click menu will change its content based upon the active workspace. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 9:&amp;nbsp; Add ENGINEERING and FACILITIES to right-click &amp;nbsp;menu&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Using either the Engineering or Facilities workspace, and the MyCity project, re-open the UI dgnlib and navigate back to the customize dialog.&lt;/p&gt;
&lt;p&gt;Then go to the &lt;i&gt;Context Menus &lt;/i&gt;pane and add two new items, one for ENGINEERING and the other for FACILITIES.&amp;nbsp; Add the appropriate Show/Hide Test and finally populate the items with the desired user tools as shown.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/4426.Context-Menu.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Testing this is going to produce similar results to the tasks.&amp;nbsp; When the workspace is set to ENGINEERING/MyCity, the right-click menu will show the ENGINEERING User content, and when the workspace is set to FACILITIES/MyCity, it flip for the FACILITIES User.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2046.rightclickeng.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 10:&amp;nbsp; Add Switch User item to the right-click menu&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;As a final touch to the right-click menu, let&amp;#39;s add a Switch User item that performs the following tasks:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Show tasks from both the engineering and facilities users.&lt;/li&gt;
&lt;li&gt;Show only the ENGINEERING User tasks.&lt;/li&gt;
&lt;li&gt;Show only the FACILITIES User tasks&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/1273.bonus.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;To do that, add a new menu called &lt;i&gt;Switch User &lt;/i&gt;in the Context Menu.&amp;nbsp; Then add three menu items that execute the following MicroStation key ins:&amp;nbsp; &lt;/p&gt;
&lt;p&gt;Show Both Users:&amp;nbsp; &lt;em&gt;expand set MYCITY_ENG = 1;expand set MYCITY_FAC = 1;task reload&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;ENGINEERING:&amp;nbsp; &lt;em&gt;expand set MYCITY_ENG = 1;expand set MYCITY_FAC = 2;task reload&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;FACILITIES:&amp;nbsp; &lt;em&gt;expand set MYCITY_ENG = 2;expand set MYCITY_FAC = 1;task reload&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2465._3B00_lk.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;To finish this off, let&amp;#39;s take a quick look at the keyins:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Expand set&lt;/em&gt; sets a temporary configuration variable for the active design session.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Task reload&lt;/em&gt;, does exactly what it implies - it reloads all of the tasks.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This tutorial is only a small sampling of what can be done with named expressions, and with a little curiosity and creativity the possibilities are seemingly endless.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;Thanks for reading and have fun!&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Related Link:&lt;/p&gt;
&lt;p&gt;&lt;a href="/communities/other_communities/askinga/w/askinga/set-temporary-variables-with-the-expand-set-keyin.aspx"&gt;http://communities.bentley.com/communities/other_communities/askinga/w/askinga/set-temporary-variables-with-the-expand-set-keyin.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;
</description></item><item><title>Using Named Expressions to drive interface items – A sample	</title><link>https://communities.bentley.com/products/microstation/w/askinga/4541/using-named-expressions-to-drive-interface-items-a-sample/revision/13</link><pubDate>Tue, 02 Nov 2010 19:02:51 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:5bae2907-f0ef-4c23-8c9a-213531402e1d</guid><dc:creator>Inga Morozoff</dc:creator><comments>https://communities.bentley.com/products/microstation/w/askinga/4541/using-named-expressions-to-drive-interface-items-a-sample#comments</comments><description>Revision 13 posted to [Archived] AskInga Wiki by Inga Morozoff on 11/2/2010 7:02:51 PM&lt;br /&gt;
&lt;p&gt;&lt;img height="76" width="230" src="/askIngaPics/askingalogo.gif" alt="AskInga logo" border="0" title="AskInga" /&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;
&lt;p&gt;Using Named Expressions to drive interface items - A Sample&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;With thanks to Bentley&amp;#39;s Sam Hendrick for this article suggestion and content.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;By now you&amp;#39;ve heard and read about &lt;i&gt;Named Expressions&lt;/i&gt;, but might not have had the inspiration to experiment with them.&amp;nbsp; If this describes you, then the following tutorial might be just what you need to kick-start your learning and exploration of Named Expressions.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Named expressions can be used with the Customize utility to perform the following tasks:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;define rules that control when a tool is available, &lt;/li&gt;
&lt;li&gt;define rules to control when a task is available and to ,&lt;/li&gt;
&lt;li&gt;define rules for right-click context menus, such as conditions under which a context menu item is hidden.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;nbsp;Knowing this, we&amp;#39;ll use a couple of named expressions to load a different user interface depending upon the value of configuration variables defined in a pair UCF files &lt;/p&gt;
&lt;p&gt;&amp;nbsp;The following instructions can be used as a guide to work through this tutorial.&amp;nbsp; Of course this is just a sample workflow, what you employ to create your customized interface may differ.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 1:&amp;nbsp; Create two UCFs and one PCF&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Using the File Open dialog, or what us old-timers still call the MicroStation Manager dialog, create two new users and one new project.&amp;nbsp; In this example, I&amp;#39;m using ENGINEERING and FACILITIES as the users and MyCity as the project.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/3554.new-user.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;From there you can locate and open each of the UCF files and add a couple of new variables which will be used by the named expressions to drive the interface items.&amp;nbsp; In this example, MYCITY_ENG is for the Engineering user and MYCITY_FAC is for the facilities user.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 2:&amp;nbsp; Define variables &lt;/b&gt;&lt;/p&gt;
&lt;p&gt;In the UCF file for the Engineering, we define MYCITY_ENG=1 and MYCITY_FAC=2 while the variables for the facilities user would be the exact opposite (MYCITY_ENG=2 and MYCITY_FAC=1).&amp;nbsp; Note, setting a variable to 1 is True, and when setting it to any value other than 1 is recognized as &amp;quot;False&amp;quot; when dealing with named expressions.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/0081.facucf.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 3:&amp;nbsp; Create named expressions&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Back in the MicroStation Manager, navigate to the DGNLIB folder and create a new file to hold the named expression definitions.&amp;nbsp; Note that this is optional, if you prefer you can add them to any dgnlib that&amp;#39;s in a location pointed to by MS_DGNLIBLIST.&lt;/p&gt;
&lt;p&gt;In the File Open dialog, ensure that you&amp;#39;re set to the new ENGINEERING user and the MyCity project.&amp;nbsp; Then open the dgnlib that will hold the named expressions and select &lt;i&gt;Utilities &amp;gt; Named Expressions&lt;/i&gt;.&amp;nbsp; The resulting dialog is used to define and manage named expressions in the active DGN library.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2538.Named-Expresssion-dialog.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The next step is to create two named expressions that test for the presence of the variables created above.&amp;nbsp; To do that, click on the New button and enter the following information.&lt;/p&gt;
&lt;p&gt;Internal Name - sets the name of the named expression:&amp;nbsp; MyCity_ENG&lt;/p&gt;
&lt;p&gt;External Name - sets the text label that appears in the user interface to describe the test that will be applied when evaluating the named expression:&amp;nbsp; &lt;em&gt;MyCity ENGINEERING &lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Description:&amp;nbsp;&lt;em&gt; Is this user in Engineering Services?&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Keywords - enables the named expression to be used in specific areas:&amp;nbsp;&lt;em&gt; File, Task, Tool, User Interface&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Symbol Sets - defines the values and properties of the named expression:&amp;nbsp; &lt;em&gt;ConfigVar&lt;/em&gt; &lt;/p&gt;
&lt;p&gt;Expression - is the text string that&amp;#39;s to be evaluated. The expression is a single-line statement that contains symbols and operators: &amp;nbsp;&amp;nbsp;&lt;em&gt;ConfigVar.GetExpandedConfigVar(&amp;quot;MYCITY_ENG&amp;quot;)=1&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 4:&amp;nbsp; Test expressions&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Since you&amp;#39;re using the ENGINEERING workspace, the test button should return &lt;i&gt;True.&amp;nbsp; &lt;/i&gt;This makes sense since the variable MyCity_ENG is set to 1 in the UCF file.&amp;nbsp; This named expression will be used to control the display an ENGEERING User task that will be created in the next section.&lt;/p&gt;
&lt;p&gt;You can repeat these steps to create a second named expression for MyCity_FAC.&amp;nbsp; Testing this variable returns false since the variable is not set to 1.&amp;nbsp; This named expression will be used to control the display of a FACILITIES User task that will be created later.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/0116.fale.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;To determine what the expression should be, select &lt;i&gt;Utilities &amp;gt; Report Symbols &lt;/i&gt;which opens expression_symbols.html in your browser.&amp;nbsp;&amp;nbsp; This is an index of available expression symbols that includes information such as the syntax to use, the description and an example.&amp;nbsp; The symbol being used in this exercise is &lt;i&gt;ConfigVar, &lt;/i&gt;which has four available expressions&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;ExpandConfigVar - returns string where all MicroStation configuration variables are expanded.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;GetExpandedConfigVar - returns the expanded variable.&lt;/p&gt;
&lt;p&gt;GetUnexpandedConfigVar - returns unexpanded variables.&lt;/p&gt;
&lt;p&gt;IsConfigVarDefined - returns true if the variable is defined.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;The named expressions can now be used for creating a show/hide test for tasks, tools, and other interface items.&amp;nbsp;&amp;nbsp; In this tutorial we&amp;#39;ll be creating two tasks:&lt;/p&gt;
&lt;p&gt;&lt;i&gt;ENGINEERING User&lt;/i&gt; which contains specific tasks for Engineering Services users, and&lt;/p&gt;
&lt;p&gt;&lt;i&gt;FACILITIES User&lt;/i&gt; which contains tasks for the Facility Maintenance users.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;The availability of these tasks will be driven by a Show/Hide test using the named expressions created earlier.&amp;nbsp; Let&amp;#39;s take a closer look.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 5:&amp;nbsp; Create UI dgnlib&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Start by creating a new DGN library to hold the interface customizations.&amp;nbsp; You&amp;#39;ll want to put this file in the projects .../dgnlib/ folder so it will be found by MS_DGNLIBLIST. &amp;nbsp;Note that this is defined at the project level, so all customizations in this dgnlib file will be read by all user workspaces using this project.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 6:&amp;nbsp; Create user tools and tasks&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Once open, navigate to the Customize dialog and create several new tool boxes under User Tools.&amp;nbsp; In this example, I created the following tool boxes and populated them with relevant tools:&amp;nbsp;&lt;em&gt; Annotation, Display, Draw, Measure, Modify, and Publishing.&amp;nbsp; &amp;nbsp;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/6740.User-Tools.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Once the User Tools have been created, go to the &lt;i&gt;Tasks&lt;/i&gt; pane and create a new task called &lt;i&gt;ENGINEERING User&lt;/i&gt;.&amp;nbsp; You can then populate this task with some or all of the user tools created above.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;Likewise, create a new task called &lt;i&gt;FACILITIES User&lt;/i&gt; and populate this task with some of the user tools.&amp;nbsp; &amp;nbsp;&amp;nbsp;Since MicroStation builds the interface on-the-fly, you can easily verify your UI design as you go. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/5504.fac.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 7:&amp;nbsp; Add Show/Hide test&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Tasks and workflows have a variety of properties that are defined in the Tool Container pane of the Customize dialog.&amp;nbsp; One of available properties is a &lt;i&gt;Show/Hide Test&lt;/i&gt; which determines whether the item is displayed in the Tasks dialog.&amp;nbsp; The tests are based on named expressions, and since we&amp;#39;ve already created those in Step 3, we can now define these tests.&lt;/p&gt;
&lt;p&gt;In the Customize dialog, highlight &lt;i&gt;ENGINEERING User&lt;/i&gt; in the Tasks pane, and note the available properties in the Tool Container.&amp;nbsp; Since there is no Show/Hide test, add one via the right click menu. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2260.Add-test.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Select the drop-down of the new Show/Hide test item and choose &lt;i&gt;MyCity ENGINEERING&lt;/i&gt; from the pop-up dialog.&amp;nbsp; At this time you may also want to click the Test button to ensure it returns True.&amp;nbsp; (Remember, your active user workspace is ENGINEERING therefore MyCity_ENG = 1.)&lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/8468.showhidepick.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Do the same for the &lt;i&gt;FACILITIES User&lt;/i&gt; task. Choose &lt;i&gt;MyCity FACILITIES&lt;/i&gt; from the available named expressions and verify that the test returns False.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;You&amp;#39;ll also notice that the FACILITIES User task has now been removed from the Tasks dialog on the interface!&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 8:&amp;nbsp; Test &lt;/b&gt;&lt;/p&gt;
&lt;p&gt;To further test this, close MicroStation and change the workspace to FACILITIES/MyCity.&amp;nbsp; Open any file and notice that you only have the FACILITIES User in the task dialog.&lt;/p&gt;
&lt;p&gt;Close MicroStation and change the workspace to ENGINEERING/MyCity.&amp;nbsp; This time, only the ENGINEERING User task is made available in the interface. &lt;/p&gt;
&lt;p&gt;The obvious benefit of the method is that CAD Administrators can maintain a single DGNLIB for all customizations and simply use Named Expressions to turn on or off tasks.&amp;nbsp; &amp;nbsp;In this case, we used a simple configuration variable to drive the show/hide test.&lt;/p&gt;
&lt;p&gt;The following content explores how to add the ENGINEERING User and FACILITIES User to the right click menu.&amp;nbsp; Since this customization will also use a Show/Hide test based on the named expressions, the right click menu will change its content based upon the active workspace. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 9:&amp;nbsp; Add ENGINEERING and FACILITIES to right-click &amp;nbsp;menu&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Using either the Engineering or Facilities workspace, and the MyCity project, re-open the UI dgnlib and navigate back to the customize dialog.&lt;/p&gt;
&lt;p&gt;Then go to the &lt;i&gt;Context Menus &lt;/i&gt;pane and add two new items, one for ENGINEERING and the other for FACILITIES.&amp;nbsp; Add the appropriate Show/Hide Test and finally populate the items with the desired user tools as shown.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/4426.Context-Menu.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Testing this is going to produce similar results to the tasks.&amp;nbsp; When the workspace is set to ENGINEERING/MyCity, the right-click menu will show the ENGINEERING User content, and when the workspace is set to FACILITIES/MyCity, it flip for the FACILITIES User.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2046.rightclickeng.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 10:&amp;nbsp; Add Switch User item to the right-click menu&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;As a final touch to the right-click menu, let&amp;#39;s add a Switch User item that performs the following tasks:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Show tasks from both the engineering and facilities users.&lt;/li&gt;
&lt;li&gt;Show only the ENGINEERING User tasks.&lt;/li&gt;
&lt;li&gt;Show only the FACILITIES User tasks&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/1273.bonus.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;To do that, add a new menu called &lt;i&gt;Switch User &lt;/i&gt;in the Context Menu.&amp;nbsp; Then add three menu items that execute the following MicroStation key ins:&amp;nbsp; &lt;/p&gt;
&lt;p&gt;Show Both Users:&amp;nbsp; &lt;em&gt;expand set MYCITY_ENG = 1;expand set MYCITY_FAC = 1;task reload&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;ENGINEERING:&amp;nbsp; &lt;em&gt;expand set MYCITY_ENG = 1;expand set MYCITY_FAC = 2;task reload&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;FACILITIES:&amp;nbsp; &lt;em&gt;expand set MYCITY_ENG = 2;expand set MYCITY_FAC = 1;task reload&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2465._3B00_lk.jpg" border="0" alt="" /&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;To finish this off, let&amp;#39;s take a quick look at the keyins:&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Expand set&lt;/em&gt; sets a temporary configuration variable for the active design session.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Task reload&lt;/em&gt;, does exactly what it implies - it reloads all of the tasks.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This tutorial is only a small sampling of what can be done with named expressions, and with a little curiosity and creativity the possibilities are seemingly endless.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;Thanks for reading and have fun!&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Related Link:&lt;/p&gt;
&lt;p&gt;&lt;a href="/communities/other_communities/askinga/w/askinga/set-temporary-variables-with-the-expand-set-keyin.aspx"&gt;http://communities.bentley.com/communities/other_communities/askinga/w/askinga/set-temporary-variables-with-the-expand-set-keyin.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;
</description></item><item><title>Using Named Expressions to drive interface items – A sample	</title><link>https://communities.bentley.com/products/microstation/w/askinga/4541/using-named-expressions-to-drive-interface-items-a-sample/revision/12</link><pubDate>Tue, 02 Nov 2010 18:55:02 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:5bae2907-f0ef-4c23-8c9a-213531402e1d</guid><dc:creator>Inga Morozoff</dc:creator><comments>https://communities.bentley.com/products/microstation/w/askinga/4541/using-named-expressions-to-drive-interface-items-a-sample#comments</comments><description>Revision 12 posted to [Archived] AskInga Wiki by Inga Morozoff on 11/2/2010 6:55:02 PM&lt;br /&gt;
&lt;p&gt;&lt;img height="76" width="230" src="/askIngaPics/askingalogo.gif" alt="AskInga logo" border="0" title="AskInga" /&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;
&lt;p&gt;Using Named Expressions to drive interface items - A Sample&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;With thanks to Bentley&amp;#39;s Sam Hendrick for this article suggestion and content.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;By now you&amp;#39;ve heard and read about &lt;i&gt;Named Expressions&lt;/i&gt;, but might not have had the inspiration to experiment with them.&amp;nbsp; If this describes you, then the following tutorial might be just what you need to kick-start your learning and exploration of Named Expressions.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Named expressions can be used with the Customize utility to perform the following tasks:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;define rules that control when a tool is available, &lt;/li&gt;
&lt;li&gt;define rules to control when a task is available and to ,&lt;/li&gt;
&lt;li&gt;define rules for right-click context menus, such as conditions under which a context menu item is hidden.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Knowing this, we&amp;#39;ll use a couple of named expressions to load a different user interface depending upon the value of configuration variables defined in a pair UCF files &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The following instructions can be used as a guide to work through this tutorial.&amp;nbsp; Of course this is just a sample workflow, what you employ to create your customized interface may differ.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 1:&amp;nbsp; Create two UCFs and one PCF&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Using the File Open dialog, or what us old-timers still call the MicroStation Manager dialog, create two new users and one new project.&amp;nbsp; In this example, I&amp;#39;m using ENGINEERING and FACILITIES as the users and MyCity as the project.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;From there you can locate and open each of the UCF files and add a couple of new variables which will be used by the named expressions to drive the interface items.&amp;nbsp; In this example, MYCITY_ENG is for the Engineering user and MYCITY_FAC is for the facilities user.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 2:&amp;nbsp; Define variables &lt;/b&gt;&lt;/p&gt;
&lt;p&gt;In the UCF file for the Engineering, we define MYCITY_ENG=1 and MYCITY_FAC=2 while the variables for the facilities user would be the exact opposite (MYCITY_ENG=2 and MYCITY_FAC=1).&amp;nbsp; Note, setting a variable to 1 is True, and when setting it to any value other than 1 is recognized as &amp;quot;False&amp;quot; when dealing with named expressions.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 3:&amp;nbsp; Create named expressions&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Back in the MicroStation Manager, navigate to the DGNLIB folder and create a new file to hold the named expression definitions.&amp;nbsp; Note that this is optional, if you prefer you can add them to any dgnlib that&amp;#39;s in a location pointed to by MS_DGNLIBLIST.&lt;/p&gt;
&lt;p&gt;In the File Open dialog, ensure that you&amp;#39;re set to the new ENGINEERING user and the MyCity project.&amp;nbsp; Then open the dgnlib that will hold the named expressions and select &lt;i&gt;Utilities &amp;gt; Named Expressions&lt;/i&gt;.&amp;nbsp; The resulting dialog is used to define and manage named expressions in the active DGN library.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The next step is to create two named expressions that test for the presence of the variables created above.&amp;nbsp; To do that, click on the New button and enter the following information.&lt;/p&gt;
&lt;p&gt;Internal Name - sets the name of the named expression:&amp;nbsp; MyCity_ENG&lt;/p&gt;
&lt;p&gt;External Name - sets the text label that appears in the user interface to describe the test that will be applied when evaluating the named expression:&amp;nbsp; MyCity ENGINEERING &lt;/p&gt;
&lt;p&gt;Description:&amp;nbsp; Is this user in Engineering Services?&lt;/p&gt;
&lt;p&gt;Keywords - enables the named expression to be used in specific areas:&amp;nbsp; File, Task, Tool, User Interface&lt;/p&gt;
&lt;p&gt;Symbol Sets - defines the values and properties of the named expression:&amp;nbsp; ConfigVar &lt;/p&gt;
&lt;p&gt;Expression - is the text string that&amp;#39;s to be evaluated. The expression is a single-line statement that contains symbols and operators: &amp;nbsp;&amp;nbsp;ConfigVar.GetExpandedConfigVar(&amp;quot;MYCITY_ENG&amp;quot;)=1&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 4:&amp;nbsp; Test expressions&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Since you&amp;#39;re using the ENGINEERING workspace, the test button should return &lt;i&gt;True.&amp;nbsp; &lt;/i&gt;This makes sense since the variable MyCity_ENG is set to 1 in the UCF file.&amp;nbsp; This named expression will be used to control the display an ENGEERING User task that will be created in the next section.&lt;/p&gt;
&lt;p&gt;You can repeat these steps to create a second named expression for MyCity_FAC.&amp;nbsp; Testing this variable returns false since the variable is not set to 1.&amp;nbsp; This named expression will be used to control the display of a FACILITIES User task that will be created later.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;To determine what the expression should be, select &lt;i&gt;Utilities &amp;gt; Report Symbols &lt;/i&gt;which opens expression_symbols.html in your browser.&amp;nbsp;&amp;nbsp; This is an index of available expression symbols that includes information such as the syntax to use, the description and an example.&amp;nbsp; The symbol being used in this exercise is &lt;i&gt;ConfigVar, &lt;/i&gt;which has four available expressions&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;ExpandConfigVar - returns string where all MicroStation configuration variables are expanded.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;GetExpandedConfigVar - returns the expanded variable.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;GetUnexpandedConfigVar - returns unexpanded variables.&lt;/p&gt;
&lt;p&gt;IsConfigVarDefined - returns true if the variable is defined.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;The named expressions can now be used for creating a show/hide test for tasks, tools, and other interface items.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;In this tutorial we&amp;#39;ll be creating two tasks:&lt;/p&gt;
&lt;p&gt;&lt;i&gt;ENGINEERING User&lt;/i&gt; which contains specific tasks for Engineering Services users, and&lt;/p&gt;
&lt;p&gt;&lt;i&gt;FACILITIES User&lt;/i&gt; which contains tasks for the Facility Maintenance users.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;The availability of these tasks will be driven by a Show/Hide test using the named expressions created earlier.&amp;nbsp; Let&amp;#39;s take a closer look.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 5:&amp;nbsp; Create UI dgnlib&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Start by creating a new DGN library to hold the interface customizations.&amp;nbsp; You&amp;#39;ll want to put this file in the projects .../dgnlib/ folder so it will be found by MS_DGNLIBLIST. &amp;nbsp;Note that this is defined at the project level, so all customizations in this dgnlib file will be read by all user workspaces using this project.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 6:&amp;nbsp; Create user tools and tasks&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Once open, navigate to the Customize dialog and create several new tool boxes under User Tools.&amp;nbsp; In this example, I created the following tool boxes and populated them with relevant tools:&amp;nbsp; Annotation, Display, Draw, Measure, Modify, and Publishing.&amp;nbsp; &amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Once the User Tools have been created, go to the &lt;i&gt;Tasks&lt;/i&gt; pane and create a new task called &lt;i&gt;ENGINEERING User&lt;/i&gt;.&amp;nbsp; You can then populate this task with some or all of the user tools created above.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;Likewise, create a new task called &lt;i&gt;FACILITIES User&lt;/i&gt; and populate this task with some of the user tools.&amp;nbsp; &amp;nbsp;&amp;nbsp;Since MicroStation builds the interface on-the-fly, you can easily verify your UI design as you go. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 7:&amp;nbsp; Add Show/Hide test&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Tasks and workflows have a variety of properties that are defined in the Tool Container pane of the Customize dialog.&amp;nbsp; One of available properties is a &lt;i&gt;Show/Hide Test&lt;/i&gt; which determines whether the item is displayed in the Tasks dialog.&amp;nbsp; The tests are based on named expressions, and since we&amp;#39;ve already created those in Step 3, we can now define these tests.&lt;/p&gt;
&lt;p&gt;In the Customize dialog, highlight &lt;i&gt;ENGINEERING User&lt;/i&gt; in the Tasks pane, and note the available properties in the Tool Container.&amp;nbsp; Since there is no Show/Hide test, add one via the right click menu. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Select the drop-down of the new Show/Hide test item and choose &lt;i&gt;MyCity ENGINEERING&lt;/i&gt; from the pop-up dialog.&amp;nbsp; At this time you may also want to click the Test button to ensure it returns True.&amp;nbsp; (Remember, your active user workspace is ENGINEERING therefore MyCity_ENG = 1.)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Do the same for the &lt;i&gt;FACILITIES User&lt;/i&gt; task. Choose &lt;i&gt;MyCity FACILITIES&lt;/i&gt; from the available named expressions and verify that the test returns False.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;You&amp;#39;ll also notice that the FACILITIES User task has now been removed from the Tasks dialog on the interface!&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 8:&amp;nbsp; Test &lt;/b&gt;&lt;/p&gt;
&lt;p&gt;To further test this, close MicroStation and change the workspace to FACILITIES/MyCity.&amp;nbsp; Open any file and notice that you only have the FACILITIES User in the task dialog.&lt;/p&gt;
&lt;p&gt;Close MicroStation and change the workspace to ENGINEERING/MyCity.&amp;nbsp; This time, only the ENGINEERING User task is made available in the interface. &lt;/p&gt;
&lt;p&gt;The obvious benefit of the method is that CAD Administrators can maintain a single DGNLIB for all customizations and simply use Named Expressions to turn on or off tasks.&amp;nbsp; &amp;nbsp;In this case, we used a simple configuration variable to drive the show/hide test.&lt;/p&gt;
&lt;p&gt;The following content explores how to add the ENGINEERING User and FACILITIES User to the right click menu.&amp;nbsp; Since this customization will also use a Show/Hide test based on the named expressions, the right click menu will change its content based upon the active workspace. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 9:&amp;nbsp; Add ENGINEERING and FACILITIES to right-click &amp;nbsp;menu&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Using either the Engineering or Facilities workspace, and the MyCity project, re-open the UI dgnlib and navigate back to the customize dialog.&lt;/p&gt;
&lt;p&gt;Then go to the &lt;i&gt;Context Menus &lt;/i&gt;pane and add two new items, one for ENGINEERING and the other for FACILITIES.&amp;nbsp; Add the appropriate Show/Hide Test and finally populate the items with the desired user tools as shown.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Testing this is going to produce similar results to the tasks.&amp;nbsp; When the workspace is set to ENGINEERING/MyCity, the right-click menu will show the ENGINEERING User content, and when the workspace is set to FACILITIES/MyCity, it flip for the FACILITIES User.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 10:&amp;nbsp; Add Switch User item to the right-click menu&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;As a final touch to the right-click menu, let&amp;#39;s add a Switch User item that performs the following tasks:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Show tasks from both the engineering and facilities users.&lt;/li&gt;
&lt;li&gt;Show only the ENGINEERING User tasks.&lt;/li&gt;
&lt;li&gt;Show only the FACILITIES User tasks&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;To do that, add a new menu called &lt;i&gt;Switch User &lt;/i&gt;in the Context Menu.&amp;nbsp; Then add three menu items that execute the following MicroStation key ins:&amp;nbsp; &lt;/p&gt;
&lt;p&gt;Show Both Users:&amp;nbsp; expand set MYCITY_ENG = 1;expand set MYCITY_FAC = 1;task reload&lt;/p&gt;
&lt;p&gt;ENGINEERING:&amp;nbsp; expand set MYCITY_ENG = 1;expand set MYCITY_FAC = 2;task reload&lt;/p&gt;
&lt;p&gt;FACILITIES:&amp;nbsp; expand set MYCITY_ENG = 2;expand set MYCITY_FAC = 1;task reload&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;To finish this off, let&amp;#39;s take a quick look at the keyins:&lt;/p&gt;
&lt;p&gt;Expand set sets a temporary configuration variable for the active design session.&lt;/p&gt;
&lt;p&gt;Task reload, does exactly what it implies - it reloads all of the tasks.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This tutorial is only a small sampling of what can be done with named expressions, and with a little curiosity and creativity the possibilities are seemingly endless.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;Thanks for reading and have fun!&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Related Link:&lt;/p&gt;
&lt;p&gt;&lt;a href="/communities/other_communities/askinga/w/askinga/set-temporary-variables-with-the-expand-set-keyin.aspx"&gt;http://communities.bentley.com/communities/other_communities/askinga/w/askinga/set-temporary-variables-with-the-expand-set-keyin.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;
</description></item><item><title>Using Named Expressions to drive interface items – A sample	</title><link>https://communities.bentley.com/products/microstation/w/askinga/4541/using-named-expressions-to-drive-interface-items-a-sample/revision/11</link><pubDate>Tue, 02 Nov 2010 18:54:23 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:5bae2907-f0ef-4c23-8c9a-213531402e1d</guid><dc:creator>Inga Morozoff</dc:creator><comments>https://communities.bentley.com/products/microstation/w/askinga/4541/using-named-expressions-to-drive-interface-items-a-sample#comments</comments><description>Revision 11 posted to [Archived] AskInga Wiki by Inga Morozoff on 11/2/2010 6:54:23 PM&lt;br /&gt;
&lt;p&gt;&lt;img height="76" width="230" src="/askIngaPics/askingalogo.gif" alt="AskInga logo" border="0" title="AskInga" /&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;div&gt;&lt;/div&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;
</description></item><item><title>Using Named Expressions to drive interface items – A sample	</title><link>https://communities.bentley.com/products/microstation/w/askinga/4541/using-named-expressions-to-drive-interface-items-a-sample/revision/10</link><pubDate>Tue, 02 Nov 2010 18:52:46 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:5bae2907-f0ef-4c23-8c9a-213531402e1d</guid><dc:creator>Inga Morozoff</dc:creator><comments>https://communities.bentley.com/products/microstation/w/askinga/4541/using-named-expressions-to-drive-interface-items-a-sample#comments</comments><description>Revision 10 posted to [Archived] AskInga Wiki by Inga Morozoff on 11/2/2010 6:52:46 PM&lt;br /&gt;
&lt;p&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;img height="76" width="230" src="/askIngaPics/askingalogo.gif" alt="AskInga logo" border="0" title="AskInga" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Using Named Expressions to drive interface items - A Sample&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;With thanks to Bentley&amp;#39;s Sam Hendrick for this article suggestion and content.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;By now you&amp;#39;ve heard and read about &lt;i&gt;Named Expressions&lt;/i&gt;, but might not have had the inspiration to experiment with them.&amp;nbsp; If this describes you, then the following tutorial might be just what you need to kick-start your learning and exploration of Named Expressions.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Named expressions can be used with the Customize utility to perform the following tasks:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;define rules that control when a tool is available, &lt;/li&gt;
&lt;li&gt;define rules to control when a task is available and to ,&lt;/li&gt;
&lt;li&gt;define rules for right-click context menus, such as conditions under which a context menu item is hidden.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;nbsp;Knowing this, we&amp;#39;ll use a couple of named expressions to load a different user interface depending upon the value of configuration variables defined in a pair UCF files &lt;/p&gt;
&lt;p&gt;&amp;nbsp;The following instructions can be used as a guide to work through this tutorial.&amp;nbsp; Of course this is just a sample workflow, what you employ to create your customized interface may differ.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 1:&amp;nbsp; Create two UCFs and one PCF&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Using the File Open dialog, or what us old-timers still call the MicroStation Manager dialog, create two new users and one new project.&amp;nbsp; In this example, I&amp;#39;m using ENGINEERING and FACILITIES as the users and MyCity as the project.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;mso-bidi-font-size:14.0pt;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:verdana,geneva;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;mso-bidi-font-size:14.0pt;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:verdana,geneva;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="line-height:115%;mso-bidi-font-size:14.0pt;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:verdana,geneva;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2086.new-user.jpg" border="0" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;From there you can locate and open each of the UCF files and add a couple of new variables which will be used by the named expressions to drive the interface items.&amp;nbsp; In this example, MYCITY_ENG is for the Engineering user and MYCITY_FAC is for the facilities user.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 2:&amp;nbsp; Define variables &lt;/b&gt;&lt;/p&gt;
&lt;p&gt;In the UCF file for the Engineering, we define MYCITY_ENG=1 and MYCITY_FAC=2 while the variables for the facilities user would be the exact opposite (MYCITY_ENG=2 and MYCITY_FAC=1).&amp;nbsp; Note, setting a variable to 1 is True, and when setting it to any value other than 1 is recognized as &amp;quot;False&amp;quot; when dealing with named expressions.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/3113.facucf.jpg" border="0" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 3:&amp;nbsp; Create named expressions&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Back in the MicroStation Manager, navigate to the DGNLIB folder and create a new file to hold the named expression definitions.&amp;nbsp; Note that this is optional, if you prefer you can add them to any dgnlib that&amp;#39;s in a location pointed to by MS_DGNLIBLIST.&lt;/p&gt;
&lt;p class="MsoNormal"&gt;In the File Open dialog, ensure that you&amp;#39;re set to the new ENGINEERING user and the MyCity project.&amp;nbsp; Then open the dgnlib that will hold the named expressions and select &lt;i&gt;Utilities &amp;gt; Named Expressions&lt;/i&gt;.&amp;nbsp; The resulting dialog is used to define and manage named expressions in the active DGN library.&lt;/p&gt;
&lt;p&gt;&lt;span style="line-height:115%;font-size:12pt;mso-ansi-language:EN-US;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;mso-ansi-language:EN-US;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;mso-ansi-language:EN-US;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;mso-ansi-language:EN-US;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;mso-ansi-language:EN-US;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;mso-ansi-language:EN-US;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/3386.Named-Expresssion-dialog.jpg" border="0" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;mso-bidi-font-size:14.0pt;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:verdana,geneva;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;mso-bidi-font-size:14.0pt;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:verdana,geneva;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="line-height:115%;mso-bidi-font-size:14.0pt;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:verdana,geneva;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;The next step is to create two named expressions that test for the presence of the variables created above.&amp;nbsp; To do that, click on the New button and enter the following information.&lt;/p&gt;
&lt;p&gt;Internal Name - sets the name of the named expression:&amp;nbsp; &lt;em&gt;MyCity_ENG&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;External Name - sets the text label that appears in the user interface to describe the test that will be applied when evaluating the named expression:&amp;nbsp; &lt;em&gt;MyCity ENGINEERING &lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Description:&amp;nbsp; &lt;em&gt;Is this user in Engineering Services?&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Keywords - enables the named expression to be used in specific areas:&amp;nbsp; &lt;em&gt;File, Task, Tool, User Interface&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Symbol Sets - defines the values and properties of the named expression:&amp;nbsp; &lt;em&gt;ConfigVar&lt;/em&gt; &lt;/p&gt;
&lt;p&gt;Expression - is the text string that&amp;#39;s to be evaluated. The expression is a single-line statement that contains symbols and operators: &amp;nbsp;&amp;nbsp;&lt;em&gt;ConfigVar.GetExpandedConfigVar(&amp;quot;MYCITY_ENG&amp;quot;)=1&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 4:&amp;nbsp; Test expressions&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Since you&amp;#39;re using the ENGINEERING workspace, the test button should return &lt;i&gt;True.&amp;nbsp; &lt;/i&gt;This makes sense since the variable MyCity_ENG is set to 1 in the UCF file.&amp;nbsp; This named expression will be used to control the display an ENGEERING User task that will be created in the next section.&lt;/p&gt;
&lt;p class="MsoNormal"&gt;You can repeat these steps to create a second named expression for MyCity_FAC.&amp;nbsp; Testing this variable returns false since the variable is not set to 1.&amp;nbsp; This named expression will be used to control the display of a FACILITIES User task that will be created later.&amp;nbsp;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2821.fale.jpg" border="0" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;
&lt;p&gt;To determine what the expression should be, select &lt;i&gt;Utilities &amp;gt; Report Symbols &lt;/i&gt;which opens expression_symbols.html in your browser.&amp;nbsp;&amp;nbsp; This is an index of available expression symbols that includes information such as the syntax to use, the description and an example.&amp;nbsp; The symbol being used in this exercise is &lt;i&gt;ConfigVar, &lt;/i&gt;which has four available expressions&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;ExpandConfigVar&lt;/em&gt; - returns string where all MicroStation configuration variables are expanded.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&lt;em&gt;GetExpandedConfigVar&lt;/em&gt; - returns the expanded variable.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;GetUnexpandedConfigVar&lt;/em&gt; - returns unexpanded variables.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;IsConfigVarDefined&lt;/em&gt; - returns true if the variable is defined.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;The named expressions can now be used for creating a show/hide test for tasks, tools, and other interface items.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;In this tutorial we&amp;#39;ll be creating two tasks:&lt;/p&gt;
&lt;p&gt;&lt;i&gt;ENGINEERING User&lt;/i&gt; which contains specific tasks for Engineering Services users, and&lt;/p&gt;
&lt;p&gt;&lt;i&gt;FACILITIES User&lt;/i&gt; which contains tasks for the Facility Maintenance users.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;The availability of these tasks will be driven by a Show/Hide test using the named expressions created earlier.&amp;nbsp; Let&amp;#39;s take a closer look.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 5:&amp;nbsp; Create UI dgnlib&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Start by creating a new DGN library to hold the interface customizations.&amp;nbsp; You&amp;#39;ll want to put this file in the projects .../dgnlib/ folder so it will be found by MS_DGNLIBLIST. &amp;nbsp;Note that this is defined at the project level, so all customizations in this dgnlib file will be read by all user workspaces using this project.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 6:&amp;nbsp; Create user tools and tasks&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Once open, navigate to the Customize dialog and create several new tool boxes under User Tools.&amp;nbsp; In this example, I created the following tool boxes and populated them with relevant tools:&amp;nbsp; &lt;em&gt;Annotation, Display, Draw, Measure, Modify, and Publishing.&lt;/em&gt;&amp;nbsp; &amp;nbsp;&lt;/p&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span style="line-height:115%;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:12pt;mso-ansi-language:EN-US;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;em&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:12pt;mso-ansi-language:EN-US;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;em&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/3515.User-Tools.jpg" border="0" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:12pt;mso-ansi-language:EN-US;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;em&gt;&lt;span style="mso-spacerun:yes;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:12pt;mso-ansi-language:EN-US;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;em&gt;&lt;span style="mso-spacerun:yes;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:12pt;mso-ansi-language:EN-US;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;span style="mso-spacerun:yes;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Once the User Tools have been created, go to the &lt;i&gt;Tasks&lt;/i&gt; pane and create a new task called &lt;i&gt;ENGINEERING User&lt;/i&gt;.&amp;nbsp; You can then populate this task with some or all of the user tools created above.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;Likewise, create a new task called &lt;i&gt;FACILITIES User&lt;/i&gt; and populate this task with some of the user tools.&amp;nbsp; &amp;nbsp;&amp;nbsp;Since MicroStation builds the interface on-the-fly, you can easily verify your UI design as you go. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2570.fac.jpg" border="0" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span style="line-height:115%;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/1050.Add-test.jpg" border="0" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:12pt;mso-ansi-language:EN-US;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;em&gt;&lt;span style="mso-spacerun:yes;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:12pt;"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Select the drop-down of the new Show/Hide test item and choose &lt;i&gt;MyCity ENGINEERING&lt;/i&gt; from the pop-up dialog.&amp;nbsp; At this time you may also want to click the Test button to ensure it returns True.&amp;nbsp; (Remember, your active user workspace is ENGINEERING therefore MyCity_ENG = 1.)&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2287.showhidepick.jpg" border="0" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Do the same for the &lt;i&gt;FACILITIES User&lt;/i&gt; task. Choose &lt;i&gt;MyCity FACILITIES&lt;/i&gt; from the available named expressions and verify that the test returns False.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;You&amp;#39;ll also notice that the FACILITIES User task has now been removed from the Tasks dialog on the interface!&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 8:&amp;nbsp; Test &lt;/b&gt;&lt;/p&gt;
&lt;p&gt;To further test this, close MicroStation and change the workspace to FACILITIES/MyCity.&amp;nbsp; Open any file and notice that you only have the FACILITIES User in the task dialog.&lt;/p&gt;
&lt;p class="MsoNormal"&gt;Close MicroStation and change the workspace to ENGINEERING/MyCity.&amp;nbsp; This time, only the ENGINEERING User task is made available in the interface. &lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;The obvious benefit of the method is that CAD Administrators can maintain a single DGNLIB for all customizations and simply use Named Expressions to turn on or off tasks.&amp;nbsp; &amp;nbsp;In this case, we used a simple configuration variable to drive the show/hide test.&lt;/p&gt;
&lt;p&gt;The following content explores how to add the ENGINEERING User and FACILITIES User to the right click menu.&amp;nbsp; Since this customization will also use a Show/Hide test based on the named expressions, the right click menu will change its content based upon the active workspace. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 9:&amp;nbsp; Add ENGINEERING and FACILITIES to right-click &amp;nbsp;menu&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Using either the Engineering or Facilities workspace, and the MyCity project, re-open the UI dgnlib and navigate back to the customize dialog.&lt;/p&gt;
&lt;p class="MsoNormal"&gt;Then go to the &lt;i&gt;Context Menus &lt;/i&gt;pane and add two new items, one for ENGINEERING and the other for FACILITIES.&amp;nbsp; Add the appropriate Show/Hide Test and finally populate the items with the desired user tools as shown.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:12pt;"&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2248.Context-Menu.jpg" border="0" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2308.rightclickeng.jpg" border="0" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/0317.bonus.jpg" border="0" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:12pt;"&gt;&lt;em&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:12pt;"&gt;&lt;em&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/0042._3B00_lk.jpg" border="0" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;To finish this off, let&amp;#39;s take a quick look at the keyins:&lt;/p&gt;
&lt;p&gt;Expand set sets a temporary configuration variable for the active design session.&lt;/p&gt;
&lt;p&gt;Task reload, does exactly what it implies - it reloads all of the tasks.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This tutorial is only a small sampling of what can be done with named expressions, and with a little curiosity and creativity the possibilities are seemingly endless.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;Thanks for reading and have fun!&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Related Link:&lt;/p&gt;
&lt;p&gt;&lt;a href="/communities/other_communities/askinga/w/askinga/set-temporary-variables-with-the-expand-set-keyin.aspx"&gt;http://communities.bentley.com/communities/other_communities/askinga/w/askinga/set-temporary-variables-with-the-expand-set-keyin.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;/p&gt;
&lt;p&gt;To do that, add a new menu called &lt;i&gt;Switch User &lt;/i&gt;in the Context Menu.&amp;nbsp; Then add three menu items that execute the following MicroStation key ins:&amp;nbsp; &lt;/p&gt;
&lt;p&gt;Show Both Users:&amp;nbsp; expand set MYCITY_ENG = 1;expand set MYCITY_FAC = 1;task reload&lt;/p&gt;
&lt;p&gt;ENGINEERING:&amp;nbsp; expand set MYCITY_ENG = 1;expand set MYCITY_FAC = 2;task reload&lt;/p&gt;
&lt;p&gt;FACILITIES:&amp;nbsp; expand set MYCITY_ENG = 2;expand set MYCITY_FAC = 1;task reload&lt;/p&gt;
&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 10:&amp;nbsp; Add Switch User item to the right-click menu&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;As a final touch to the right-click menu, let&amp;#39;s add a Switch User item that performs the following tasks:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Show tasks from both the engineering and facilities users.&lt;/li&gt;
&lt;li&gt;Show only the ENGINEERING User tasks.&lt;/li&gt;
&lt;li&gt;Show only the FACILITIES User tasks&lt;/li&gt;
&lt;/ul&gt;
&lt;/p&gt;
&lt;p&gt;Testing this is going to produce similar results to the tasks.&amp;nbsp; When the workspace is set to ENGINEERING/MyCity, the right-click menu will show the ENGINEERING User content, and when the workspace is set to FACILITIES/MyCity, it flip for the FACILITIES User.&lt;/p&gt;
&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 7:&amp;nbsp; Add Show/Hide test&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Tasks and workflows have a variety of properties that are defined in the Tool Container pane of the Customize dialog.&amp;nbsp; One of available properties is a &lt;i&gt;Show/Hide Test&lt;/i&gt; which determines whether the item is displayed in the Tasks dialog.&amp;nbsp; The tests are based on named expressions, and since we&amp;#39;ve already created those in Step 3, we can now define these tests.&lt;/p&gt;
&lt;p class="MsoNormal"&gt;In the Customize dialog, highlight &lt;i&gt;ENGINEERING User&lt;/i&gt; in the Tasks pane, and note the available properties in the Tool Container.&amp;nbsp; Since there is no Show/Hide test, add one via the right click menu.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;
</description></item><item><title>Using Named Expressions to drive interface items – A sample	</title><link>https://communities.bentley.com/products/microstation/w/askinga/4541/using-named-expressions-to-drive-interface-items-a-sample/revision/9</link><pubDate>Tue, 02 Nov 2010 18:50:04 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:5bae2907-f0ef-4c23-8c9a-213531402e1d</guid><dc:creator>Inga Morozoff</dc:creator><comments>https://communities.bentley.com/products/microstation/w/askinga/4541/using-named-expressions-to-drive-interface-items-a-sample#comments</comments><description>Revision 9 posted to [Archived] AskInga Wiki by Inga Morozoff on 11/2/2010 6:50:04 PM&lt;br /&gt;
&lt;p&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;img height="76" width="230" src="/askIngaPics/askingalogo.gif" alt="AskInga logo" border="0" title="AskInga" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Using Named Expressions to drive interface items - A Sample&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;With thanks to Bentley&amp;#39;s Sam Hendrick for this article suggestion and content.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;By now you&amp;#39;ve heard and read about &lt;i&gt;Named Expressions&lt;/i&gt;, but might not have had the inspiration to experiment with them.&amp;nbsp; If this describes you, then the following tutorial might be just what you need to kick-start your learning and exploration of Named Expressions.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Named expressions can be used with the Customize utility to perform the following tasks:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;define rules that control when a tool is available, &lt;/li&gt;
&lt;li&gt;define rules to control when a task is available and to ,&lt;/li&gt;
&lt;li&gt;define rules for right-click context menus, such as conditions under which a context menu item is hidden.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;nbsp;Knowing this, we&amp;#39;ll use a couple of named expressions to load a different user interface depending upon the value of configuration variables defined in a pair UCF files &lt;/p&gt;
&lt;p&gt;&amp;nbsp;The following instructions can be used as a guide to work through this tutorial.&amp;nbsp; Of course this is just a sample workflow, what you employ to create your customized interface may differ.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 1:&amp;nbsp; Create two UCFs and one PCF&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Using the File Open dialog, or what us old-timers still call the MicroStation Manager dialog, create two new users and one new project.&amp;nbsp; In this example, I&amp;#39;m using ENGINEERING and FACILITIES as the users and MyCity as the project.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;mso-bidi-font-size:14.0pt;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:verdana,geneva;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;mso-bidi-font-size:14.0pt;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:verdana,geneva;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="line-height:115%;mso-bidi-font-size:14.0pt;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:verdana,geneva;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2086.new-user.jpg" border="0" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;From there you can locate and open each of the UCF files and add a couple of new variables which will be used by the named expressions to drive the interface items.&amp;nbsp; In this example, MYCITY_ENG is for the Engineering user and MYCITY_FAC is for the facilities user.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 2:&amp;nbsp; Define variables &lt;/b&gt;&lt;/p&gt;
&lt;p&gt;In the UCF file for the Engineering, we define MYCITY_ENG=1 and MYCITY_FAC=2 while the variables for the facilities user would be the exact opposite (MYCITY_ENG=2 and MYCITY_FAC=1).&amp;nbsp; Note, setting a variable to 1 is True, and when setting it to any value other than 1 is recognized as &amp;quot;False&amp;quot; when dealing with named expressions.&lt;/p&gt;
&lt;p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/3113.facucf.jpg" border="0" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 3:&amp;nbsp; Create named expressions&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Back in the MicroStation Manager, navigate to the DGNLIB folder and create a new file to hold the named expression definitions.&amp;nbsp; Note that this is optional, if you prefer you can add them to any dgnlib that&amp;#39;s in a location pointed to by MS_DGNLIBLIST.&lt;/p&gt;
&lt;p class="MsoNormal"&gt;In the File Open dialog, ensure that you&amp;#39;re set to the new ENGINEERING user and the MyCity project.&amp;nbsp; Then open the dgnlib that will hold the named expressions and select &lt;i&gt;Utilities &amp;gt; Named Expressions&lt;/i&gt;.&amp;nbsp; The resulting dialog is used to define and manage named expressions in the active DGN library.&lt;/p&gt;
&lt;p&gt;&lt;span style="line-height:115%;font-size:12pt;mso-ansi-language:EN-US;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;mso-ansi-language:EN-US;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;mso-ansi-language:EN-US;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;mso-ansi-language:EN-US;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;mso-ansi-language:EN-US;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;mso-ansi-language:EN-US;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/3386.Named-Expresssion-dialog.jpg" border="0" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;mso-bidi-font-size:14.0pt;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:verdana,geneva;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;mso-bidi-font-size:14.0pt;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:verdana,geneva;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="line-height:115%;mso-bidi-font-size:14.0pt;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:verdana,geneva;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;The next step is to create two named expressions that test for the presence of the variables created above.&amp;nbsp; To do that, click on the New button and enter the following information.&lt;/p&gt;
&lt;p&gt;Internal Name - sets the name of the named expression:&amp;nbsp; &lt;em&gt;MyCity_ENG&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;External Name - sets the text label that appears in the user interface to describe the test that will be applied when evaluating the named expression:&amp;nbsp; &lt;em&gt;MyCity ENGINEERING &lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Description:&amp;nbsp; &lt;em&gt;Is this user in Engineering Services?&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Keywords - enables the named expression to be used in specific areas:&amp;nbsp; &lt;em&gt;File, Task, Tool, User Interface&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Symbol Sets - defines the values and properties of the named expression:&amp;nbsp; &lt;em&gt;ConfigVar&lt;/em&gt; &lt;/p&gt;
&lt;p&gt;Expression - is the text string that&amp;#39;s to be evaluated. The expression is a single-line statement that contains symbols and operators: &amp;nbsp;&amp;nbsp;&lt;em&gt;ConfigVar.GetExpandedConfigVar(&amp;quot;MYCITY_ENG&amp;quot;)=1&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 4:&amp;nbsp; Test expressions&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Since you&amp;#39;re using the ENGINEERING workspace, the test button should return &lt;i&gt;True.&amp;nbsp; &lt;/i&gt;This makes sense since the variable MyCity_ENG is set to 1 in the UCF file.&amp;nbsp; This named expression will be used to control the display an ENGEERING User task that will be created in the next section.&lt;/p&gt;
&lt;p class="MsoNormal"&gt;You can repeat these steps to create a second named expression for MyCity_FAC.&amp;nbsp; Testing this variable returns false since the variable is not set to 1.&amp;nbsp; This named expression will be used to control the display of a FACILITIES User task that will be created later.&amp;nbsp;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2821.fale.jpg" border="0" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;
&lt;p&gt;To determine what the expression should be, select &lt;i&gt;Utilities &amp;gt; Report Symbols &lt;/i&gt;which opens expression_symbols.html in your browser.&amp;nbsp;&amp;nbsp; This is an index of available expression symbols that includes information such as the syntax to use, the description and an example.&amp;nbsp; The symbol being used in this exercise is &lt;i&gt;ConfigVar, &lt;/i&gt;which has four available expressions&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;ExpandConfigVar - returns string where all MicroStation configuration variables are expanded.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;GetExpandedConfigVar - returns the expanded variable.&lt;/p&gt;
&lt;p&gt;GetUnexpandedConfigVar - returns unexpanded variables.&lt;/p&gt;
&lt;p&gt;IsConfigVarDefined - returns true if the variable is defined.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;The named expressions can now be used for creating a show/hide test for tasks, tools, and other interface items.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;In this tutorial we&amp;#39;ll be creating two tasks:&lt;/p&gt;
&lt;p&gt;&lt;i&gt;ENGINEERING User&lt;/i&gt; which contains specific tasks for Engineering Services users, and&lt;/p&gt;
&lt;p&gt;&lt;i&gt;FACILITIES User&lt;/i&gt; which contains tasks for the Facility Maintenance users.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;The availability of these tasks will be driven by a Show/Hide test using the named expressions created earlier.&amp;nbsp; Let&amp;#39;s take a closer look.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 5:&amp;nbsp; Create UI dgnlib&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Start by creating a new DGN library to hold the interface customizations.&amp;nbsp; You&amp;#39;ll want to put this file in the projects .../dgnlib/ folder so it will be found by MS_DGNLIBLIST. &amp;nbsp;Note that this is defined at the project level, so all customizations in this dgnlib file will be read by all user workspaces using this project.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 6:&amp;nbsp; Create user tools and tasks&lt;/b&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;Once open, navigate to the Customize dialog and create several new tool boxes under User Tools.&amp;nbsp; In this example, I created the following tool boxes and populated them with relevant tools:&amp;nbsp; Annotation, Display, Draw, Measure, Modify, and Publishing.&lt;/p&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:x-small;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:x-small;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:12pt;mso-ansi-language:EN-US;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;em&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;span style="line-height:115%;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:12pt;mso-ansi-language:EN-US;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;em&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/3515.User-Tools.jpg" border="0" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:12pt;mso-ansi-language:EN-US;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;em&gt;&lt;span style="mso-spacerun:yes;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:12pt;mso-ansi-language:EN-US;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;em&gt;&lt;span style="mso-spacerun:yes;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:12pt;mso-ansi-language:EN-US;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;span style="mso-spacerun:yes;"&gt;&lt;/span&gt;&lt;/span&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;/p&gt;
&lt;p&gt;Once the User Tools have been created, go to the &lt;i&gt;Tasks&lt;/i&gt; pane and create a new task called &lt;i&gt;ENGINEERING User&lt;/i&gt;.&amp;nbsp; You can then populate this task with some or all of the user tools created above.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;Likewise, create a new task called &lt;i&gt;FACILITIES User&lt;/i&gt; and populate this task with some of the user tools.&amp;nbsp; &amp;nbsp;&amp;nbsp;Since MicroStation builds the interface on-the-fly, you can easily verify your UI design as you go. &lt;/p&gt;
&lt;p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2570.fac.jpg" border="0" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p&gt;&lt;span style="line-height:115%;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;
&lt;p&gt;&lt;b&gt;Step 7:&amp;nbsp; Add Show/Hide test&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Tasks and workflows have a variety of properties that are defined in the Tool Container pane of the Customize dialog.&amp;nbsp; One of available properties is a &lt;i&gt;Show/Hide Test&lt;/i&gt; which determines whether the item is displayed in the Tasks dialog.&amp;nbsp; The tests are based on named expressions, and since we&amp;#39;ve already created those in Step 3, we can now define these tests.&lt;/p&gt;
&lt;p class="MsoNormal"&gt;In the Customize dialog, highlight &lt;i&gt;ENGINEERING User&lt;/i&gt; in the Tasks pane, and note the available properties in the Tool Container.&amp;nbsp; Since there is no Show/Hide test, add one via the right click menu.&lt;/p&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/1050.Add-test.jpg" border="0" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:12pt;mso-ansi-language:EN-US;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;em&gt;&lt;span style="mso-spacerun:yes;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:12pt;"&gt;&lt;/span&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;/p&gt;
&lt;p&gt;Select the drop-down of the new Show/Hide test item and choose &lt;i&gt;MyCity ENGINEERING&lt;/i&gt; from the pop-up dialog.&amp;nbsp; At this time you may also want to click the Test button to ensure it returns True.&amp;nbsp; (Remember, your active user workspace is ENGINEERING therefore MyCity_ENG = 1.)&lt;/p&gt;
&lt;p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2287.showhidepick.jpg" border="0" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Do the same for the &lt;i&gt;FACILITIES User&lt;/i&gt; task. Choose &lt;i&gt;MyCity FACILITIES&lt;/i&gt; from the available named expressions and verify that the test returns False.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;You&amp;#39;ll also notice that the FACILITIES User task has now been removed from the Tasks dialog on the interface!&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 8:&amp;nbsp; Test &lt;/b&gt;&lt;/p&gt;
&lt;p&gt;To further test this, close MicroStation and change the workspace to FACILITIES/MyCity.&amp;nbsp; Open any file and notice that you only have the FACILITIES User in the task dialog.&lt;/p&gt;
&lt;p class="MsoNormal"&gt;Close MicroStation and change the workspace to ENGINEERING/MyCity.&amp;nbsp; This time, only the ENGINEERING User task is made available in the interface. &lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;The obvious benefit of the method is that CAD Administrators can maintain a single DGNLIB for all customizations and simply use Named Expressions to turn on or off tasks.&amp;nbsp; &amp;nbsp;In this case, we used a simple configuration variable to drive the show/hide test.&lt;/p&gt;
&lt;p&gt;The following content explores how to add the ENGINEERING User and FACILITIES User to the right click menu.&amp;nbsp; Since this customization will also use a Show/Hide test based on the named expressions, the right click menu will change its content based upon the active workspace. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 9:&amp;nbsp; Add ENGINEERING and FACILITIES to right-click &amp;nbsp;menu&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Using either the Engineering or Facilities workspace, and the MyCity project, re-open the UI dgnlib and navigate back to the customize dialog.&lt;/p&gt;
&lt;p class="MsoNormal"&gt;Then go to the &lt;i&gt;Context Menus &lt;/i&gt;pane and add two new items, one for ENGINEERING and the other for FACILITIES.&amp;nbsp; Add the appropriate Show/Hide Test and finally populate the items with the desired user tools as shown.&lt;/p&gt;
&lt;p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:12pt;"&gt;&lt;/span&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2248.Context-Menu.jpg" border="0" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;
&lt;p&gt;Testing this is going to produce similar results to the tasks.&amp;nbsp; When the workspace is set to ENGINEERING/MyCity, the right-click menu will show the ENGINEERING User content, and when the workspace is set to FACILITIES/MyCity, it flip for the FACILITIES User.&lt;/p&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt; &lt;/p&gt;
&lt;p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2308.rightclickeng.jpg" border="0" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;
&lt;p&gt;&lt;b&gt;Step 10:&amp;nbsp; Add Switch User item to the right-click menu&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;As a final touch to the right-click menu, let&amp;#39;s add a Switch User item that performs the following tasks:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Show tasks from both the engineering and facilities users.&lt;/li&gt;
&lt;li&gt;Show only the ENGINEERING User tasks.&lt;/li&gt;
&lt;li&gt;Show only the FACILITIES User tasks&lt;/li&gt;
&lt;/ul&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/0317.bonus.jpg" border="0" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;
&lt;p&gt;To do that, add a new menu called &lt;i&gt;Switch User &lt;/i&gt;in the Context Menu.&amp;nbsp; Then add three menu items that execute the following MicroStation key ins:&amp;nbsp; &lt;/p&gt;
&lt;p&gt;Show Both Users:&amp;nbsp; expand set MYCITY_ENG = 1;expand set MYCITY_FAC = 1;task reload&lt;/p&gt;
&lt;p&gt;ENGINEERING:&amp;nbsp; expand set MYCITY_ENG = 1;expand set MYCITY_FAC = 2;task reload&lt;/p&gt;
&lt;p&gt;FACILITIES:&amp;nbsp; expand set MYCITY_ENG = 2;expand set MYCITY_FAC = 1;task reload&lt;/p&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:12pt;"&gt;&lt;em&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:12pt;"&gt;&lt;em&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/0042._3B00_lk.jpg" border="0" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;To finish this off, let&amp;#39;s take a quick look at the keyins:&lt;/p&gt;
&lt;p&gt;Expand set sets a temporary configuration variable for the active design session.&lt;/p&gt;
&lt;p&gt;Task reload, does exactly what it implies - it reloads all of the tasks.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This tutorial is only a small sampling of what can be done with named expressions, and with a little curiosity and creativity the possibilities are seemingly endless.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;Thanks for reading and have fun!&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Related Link:&lt;/p&gt;
&lt;p&gt;&lt;a href="/communities/other_communities/askinga/w/askinga/set-temporary-variables-with-the-expand-set-keyin.aspx"&gt;http://communities.bentley.com/communities/other_communities/askinga/w/askinga/set-temporary-variables-with-the-expand-set-keyin.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;
</description></item><item><title>Using Named Expressions to drive interface items – A sample	</title><link>https://communities.bentley.com/products/microstation/w/askinga/4541/using-named-expressions-to-drive-interface-items-a-sample/revision/8</link><pubDate>Tue, 02 Nov 2010 18:48:34 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:5bae2907-f0ef-4c23-8c9a-213531402e1d</guid><dc:creator>Inga Morozoff</dc:creator><comments>https://communities.bentley.com/products/microstation/w/askinga/4541/using-named-expressions-to-drive-interface-items-a-sample#comments</comments><description>Revision 8 posted to [Archived] AskInga Wiki by Inga Morozoff on 11/2/2010 6:48:34 PM&lt;br /&gt;
&lt;p&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;img height="76" width="230" src="/askIngaPics/askingalogo.gif" alt="AskInga logo" border="0" title="AskInga" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Using Named Expressions to drive interface items - A Sample&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;With thanks to Bentley&amp;#39;s Sam Hendrick for this article suggestion and content.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;By now you&amp;#39;ve heard and read about &lt;i&gt;Named Expressions&lt;/i&gt;, but might not have had the inspiration to experiment with them.&amp;nbsp; If this describes you, then the following tutorial might be just what you need to kick-start your learning and exploration of Named Expressions.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Named expressions can be used with the Customize utility to perform the following tasks:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;define rules that control when a tool is available, &lt;/li&gt;
&lt;li&gt;define rules to control when a task is available and to ,&lt;/li&gt;
&lt;li&gt;define rules for right-click context menus, such as conditions under which a context menu item is hidden.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;nbsp;Knowing this, we&amp;#39;ll use a couple of named expressions to load a different user interface depending upon the value of configuration variables defined in a pair UCF files &lt;/p&gt;
&lt;p&gt;&amp;nbsp;The following instructions can be used as a guide to work through this tutorial.&amp;nbsp; Of course this is just a sample workflow, what you employ to create your customized interface may differ.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 1:&amp;nbsp; Create two UCFs and one PCF&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Using the File Open dialog, or what us old-timers still call the MicroStation Manager dialog, create two new users and one new project.&amp;nbsp; In this example, I&amp;#39;m using ENGINEERING and FACILITIES as the users and MyCity as the project.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;mso-bidi-font-size:14.0pt;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:verdana,geneva;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;mso-bidi-font-size:14.0pt;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:verdana,geneva;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="line-height:115%;mso-bidi-font-size:14.0pt;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:verdana,geneva;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2086.new-user.jpg" border="0" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;From there you can locate and open each of the UCF files and add a couple of new variables which will be used by the named expressions to drive the interface items.&amp;nbsp; In this example, MYCITY_ENG is for the Engineering user and MYCITY_FAC is for the facilities user.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 2:&amp;nbsp; Define variables &lt;/b&gt;&lt;/p&gt;
&lt;p&gt;In the UCF file for the Engineering, we define MYCITY_ENG=1 and MYCITY_FAC=2 while the variables for the facilities user would be the exact opposite (MYCITY_ENG=2 and MYCITY_FAC=1).&amp;nbsp; Note, setting a variable to 1 is True, and when setting it to any value other than 1 is recognized as &amp;quot;False&amp;quot; when dealing with named expressions.&lt;/p&gt;
&lt;p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/3113.facucf.jpg" border="0" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 3:&amp;nbsp; Create named expressions&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Back in the MicroStation Manager, navigate to the DGNLIB folder and create a new file to hold the named expression definitions.&amp;nbsp; Note that this is optional, if you prefer you can add them to any dgnlib that&amp;#39;s in a location pointed to by MS_DGNLIBLIST.&lt;/p&gt;
&lt;p class="MsoNormal"&gt;In the File Open dialog, ensure that you&amp;#39;re set to the new ENGINEERING user and the MyCity project.&amp;nbsp; Then open the dgnlib that will hold the named expressions and select &lt;i&gt;Utilities &amp;gt; Named Expressions&lt;/i&gt;.&amp;nbsp; The resulting dialog is used to define and manage named expressions in the active DGN library.&lt;/p&gt;
&lt;p&gt;&lt;span style="line-height:115%;font-size:12pt;mso-ansi-language:EN-US;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;mso-ansi-language:EN-US;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;mso-ansi-language:EN-US;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;mso-ansi-language:EN-US;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;mso-ansi-language:EN-US;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;mso-ansi-language:EN-US;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/3386.Named-Expresssion-dialog.jpg" border="0" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;mso-bidi-font-size:14.0pt;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:verdana,geneva;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;mso-bidi-font-size:14.0pt;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:verdana,geneva;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="line-height:115%;mso-bidi-font-size:14.0pt;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:verdana,geneva;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;The next step is to create two named expressions that test for the presence of the variables created above.&amp;nbsp; To do that, click on the New button and enter the following information.&lt;/p&gt;
&lt;p&gt;Internal Name - sets the name of the named expression:&amp;nbsp; MyCity_ENG&lt;/p&gt;
&lt;p&gt;External Name - sets the text label that appears in the user interface to describe the test that will be applied when evaluating the named expression:&amp;nbsp; MyCity ENGINEERING &lt;/p&gt;
&lt;p&gt;Description:&amp;nbsp; Is this user in Engineering Services?&lt;/p&gt;
&lt;p&gt;Keywords - enables the named expression to be used in specific areas:&amp;nbsp; File, Task, Tool, User Interface&lt;/p&gt;
&lt;p&gt;Symbol Sets - defines the values and properties of the named expression:&amp;nbsp; ConfigVar &lt;/p&gt;
&lt;p&gt;Expression - is the text string that&amp;#39;s to be evaluated. The expression is a single-line statement that contains symbols and operators: &amp;nbsp;&amp;nbsp;ConfigVar.GetExpandedConfigVar(&amp;quot;MYCITY_ENG&amp;quot;)=1&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 4:&amp;nbsp; Test expressions&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Since you&amp;#39;re using the ENGINEERING workspace, the test button should return &lt;i&gt;True.&amp;nbsp; &lt;/i&gt;This makes sense since the variable MyCity_ENG is set to 1 in the UCF file.&amp;nbsp; This named expression will be used to control the display an ENGEERING User task that will be created in the next section.&lt;/p&gt;
&lt;p class="MsoNormal"&gt;You can repeat these steps to create a second named expression for MyCity_FAC.&amp;nbsp; Testing this variable returns false since the variable is not set to 1.&amp;nbsp; This named expression will be used to control the display of a FACILITIES User task that will be created later.&amp;nbsp;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2821.fale.jpg" border="0" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;
&lt;p&gt;To determine what the expression should be, select &lt;i&gt;Utilities &amp;gt; Report Symbols &lt;/i&gt;which opens expression_symbols.html in your browser.&amp;nbsp;&amp;nbsp; This is an index of available expression symbols that includes information such as the syntax to use, the description and an example.&amp;nbsp; The symbol being used in this exercise is &lt;i&gt;ConfigVar, &lt;/i&gt;which has four available expressions&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;ExpandConfigVar - returns string where all MicroStation configuration variables are expanded.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;GetExpandedConfigVar - returns the expanded variable.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;GetUnexpandedConfigVar - returns unexpanded variables.&lt;/p&gt;
&lt;p&gt;IsConfigVarDefined - returns true if the variable is defined.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;The named expressions can now be used for creating a show/hide test for tasks, tools, and other interface items.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;In this tutorial we&amp;#39;ll be creating two tasks:&lt;/p&gt;
&lt;p&gt;&lt;i&gt;ENGINEERING User&lt;/i&gt; which contains specific tasks for Engineering Services users, and&lt;/p&gt;
&lt;p&gt;&lt;i&gt;FACILITIES User&lt;/i&gt; which contains tasks for the Facility Maintenance users.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;The availability of these tasks will be driven by a Show/Hide test using the named expressions created earlier.&amp;nbsp; Let&amp;#39;s take a closer look.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 5:&amp;nbsp; Create UI dgnlib&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Start by creating a new DGN library to hold the interface customizations.&amp;nbsp; You&amp;#39;ll want to put this file in the projects .../dgnlib/ folder so it will be found by MS_DGNLIBLIST. &amp;nbsp;Note that this is defined at the project level, so all customizations in this dgnlib file will be read by all user workspaces using this project.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 6:&amp;nbsp; Create user tools and tasks&lt;/b&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;Once open, navigate to the Customize dialog and create several new tool boxes under User Tools.&amp;nbsp; In this example, I created the following tool boxes and populated them with relevant tools:&amp;nbsp; Annotation, Display, Draw, Measure, Modify, and Publishing.&lt;/p&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:x-small;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:x-small;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:12pt;mso-ansi-language:EN-US;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;em&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;span style="line-height:115%;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:12pt;mso-ansi-language:EN-US;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;em&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/3515.User-Tools.jpg" border="0" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:12pt;mso-ansi-language:EN-US;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;em&gt;&lt;span style="mso-spacerun:yes;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:12pt;mso-ansi-language:EN-US;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;em&gt;&lt;span style="mso-spacerun:yes;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:12pt;mso-ansi-language:EN-US;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;span style="mso-spacerun:yes;"&gt;&lt;/span&gt;&lt;/span&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;/p&gt;
&lt;p&gt;Once the User Tools have been created, go to the &lt;i&gt;Tasks&lt;/i&gt; pane and create a new task called &lt;i&gt;ENGINEERING User&lt;/i&gt;.&amp;nbsp; You can then populate this task with some or all of the user tools created above.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;Likewise, create a new task called &lt;i&gt;FACILITIES User&lt;/i&gt; and populate this task with some of the user tools.&amp;nbsp; &amp;nbsp;&amp;nbsp;Since MicroStation builds the interface on-the-fly, you can easily verify your UI design as you go. &lt;/p&gt;
&lt;p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2570.fac.jpg" border="0" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p&gt;&lt;span style="line-height:115%;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;
&lt;p&gt;&lt;b&gt;Step 7:&amp;nbsp; Add Show/Hide test&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Tasks and workflows have a variety of properties that are defined in the Tool Container pane of the Customize dialog.&amp;nbsp; One of available properties is a &lt;i&gt;Show/Hide Test&lt;/i&gt; which determines whether the item is displayed in the Tasks dialog.&amp;nbsp; The tests are based on named expressions, and since we&amp;#39;ve already created those in Step 3, we can now define these tests.&lt;/p&gt;
&lt;p class="MsoNormal"&gt;In the Customize dialog, highlight &lt;i&gt;ENGINEERING User&lt;/i&gt; in the Tasks pane, and note the available properties in the Tool Container.&amp;nbsp; Since there is no Show/Hide test, add one via the right click menu.&lt;/p&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/1050.Add-test.jpg" border="0" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:12pt;mso-ansi-language:EN-US;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;em&gt;&lt;span style="mso-spacerun:yes;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:12pt;"&gt;&lt;/span&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;/p&gt;
&lt;p&gt;Select the drop-down of the new Show/Hide test item and choose &lt;i&gt;MyCity ENGINEERING&lt;/i&gt; from the pop-up dialog.&amp;nbsp; At this time you may also want to click the Test button to ensure it returns True.&amp;nbsp; (Remember, your active user workspace is ENGINEERING therefore MyCity_ENG = 1.)&lt;/p&gt;
&lt;p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2287.showhidepick.jpg" border="0" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Do the same for the &lt;i&gt;FACILITIES User&lt;/i&gt; task. Choose &lt;i&gt;MyCity FACILITIES&lt;/i&gt; from the available named expressions and verify that the test returns False.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;You&amp;#39;ll also notice that the FACILITIES User task has now been removed from the Tasks dialog on the interface!&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 8:&amp;nbsp; Test &lt;/b&gt;&lt;/p&gt;
&lt;p&gt;To further test this, close MicroStation and change the workspace to FACILITIES/MyCity.&amp;nbsp; Open any file and notice that you only have the FACILITIES User in the task dialog.&lt;/p&gt;
&lt;p class="MsoNormal"&gt;Close MicroStation and change the workspace to ENGINEERING/MyCity.&amp;nbsp; This time, only the ENGINEERING User task is made available in the interface. &lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;The obvious benefit of the method is that CAD Administrators can maintain a single DGNLIB for all customizations and simply use Named Expressions to turn on or off tasks.&amp;nbsp; &amp;nbsp;In this case, we used a simple configuration variable to drive the show/hide test.&lt;/p&gt;
&lt;p&gt;The following content explores how to add the ENGINEERING User and FACILITIES User to the right click menu.&amp;nbsp; Since this customization will also use a Show/Hide test based on the named expressions, the right click menu will change its content based upon the active workspace. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 9:&amp;nbsp; Add ENGINEERING and FACILITIES to right-click &amp;nbsp;menu&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Using either the Engineering or Facilities workspace, and the MyCity project, re-open the UI dgnlib and navigate back to the customize dialog.&lt;/p&gt;
&lt;p class="MsoNormal"&gt;Then go to the &lt;i&gt;Context Menus &lt;/i&gt;pane and add two new items, one for ENGINEERING and the other for FACILITIES.&amp;nbsp; Add the appropriate Show/Hide Test and finally populate the items with the desired user tools as shown.&lt;/p&gt;
&lt;p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:12pt;"&gt;&lt;/span&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2248.Context-Menu.jpg" border="0" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;
&lt;p&gt;Testing this is going to produce similar results to the tasks.&amp;nbsp; When the workspace is set to ENGINEERING/MyCity, the right-click menu will show the ENGINEERING User content, and when the workspace is set to FACILITIES/MyCity, it flip for the FACILITIES User.&lt;/p&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt; &lt;/p&gt;
&lt;p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2308.rightclickeng.jpg" border="0" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;
&lt;p&gt;&lt;b&gt;Step 10:&amp;nbsp; Add Switch User item to the right-click menu&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;As a final touch to the right-click menu, let&amp;#39;s add a Switch User item that performs the following tasks:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Show tasks from both the engineering and facilities users.&lt;/li&gt;
&lt;li&gt;Show only the ENGINEERING User tasks.&lt;/li&gt;
&lt;li&gt;Show only the FACILITIES User tasks&lt;/li&gt;
&lt;/ul&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/0317.bonus.jpg" border="0" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;
&lt;p&gt;To do that, add a new menu called &lt;i&gt;Switch User &lt;/i&gt;in the Context Menu.&amp;nbsp; Then add three menu items that execute the following MicroStation key ins:&amp;nbsp; &lt;/p&gt;
&lt;p&gt;Show Both Users:&amp;nbsp; expand set MYCITY_ENG = 1;expand set MYCITY_FAC = 1;task reload&lt;/p&gt;
&lt;p&gt;ENGINEERING:&amp;nbsp; expand set MYCITY_ENG = 1;expand set MYCITY_FAC = 2;task reload&lt;/p&gt;
&lt;p&gt;FACILITIES:&amp;nbsp; expand set MYCITY_ENG = 2;expand set MYCITY_FAC = 1;task reload&lt;/p&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:12pt;"&gt;&lt;em&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:12pt;"&gt;&lt;em&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/0042._3B00_lk.jpg" border="0" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;To finish this off, let&amp;#39;s take a quick look at the keyins:&lt;/p&gt;
&lt;p&gt;Expand set sets a temporary configuration variable for the active design session.&lt;/p&gt;
&lt;p&gt;Task reload, does exactly what it implies - it reloads all of the tasks.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This tutorial is only a small sampling of what can be done with named expressions, and with a little curiosity and creativity the possibilities are seemingly endless.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;Thanks for reading and have fun!&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Related Link:&lt;/p&gt;
&lt;p&gt;&lt;a href="/communities/other_communities/askinga/w/askinga/set-temporary-variables-with-the-expand-set-keyin.aspx"&gt;http://communities.bentley.com/communities/other_communities/askinga/w/askinga/set-temporary-variables-with-the-expand-set-keyin.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;
</description></item><item><title>Using Named Expressions to drive interface items – A sample	</title><link>https://communities.bentley.com/products/microstation/w/askinga/4541/using-named-expressions-to-drive-interface-items-a-sample/revision/7</link><pubDate>Tue, 02 Nov 2010 18:45:58 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:5bae2907-f0ef-4c23-8c9a-213531402e1d</guid><dc:creator>Inga Morozoff</dc:creator><comments>https://communities.bentley.com/products/microstation/w/askinga/4541/using-named-expressions-to-drive-interface-items-a-sample#comments</comments><description>Revision 7 posted to [Archived] AskInga Wiki by Inga Morozoff on 11/2/2010 6:45:58 PM&lt;br /&gt;
&lt;p&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;img height="76" width="230" src="/askIngaPics/askingalogo.gif" alt="AskInga logo" border="0" title="AskInga" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Using Named Expressions to drive interface items - A Sample&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;With thanks to Bentley&amp;#39;s Sam Hendrick for this article suggestion and content.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;By now you&amp;#39;ve heard and read about &lt;i&gt;Named Expressions&lt;/i&gt;, but might not have had the inspiration to experiment with them.&amp;nbsp; If this describes you, then the following tutorial might be just what you need to kick-start your learning and exploration of Named Expressions.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;Named expressions can be used with the Customize utility to perform the following tasks:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;define rules that control when a tool is available, &lt;/li&gt;
&lt;li&gt;define rules to control when a task is available and to ,&lt;/li&gt;
&lt;li&gt;define rules for right-click context menus, such as conditions under which a context menu item is hidden.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;nbsp;Knowing this, we&amp;#39;ll use a couple of named expressions to load a different user interface depending upon the value of configuration variables defined in a pair UCF files &lt;/p&gt;
&lt;p&gt;&amp;nbsp;The following instructions can be used as a guide to work through this tutorial.&amp;nbsp; Of course this is just a sample workflow, what you employ to create your customized interface may differ.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 1:&amp;nbsp; Create two UCFs and one PCF&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Using the File Open dialog, or what us old-timers still call the MicroStation Manager dialog, create two new users and one new project.&amp;nbsp; In this example, I&amp;#39;m using ENGINEERING and FACILITIES as the users and MyCity as the project.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;mso-bidi-font-size:14.0pt;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:verdana,geneva;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;mso-bidi-font-size:14.0pt;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:verdana,geneva;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="line-height:115%;mso-bidi-font-size:14.0pt;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:verdana,geneva;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2086.new-user.jpg" border="0" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;From there you can locate and open each of the UCF files and add a couple of new variables which will be used by the named expressions to drive the interface items.&amp;nbsp; In this example, MYCITY_ENG is for the Engineering user and MYCITY_FAC is for the facilities user.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 2:&amp;nbsp; Define variables &lt;/b&gt;&lt;/p&gt;
&lt;p&gt;In the UCF file for the Engineering, we define MYCITY_ENG=1 and MYCITY_FAC=2 while the variables for the facilities user would be the exact opposite (MYCITY_ENG=2 and MYCITY_FAC=1).&amp;nbsp; Note, setting a variable to 1 is True, and when setting it to any value other than 1 is recognized as &amp;quot;False&amp;quot; when dealing with named expressions.&lt;/p&gt;
&lt;p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/3113.facucf.jpg" border="0" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p&gt;&lt;span style="line-height:115%;font-size:12pt;mso-ansi-language:EN-US;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;mso-ansi-language:EN-US;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;mso-ansi-language:EN-US;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;mso-ansi-language:EN-US;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;mso-ansi-language:EN-US;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;mso-ansi-language:EN-US;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/3386.Named-Expresssion-dialog.jpg" border="0" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;mso-bidi-font-size:14.0pt;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:verdana,geneva;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;mso-bidi-font-size:14.0pt;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:verdana,geneva;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="line-height:115%;mso-bidi-font-size:14.0pt;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:verdana,geneva;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;The next step is to create two named expressions that test for the presence of the variables created above.&amp;nbsp; To do that, click on the New button and enter the following information.&lt;/p&gt;
&lt;p&gt;Internal Name - sets the name of the named expression:&amp;nbsp; MyCity_ENG&lt;/p&gt;
&lt;p&gt;External Name - sets the text label that appears in the user interface to describe the test that will be applied when evaluating the named expression:&amp;nbsp; MyCity ENGINEERING &lt;/p&gt;
&lt;p&gt;Description:&amp;nbsp; Is this user in Engineering Services?&lt;/p&gt;
&lt;p&gt;Keywords - enables the named expression to be used in specific areas:&amp;nbsp; File, Task, Tool, User Interface&lt;/p&gt;
&lt;p&gt;Symbol Sets - defines the values and properties of the named expression:&amp;nbsp; ConfigVar &lt;/p&gt;
&lt;p&gt;Expression - is the text string that&amp;#39;s to be evaluated. The expression is a single-line statement that contains symbols and operators: &amp;nbsp;&amp;nbsp;ConfigVar.GetExpandedConfigVar(&amp;quot;MYCITY_ENG&amp;quot;)=1&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 4:&amp;nbsp; Test expressions&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Since you&amp;#39;re using the ENGINEERING workspace, the test button should return &lt;i&gt;True.&amp;nbsp; &lt;/i&gt;This makes sense since the variable MyCity_ENG is set to 1 in the UCF file.&amp;nbsp; This named expression will be used to control the display an ENGEERING User task that will be created in the next section.&lt;/p&gt;
&lt;p class="MsoNormal"&gt;You can repeat these steps to create a second named expression for MyCity_FAC.&amp;nbsp; Testing this variable returns false since the variable is not set to 1.&amp;nbsp; This named expression will be used to control the display of a FACILITIES User task that will be created later.&amp;nbsp;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2821.fale.jpg" border="0" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;
&lt;p&gt;To determine what the expression should be, select &lt;i&gt;Utilities &amp;gt; Report Symbols &lt;/i&gt;which opens expression_symbols.html in your browser.&amp;nbsp;&amp;nbsp; This is an index of available expression symbols that includes information such as the syntax to use, the description and an example.&amp;nbsp; The symbol being used in this exercise is &lt;i&gt;ConfigVar, &lt;/i&gt;which has four available expressions&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;ExpandConfigVar - returns string where all MicroStation configuration variables are expanded.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;GetExpandedConfigVar - returns the expanded variable.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;GetUnexpandedConfigVar - returns unexpanded variables.&lt;/p&gt;
&lt;p&gt;IsConfigVarDefined - returns true if the variable is defined.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;The named expressions can now be used for creating a show/hide test for tasks, tools, and other interface items.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;In this tutorial we&amp;#39;ll be creating two tasks:&lt;/p&gt;
&lt;p&gt;&lt;i&gt;ENGINEERING User&lt;/i&gt; which contains specific tasks for Engineering Services users, and&lt;/p&gt;
&lt;p&gt;&lt;i&gt;FACILITIES User&lt;/i&gt; which contains tasks for the Facility Maintenance users.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;The availability of these tasks will be driven by a Show/Hide test using the named expressions created earlier.&amp;nbsp; Let&amp;#39;s take a closer look.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 5:&amp;nbsp; Create UI dgnlib&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Start by creating a new DGN library to hold the interface customizations.&amp;nbsp; You&amp;#39;ll want to put this file in the projects .../dgnlib/ folder so it will be found by MS_DGNLIBLIST. &amp;nbsp;Note that this is defined at the project level, so all customizations in this dgnlib file will be read by all user workspaces using this project.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 6:&amp;nbsp; Create user tools and tasks&lt;/b&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;Once open, navigate to the Customize dialog and create several new tool boxes under User Tools.&amp;nbsp; In this example, I created the following tool boxes and populated them with relevant tools:&amp;nbsp; Annotation, Display, Draw, Measure, Modify, and Publishing.&lt;/p&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:x-small;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:x-small;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:12pt;mso-ansi-language:EN-US;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;em&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;span style="line-height:115%;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:12pt;mso-ansi-language:EN-US;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;em&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/3515.User-Tools.jpg" border="0" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:12pt;mso-ansi-language:EN-US;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;em&gt;&lt;span style="mso-spacerun:yes;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:12pt;mso-ansi-language:EN-US;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;em&gt;&lt;span style="mso-spacerun:yes;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:12pt;mso-ansi-language:EN-US;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;span style="mso-spacerun:yes;"&gt;&lt;/span&gt;&lt;/span&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;/p&gt;
&lt;p&gt;Once the User Tools have been created, go to the &lt;i&gt;Tasks&lt;/i&gt; pane and create a new task called &lt;i&gt;ENGINEERING User&lt;/i&gt;.&amp;nbsp; You can then populate this task with some or all of the user tools created above.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;Likewise, create a new task called &lt;i&gt;FACILITIES User&lt;/i&gt; and populate this task with some of the user tools.&amp;nbsp; &amp;nbsp;&amp;nbsp;Since MicroStation builds the interface on-the-fly, you can easily verify your UI design as you go. &lt;/p&gt;
&lt;p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2570.fac.jpg" border="0" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p&gt;&lt;span style="line-height:115%;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;
&lt;p&gt;&lt;b&gt;Step 7:&amp;nbsp; Add Show/Hide test&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Tasks and workflows have a variety of properties that are defined in the Tool Container pane of the Customize dialog.&amp;nbsp; One of available properties is a &lt;i&gt;Show/Hide Test&lt;/i&gt; which determines whether the item is displayed in the Tasks dialog.&amp;nbsp; The tests are based on named expressions, and since we&amp;#39;ve already created those in Step 3, we can now define these tests.&lt;/p&gt;
&lt;p class="MsoNormal"&gt;In the Customize dialog, highlight &lt;i&gt;ENGINEERING User&lt;/i&gt; in the Tasks pane, and note the available properties in the Tool Container.&amp;nbsp; Since there is no Show/Hide test, add one via the right click menu.&lt;/p&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/1050.Add-test.jpg" border="0" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:12pt;mso-ansi-language:EN-US;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;em&gt;&lt;span style="mso-spacerun:yes;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:12pt;"&gt;&lt;/span&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;/p&gt;
&lt;p&gt;Select the drop-down of the new Show/Hide test item and choose &lt;i&gt;MyCity ENGINEERING&lt;/i&gt; from the pop-up dialog.&amp;nbsp; At this time you may also want to click the Test button to ensure it returns True.&amp;nbsp; (Remember, your active user workspace is ENGINEERING therefore MyCity_ENG = 1.)&lt;/p&gt;
&lt;p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2287.showhidepick.jpg" border="0" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Do the same for the &lt;i&gt;FACILITIES User&lt;/i&gt; task. Choose &lt;i&gt;MyCity FACILITIES&lt;/i&gt; from the available named expressions and verify that the test returns False.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;You&amp;#39;ll also notice that the FACILITIES User task has now been removed from the Tasks dialog on the interface!&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 8:&amp;nbsp; Test &lt;/b&gt;&lt;/p&gt;
&lt;p&gt;To further test this, close MicroStation and change the workspace to FACILITIES/MyCity.&amp;nbsp; Open any file and notice that you only have the FACILITIES User in the task dialog.&lt;/p&gt;
&lt;p class="MsoNormal"&gt;Close MicroStation and change the workspace to ENGINEERING/MyCity.&amp;nbsp; This time, only the ENGINEERING User task is made available in the interface. &lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;The obvious benefit of the method is that CAD Administrators can maintain a single DGNLIB for all customizations and simply use Named Expressions to turn on or off tasks.&amp;nbsp; &amp;nbsp;In this case, we used a simple configuration variable to drive the show/hide test.&lt;/p&gt;
&lt;p&gt;The following content explores how to add the ENGINEERING User and FACILITIES User to the right click menu.&amp;nbsp; Since this customization will also use a Show/Hide test based on the named expressions, the right click menu will change its content based upon the active workspace. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 9:&amp;nbsp; Add ENGINEERING and FACILITIES to right-click &amp;nbsp;menu&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Using either the Engineering or Facilities workspace, and the MyCity project, re-open the UI dgnlib and navigate back to the customize dialog.&lt;/p&gt;
&lt;p class="MsoNormal"&gt;Then go to the &lt;i&gt;Context Menus &lt;/i&gt;pane and add two new items, one for ENGINEERING and the other for FACILITIES.&amp;nbsp; Add the appropriate Show/Hide Test and finally populate the items with the desired user tools as shown.&lt;/p&gt;
&lt;p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:12pt;"&gt;&lt;/span&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2248.Context-Menu.jpg" border="0" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;
&lt;p&gt;Testing this is going to produce similar results to the tasks.&amp;nbsp; When the workspace is set to ENGINEERING/MyCity, the right-click menu will show the ENGINEERING User content, and when the workspace is set to FACILITIES/MyCity, it flip for the FACILITIES User.&lt;/p&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt; &lt;/p&gt;
&lt;p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2308.rightclickeng.jpg" border="0" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;
&lt;p&gt;&lt;b&gt;Step 10:&amp;nbsp; Add Switch User item to the right-click menu&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;As a final touch to the right-click menu, let&amp;#39;s add a Switch User item that performs the following tasks:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Show tasks from both the engineering and facilities users.&lt;/li&gt;
&lt;li&gt;Show only the ENGINEERING User tasks.&lt;/li&gt;
&lt;li&gt;Show only the FACILITIES User tasks&lt;/li&gt;
&lt;/ul&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/0317.bonus.jpg" border="0" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;
&lt;p&gt;To do that, add a new menu called &lt;i&gt;Switch User &lt;/i&gt;in the Context Menu.&amp;nbsp; Then add three menu items that execute the following MicroStation key ins:&amp;nbsp; &lt;/p&gt;
&lt;p&gt;Show Both Users:&amp;nbsp; expand set MYCITY_ENG = 1;expand set MYCITY_FAC = 1;task reload&lt;/p&gt;
&lt;p&gt;ENGINEERING:&amp;nbsp; expand set MYCITY_ENG = 1;expand set MYCITY_FAC = 2;task reload&lt;/p&gt;
&lt;p&gt;FACILITIES:&amp;nbsp; expand set MYCITY_ENG = 2;expand set MYCITY_FAC = 1;task reload&lt;/p&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:12pt;"&gt;&lt;em&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:12pt;"&gt;&lt;em&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/0042._3B00_lk.jpg" border="0" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;To finish this off, let&amp;#39;s take a quick look at the keyins:&lt;/p&gt;
&lt;p&gt;Expand set sets a temporary configuration variable for the active design session.&lt;/p&gt;
&lt;p&gt;Task reload, does exactly what it implies - it reloads all of the tasks.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This tutorial is only a small sampling of what can be done with named expressions, and with a little curiosity and creativity the possibilities are seemingly endless.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;Thanks for reading and have fun!&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Related Link:&lt;/p&gt;
&lt;p&gt;&lt;a href="/communities/other_communities/askinga/w/askinga/set-temporary-variables-with-the-expand-set-keyin.aspx"&gt;http://communities.bentley.com/communities/other_communities/askinga/w/askinga/set-temporary-variables-with-the-expand-set-keyin.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;
</description></item><item><title>Using Named Expressions to drive interface items – A sample	</title><link>https://communities.bentley.com/products/microstation/w/askinga/4541/using-named-expressions-to-drive-interface-items-a-sample/revision/6</link><pubDate>Tue, 02 Nov 2010 18:44:56 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:5bae2907-f0ef-4c23-8c9a-213531402e1d</guid><dc:creator>Inga Morozoff</dc:creator><comments>https://communities.bentley.com/products/microstation/w/askinga/4541/using-named-expressions-to-drive-interface-items-a-sample#comments</comments><description>Revision 6 posted to [Archived] AskInga Wiki by Inga Morozoff on 11/2/2010 6:44:56 PM&lt;br /&gt;
&lt;p&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;img height="76" width="230" src="/askIngaPics/askingalogo.gif" alt="AskInga logo" border="0" title="AskInga" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Using Named Expressions to drive interface items - A Sample&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;With thanks to Bentley&amp;#39;s Sam Hendrick for this article suggestion and content.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;By now you&amp;#39;ve heard and read about &lt;i&gt;Named Expressions&lt;/i&gt;, but might not have had the inspiration to experiment with them.&amp;nbsp; If this describes you, then the following tutorial might be just what you need to kick-start your learning and exploration of Named Expressions.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Named expressions can be used with the Customize utility to perform the following tasks:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;define rules that control when a tool is available, &lt;/li&gt;
&lt;li&gt;define rules to control when a task is available and to ,&lt;/li&gt;
&lt;li&gt;define rules for right-click context menus, such as conditions under which a context menu item is hidden.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Knowing this, we&amp;#39;ll use a couple of named expressions to load a different user interface depending upon the value of configuration variables defined in a pair UCF files &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The following instructions can be used as a guide to work through this tutorial.&amp;nbsp; Of course this is just a sample workflow, what you employ to create your customized interface may differ.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 1:&amp;nbsp; Create two UCFs and one PCF&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Using the File Open dialog, or what us old-timers still call the MicroStation Manager dialog, create two new users and one new project.&amp;nbsp; In this example, I&amp;#39;m using ENGINEERING and FACILITIES as the users and MyCity as the project.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;mso-bidi-font-size:14.0pt;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:verdana,geneva;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;mso-bidi-font-size:14.0pt;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:verdana,geneva;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="line-height:115%;mso-bidi-font-size:14.0pt;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:verdana,geneva;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2086.new-user.jpg" border="0" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/3113.facucf.jpg" border="0" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p&gt;&lt;span style="line-height:115%;font-size:12pt;mso-ansi-language:EN-US;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;mso-ansi-language:EN-US;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;mso-ansi-language:EN-US;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;mso-ansi-language:EN-US;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;mso-ansi-language:EN-US;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;mso-ansi-language:EN-US;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/3386.Named-Expresssion-dialog.jpg" border="0" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;mso-bidi-font-size:14.0pt;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:verdana,geneva;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;mso-bidi-font-size:14.0pt;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:verdana,geneva;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="line-height:115%;mso-bidi-font-size:14.0pt;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:verdana,geneva;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;The next step is to create two named expressions that test for the presence of the variables created above.&amp;nbsp; To do that, click on the New button and enter the following information.&lt;/p&gt;
&lt;p&gt;Internal Name - sets the name of the named expression:&amp;nbsp; MyCity_ENG&lt;/p&gt;
&lt;p&gt;External Name - sets the text label that appears in the user interface to describe the test that will be applied when evaluating the named expression:&amp;nbsp; MyCity ENGINEERING &lt;/p&gt;
&lt;p&gt;Description:&amp;nbsp; Is this user in Engineering Services?&lt;/p&gt;
&lt;p&gt;Keywords - enables the named expression to be used in specific areas:&amp;nbsp; File, Task, Tool, User Interface&lt;/p&gt;
&lt;p&gt;Symbol Sets - defines the values and properties of the named expression:&amp;nbsp; ConfigVar &lt;/p&gt;
&lt;p&gt;Expression - is the text string that&amp;#39;s to be evaluated. The expression is a single-line statement that contains symbols and operators: &amp;nbsp;&amp;nbsp;ConfigVar.GetExpandedConfigVar(&amp;quot;MYCITY_ENG&amp;quot;)=1&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 4:&amp;nbsp; Test expressions&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Since you&amp;#39;re using the ENGINEERING workspace, the test button should return &lt;i&gt;True.&amp;nbsp; &lt;/i&gt;This makes sense since the variable MyCity_ENG is set to 1 in the UCF file.&amp;nbsp; This named expression will be used to control the display an ENGEERING User task that will be created in the next section.&lt;/p&gt;
&lt;p class="MsoNormal"&gt;You can repeat these steps to create a second named expression for MyCity_FAC.&amp;nbsp; Testing this variable returns false since the variable is not set to 1.&amp;nbsp; This named expression will be used to control the display of a FACILITIES User task that will be created later.&amp;nbsp;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2821.fale.jpg" border="0" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;
&lt;p&gt;To determine what the expression should be, select &lt;i&gt;Utilities &amp;gt; Report Symbols &lt;/i&gt;which opens expression_symbols.html in your browser.&amp;nbsp;&amp;nbsp; This is an index of available expression symbols that includes information such as the syntax to use, the description and an example.&amp;nbsp; The symbol being used in this exercise is &lt;i&gt;ConfigVar, &lt;/i&gt;which has four available expressions&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;ExpandConfigVar - returns string where all MicroStation configuration variables are expanded.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;GetExpandedConfigVar - returns the expanded variable.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;GetUnexpandedConfigVar - returns unexpanded variables.&lt;/p&gt;
&lt;p&gt;IsConfigVarDefined - returns true if the variable is defined.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;The named expressions can now be used for creating a show/hide test for tasks, tools, and other interface items.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;In this tutorial we&amp;#39;ll be creating two tasks:&lt;/p&gt;
&lt;p&gt;&lt;i&gt;ENGINEERING User&lt;/i&gt; which contains specific tasks for Engineering Services users, and&lt;/p&gt;
&lt;p&gt;&lt;i&gt;FACILITIES User&lt;/i&gt; which contains tasks for the Facility Maintenance users.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;The availability of these tasks will be driven by a Show/Hide test using the named expressions created earlier.&amp;nbsp; Let&amp;#39;s take a closer look.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 5:&amp;nbsp; Create UI dgnlib&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Start by creating a new DGN library to hold the interface customizations.&amp;nbsp; You&amp;#39;ll want to put this file in the projects .../dgnlib/ folder so it will be found by MS_DGNLIBLIST. &amp;nbsp;Note that this is defined at the project level, so all customizations in this dgnlib file will be read by all user workspaces using this project.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 6:&amp;nbsp; Create user tools and tasks&lt;/b&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;Once open, navigate to the Customize dialog and create several new tool boxes under User Tools.&amp;nbsp; In this example, I created the following tool boxes and populated them with relevant tools:&amp;nbsp; Annotation, Display, Draw, Measure, Modify, and Publishing.&lt;/p&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:x-small;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:x-small;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:12pt;mso-ansi-language:EN-US;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;em&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;span style="line-height:115%;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:12pt;mso-ansi-language:EN-US;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;em&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/3515.User-Tools.jpg" border="0" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:12pt;mso-ansi-language:EN-US;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;em&gt;&lt;span style="mso-spacerun:yes;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:12pt;mso-ansi-language:EN-US;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;em&gt;&lt;span style="mso-spacerun:yes;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:12pt;mso-ansi-language:EN-US;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;span style="mso-spacerun:yes;"&gt;&lt;/span&gt;&lt;/span&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;/p&gt;
&lt;p&gt;Once the User Tools have been created, go to the &lt;i&gt;Tasks&lt;/i&gt; pane and create a new task called &lt;i&gt;ENGINEERING User&lt;/i&gt;.&amp;nbsp; You can then populate this task with some or all of the user tools created above.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;Likewise, create a new task called &lt;i&gt;FACILITIES User&lt;/i&gt; and populate this task with some of the user tools.&amp;nbsp; &amp;nbsp;&amp;nbsp;Since MicroStation builds the interface on-the-fly, you can easily verify your UI design as you go. &lt;/p&gt;
&lt;p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2570.fac.jpg" border="0" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p&gt;&lt;span style="line-height:115%;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;
&lt;p&gt;&lt;b&gt;Step 7:&amp;nbsp; Add Show/Hide test&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Tasks and workflows have a variety of properties that are defined in the Tool Container pane of the Customize dialog.&amp;nbsp; One of available properties is a &lt;i&gt;Show/Hide Test&lt;/i&gt; which determines whether the item is displayed in the Tasks dialog.&amp;nbsp; The tests are based on named expressions, and since we&amp;#39;ve already created those in Step 3, we can now define these tests.&lt;/p&gt;
&lt;p class="MsoNormal"&gt;In the Customize dialog, highlight &lt;i&gt;ENGINEERING User&lt;/i&gt; in the Tasks pane, and note the available properties in the Tool Container.&amp;nbsp; Since there is no Show/Hide test, add one via the right click menu.&lt;/p&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/1050.Add-test.jpg" border="0" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:12pt;mso-ansi-language:EN-US;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;em&gt;&lt;span style="mso-spacerun:yes;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:12pt;"&gt;&lt;/span&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;/p&gt;
&lt;p&gt;Select the drop-down of the new Show/Hide test item and choose &lt;i&gt;MyCity ENGINEERING&lt;/i&gt; from the pop-up dialog.&amp;nbsp; At this time you may also want to click the Test button to ensure it returns True.&amp;nbsp; (Remember, your active user workspace is ENGINEERING therefore MyCity_ENG = 1.)&lt;/p&gt;
&lt;p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2287.showhidepick.jpg" border="0" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Do the same for the &lt;i&gt;FACILITIES User&lt;/i&gt; task. Choose &lt;i&gt;MyCity FACILITIES&lt;/i&gt; from the available named expressions and verify that the test returns False.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;You&amp;#39;ll also notice that the FACILITIES User task has now been removed from the Tasks dialog on the interface!&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 8:&amp;nbsp; Test &lt;/b&gt;&lt;/p&gt;
&lt;p&gt;To further test this, close MicroStation and change the workspace to FACILITIES/MyCity.&amp;nbsp; Open any file and notice that you only have the FACILITIES User in the task dialog.&lt;/p&gt;
&lt;p class="MsoNormal"&gt;Close MicroStation and change the workspace to ENGINEERING/MyCity.&amp;nbsp; This time, only the ENGINEERING User task is made available in the interface. &lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;The obvious benefit of the method is that CAD Administrators can maintain a single DGNLIB for all customizations and simply use Named Expressions to turn on or off tasks.&amp;nbsp; &amp;nbsp;In this case, we used a simple configuration variable to drive the show/hide test.&lt;/p&gt;
&lt;p&gt;The following content explores how to add the ENGINEERING User and FACILITIES User to the right click menu.&amp;nbsp; Since this customization will also use a Show/Hide test based on the named expressions, the right click menu will change its content based upon the active workspace. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 9:&amp;nbsp; Add ENGINEERING and FACILITIES to right-click &amp;nbsp;menu&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Using either the Engineering or Facilities workspace, and the MyCity project, re-open the UI dgnlib and navigate back to the customize dialog.&lt;/p&gt;
&lt;p class="MsoNormal"&gt;Then go to the &lt;i&gt;Context Menus &lt;/i&gt;pane and add two new items, one for ENGINEERING and the other for FACILITIES.&amp;nbsp; Add the appropriate Show/Hide Test and finally populate the items with the desired user tools as shown.&lt;/p&gt;
&lt;p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:12pt;"&gt;&lt;/span&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2248.Context-Menu.jpg" border="0" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;
&lt;p&gt;Testing this is going to produce similar results to the tasks.&amp;nbsp; When the workspace is set to ENGINEERING/MyCity, the right-click menu will show the ENGINEERING User content, and when the workspace is set to FACILITIES/MyCity, it flip for the FACILITIES User.&lt;/p&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt; &lt;/p&gt;
&lt;p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2308.rightclickeng.jpg" border="0" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;
&lt;p&gt;&lt;b&gt;Step 10:&amp;nbsp; Add Switch User item to the right-click menu&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;As a final touch to the right-click menu, let&amp;#39;s add a Switch User item that performs the following tasks:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Show tasks from both the engineering and facilities users.&lt;/li&gt;
&lt;li&gt;Show only the ENGINEERING User tasks.&lt;/li&gt;
&lt;li&gt;Show only the FACILITIES User tasks&lt;/li&gt;
&lt;/ul&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/0317.bonus.jpg" border="0" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;
&lt;p&gt;To do that, add a new menu called &lt;i&gt;Switch User &lt;/i&gt;in the Context Menu.&amp;nbsp; Then add three menu items that execute the following MicroStation key ins:&amp;nbsp; &lt;/p&gt;
&lt;p&gt;Show Both Users:&amp;nbsp; expand set MYCITY_ENG = 1;expand set MYCITY_FAC = 1;task reload&lt;/p&gt;
&lt;p&gt;ENGINEERING:&amp;nbsp; expand set MYCITY_ENG = 1;expand set MYCITY_FAC = 2;task reload&lt;/p&gt;
&lt;p&gt;FACILITIES:&amp;nbsp; expand set MYCITY_ENG = 2;expand set MYCITY_FAC = 1;task reload&lt;/p&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:12pt;"&gt;&lt;em&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:12pt;"&gt;&lt;em&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/0042._3B00_lk.jpg" border="0" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;To finish this off, let&amp;#39;s take a quick look at the keyins:&lt;/p&gt;
&lt;p&gt;Expand set sets a temporary configuration variable for the active design session.&lt;/p&gt;
&lt;p&gt;Task reload, does exactly what it implies - it reloads all of the tasks.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This tutorial is only a small sampling of what can be done with named expressions, and with a little curiosity and creativity the possibilities are seemingly endless.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;Thanks for reading and have fun!&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Related Link:&lt;/p&gt;
&lt;p&gt;&lt;a href="/communities/other_communities/askinga/w/askinga/set-temporary-variables-with-the-expand-set-keyin.aspx"&gt;http://communities.bentley.com/communities/other_communities/askinga/w/askinga/set-temporary-variables-with-the-expand-set-keyin.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;
</description></item><item><title>Using Named Expressions to drive interface items – A sample	</title><link>https://communities.bentley.com/products/microstation/w/askinga/4541/using-named-expressions-to-drive-interface-items-a-sample/revision/5</link><pubDate>Tue, 02 Nov 2010 18:43:22 GMT</pubDate><guid isPermaLink="false">6dad98f5-dbc9-4c4d-a9ba-e9da8dc6aa8e:5bae2907-f0ef-4c23-8c9a-213531402e1d</guid><dc:creator>Inga Morozoff</dc:creator><comments>https://communities.bentley.com/products/microstation/w/askinga/4541/using-named-expressions-to-drive-interface-items-a-sample#comments</comments><description>Revision 5 posted to [Archived] AskInga Wiki by Inga Morozoff on 11/2/2010 6:43:22 PM&lt;br /&gt;
&lt;p&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;img height="76" width="230" src="/askIngaPics/askingalogo.gif" alt="AskInga logo" border="0" title="AskInga" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;strong&gt;Original Post Date:&amp;nbsp; &lt;/strong&gt;November 2010&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;Using Named Expressions to drive interface items &amp;ndash; A sample&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;mso-bidi-font-size:14.0pt;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:verdana,geneva;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;mso-bidi-font-size:14.0pt;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:verdana,geneva;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="line-height:115%;mso-bidi-font-size:14.0pt;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:verdana,geneva;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2086.new-user.jpg" border="0" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/3113.facucf.jpg" border="0" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p&gt;&lt;span style="line-height:115%;font-size:12pt;mso-ansi-language:EN-US;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;mso-ansi-language:EN-US;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;mso-ansi-language:EN-US;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;mso-ansi-language:EN-US;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;mso-ansi-language:EN-US;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;mso-ansi-language:EN-US;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/3386.Named-Expresssion-dialog.jpg" border="0" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;mso-bidi-font-size:14.0pt;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:verdana,geneva;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;mso-bidi-font-size:14.0pt;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:verdana,geneva;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="line-height:115%;mso-bidi-font-size:14.0pt;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:verdana,geneva;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;The next step is to create two named expressions that test for the presence of the variables created above.&amp;nbsp; To do that, click on the New button and enter the following information.&lt;/p&gt;
&lt;p&gt;Internal Name - sets the name of the named expression:&amp;nbsp; MyCity_ENG&lt;/p&gt;
&lt;p&gt;External Name - sets the text label that appears in the user interface to describe the test that will be applied when evaluating the named expression:&amp;nbsp; MyCity ENGINEERING &lt;/p&gt;
&lt;p&gt;Description:&amp;nbsp; Is this user in Engineering Services?&lt;/p&gt;
&lt;p&gt;Keywords - enables the named expression to be used in specific areas:&amp;nbsp; File, Task, Tool, User Interface&lt;/p&gt;
&lt;p&gt;Symbol Sets - defines the values and properties of the named expression:&amp;nbsp; ConfigVar &lt;/p&gt;
&lt;p&gt;Expression - is the text string that&amp;#39;s to be evaluated. The expression is a single-line statement that contains symbols and operators: &amp;nbsp;&amp;nbsp;ConfigVar.GetExpandedConfigVar(&amp;quot;MYCITY_ENG&amp;quot;)=1&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 4:&amp;nbsp; Test expressions&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Since you&amp;#39;re using the ENGINEERING workspace, the test button should return &lt;i&gt;True.&amp;nbsp; &lt;/i&gt;This makes sense since the variable MyCity_ENG is set to 1 in the UCF file.&amp;nbsp; This named expression will be used to control the display an ENGEERING User task that will be created in the next section.&lt;/p&gt;
&lt;p class="MsoNormal"&gt;You can repeat these steps to create a second named expression for MyCity_FAC.&amp;nbsp; Testing this variable returns false since the variable is not set to 1.&amp;nbsp; This named expression will be used to control the display of a FACILITIES User task that will be created later.&amp;nbsp;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2821.fale.jpg" border="0" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;
&lt;p&gt;To determine what the expression should be, select &lt;i&gt;Utilities &amp;gt; Report Symbols &lt;/i&gt;which opens expression_symbols.html in your browser.&amp;nbsp;&amp;nbsp; This is an index of available expression symbols that includes information such as the syntax to use, the description and an example.&amp;nbsp; The symbol being used in this exercise is &lt;i&gt;ConfigVar, &lt;/i&gt;which has four available expressions&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;ExpandConfigVar - returns string where all MicroStation configuration variables are expanded.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;GetExpandedConfigVar - returns the expanded variable.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;GetUnexpandedConfigVar - returns unexpanded variables.&lt;/p&gt;
&lt;p&gt;IsConfigVarDefined - returns true if the variable is defined.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;The named expressions can now be used for creating a show/hide test for tasks, tools, and other interface items.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;In this tutorial we&amp;#39;ll be creating two tasks:&lt;/p&gt;
&lt;p&gt;&lt;i&gt;ENGINEERING User&lt;/i&gt; which contains specific tasks for Engineering Services users, and&lt;/p&gt;
&lt;p&gt;&lt;i&gt;FACILITIES User&lt;/i&gt; which contains tasks for the Facility Maintenance users.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;The availability of these tasks will be driven by a Show/Hide test using the named expressions created earlier.&amp;nbsp; Let&amp;#39;s take a closer look.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 5:&amp;nbsp; Create UI dgnlib&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Start by creating a new DGN library to hold the interface customizations.&amp;nbsp; You&amp;#39;ll want to put this file in the projects .../dgnlib/ folder so it will be found by MS_DGNLIBLIST. &amp;nbsp;Note that this is defined at the project level, so all customizations in this dgnlib file will be read by all user workspaces using this project.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 6:&amp;nbsp; Create user tools and tasks&lt;/b&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;Once open, navigate to the Customize dialog and create several new tool boxes under User Tools.&amp;nbsp; In this example, I created the following tool boxes and populated them with relevant tools:&amp;nbsp; Annotation, Display, Draw, Measure, Modify, and Publishing.&lt;/p&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:x-small;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-size:x-small;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:small;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp; &lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:12pt;mso-ansi-language:EN-US;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;em&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;span style="line-height:115%;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:12pt;mso-ansi-language:EN-US;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;em&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/3515.User-Tools.jpg" border="0" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:12pt;mso-ansi-language:EN-US;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;em&gt;&lt;span style="mso-spacerun:yes;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:12pt;mso-ansi-language:EN-US;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;em&gt;&lt;span style="mso-spacerun:yes;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:12pt;mso-ansi-language:EN-US;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;span style="mso-spacerun:yes;"&gt;&lt;/span&gt;&lt;/span&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;/p&gt;
&lt;p&gt;Once the User Tools have been created, go to the &lt;i&gt;Tasks&lt;/i&gt; pane and create a new task called &lt;i&gt;ENGINEERING User&lt;/i&gt;.&amp;nbsp; You can then populate this task with some or all of the user tools created above.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;Likewise, create a new task called &lt;i&gt;FACILITIES User&lt;/i&gt; and populate this task with some of the user tools.&amp;nbsp; &amp;nbsp;&amp;nbsp;Since MicroStation builds the interface on-the-fly, you can easily verify your UI design as you go. &lt;/p&gt;
&lt;p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2570.fac.jpg" border="0" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p&gt;&lt;span style="line-height:115%;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;
&lt;p&gt;&lt;b&gt;Step 7:&amp;nbsp; Add Show/Hide test&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Tasks and workflows have a variety of properties that are defined in the Tool Container pane of the Customize dialog.&amp;nbsp; One of available properties is a &lt;i&gt;Show/Hide Test&lt;/i&gt; which determines whether the item is displayed in the Tasks dialog.&amp;nbsp; The tests are based on named expressions, and since we&amp;#39;ve already created those in Step 3, we can now define these tests.&lt;/p&gt;
&lt;p class="MsoNormal"&gt;In the Customize dialog, highlight &lt;i&gt;ENGINEERING User&lt;/i&gt; in the Tasks pane, and note the available properties in the Tool Container.&amp;nbsp; Since there is no Show/Hide test, add one via the right click menu.&lt;/p&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;span style="mso-spacerun:yes;"&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/1050.Add-test.jpg" border="0" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:12pt;mso-ansi-language:EN-US;mso-fareast-font-family:Calibri;mso-fareast-theme-font:minor-latin;mso-fareast-language:EN-US;mso-bidi-language:AR-SA;"&gt;&lt;em&gt;&lt;span style="mso-spacerun:yes;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:12pt;"&gt;&lt;/span&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;/p&gt;
&lt;p&gt;Select the drop-down of the new Show/Hide test item and choose &lt;i&gt;MyCity ENGINEERING&lt;/i&gt; from the pop-up dialog.&amp;nbsp; At this time you may also want to click the Test button to ensure it returns True.&amp;nbsp; (Remember, your active user workspace is ENGINEERING therefore MyCity_ENG = 1.)&lt;/p&gt;
&lt;p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2287.showhidepick.jpg" border="0" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Do the same for the &lt;i&gt;FACILITIES User&lt;/i&gt; task. Choose &lt;i&gt;MyCity FACILITIES&lt;/i&gt; from the available named expressions and verify that the test returns False.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;You&amp;#39;ll also notice that the FACILITIES User task has now been removed from the Tasks dialog on the interface!&amp;nbsp; &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 8:&amp;nbsp; Test &lt;/b&gt;&lt;/p&gt;
&lt;p&gt;To further test this, close MicroStation and change the workspace to FACILITIES/MyCity.&amp;nbsp; Open any file and notice that you only have the FACILITIES User in the task dialog.&lt;/p&gt;
&lt;p class="MsoNormal"&gt;Close MicroStation and change the workspace to ENGINEERING/MyCity.&amp;nbsp; This time, only the ENGINEERING User task is made available in the interface. &lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;The obvious benefit of the method is that CAD Administrators can maintain a single DGNLIB for all customizations and simply use Named Expressions to turn on or off tasks.&amp;nbsp; &amp;nbsp;In this case, we used a simple configuration variable to drive the show/hide test.&lt;/p&gt;
&lt;p&gt;The following content explores how to add the ENGINEERING User and FACILITIES User to the right click menu.&amp;nbsp; Since this customization will also use a Show/Hide test based on the named expressions, the right click menu will change its content based upon the active workspace. &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Step 9:&amp;nbsp; Add ENGINEERING and FACILITIES to right-click &amp;nbsp;menu&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;Using either the Engineering or Facilities workspace, and the MyCity project, re-open the UI dgnlib and navigate back to the customize dialog.&lt;/p&gt;
&lt;p class="MsoNormal"&gt;Then go to the &lt;i&gt;Context Menus &lt;/i&gt;pane and add two new items, one for ENGINEERING and the other for FACILITIES.&amp;nbsp; Add the appropriate Show/Hide Test and finally populate the items with the desired user tools as shown.&lt;/p&gt;
&lt;p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:12pt;"&gt;&lt;/span&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2248.Context-Menu.jpg" border="0" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;
&lt;p&gt;Testing this is going to produce similar results to the tasks.&amp;nbsp; When the workspace is set to ENGINEERING/MyCity, the right-click menu will show the ENGINEERING User content, and when the workspace is set to FACILITIES/MyCity, it flip for the FACILITIES User.&lt;/p&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt; &lt;/p&gt;
&lt;p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:12pt;"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/2308.rightclickeng.jpg" border="0" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;
&lt;p&gt;&lt;b&gt;Step 10:&amp;nbsp; Add Switch User item to the right-click menu&lt;/b&gt;&lt;/p&gt;
&lt;p&gt;As a final touch to the right-click menu, let&amp;#39;s add a Switch User item that performs the following tasks:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Show tasks from both the engineering and facilities users.&lt;/li&gt;
&lt;li&gt;Show only the ENGINEERING User tasks.&lt;/li&gt;
&lt;li&gt;Show only the FACILITIES User tasks&lt;/li&gt;
&lt;/ul&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/0317.bonus.jpg" border="0" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;
&lt;p&gt;To do that, add a new menu called &lt;i&gt;Switch User &lt;/i&gt;in the Context Menu.&amp;nbsp; Then add three menu items that execute the following MicroStation key ins:&amp;nbsp; &lt;/p&gt;
&lt;p&gt;Show Both Users:&amp;nbsp; expand set MYCITY_ENG = 1;expand set MYCITY_FAC = 1;task reload&lt;/p&gt;
&lt;p&gt;ENGINEERING:&amp;nbsp; expand set MYCITY_ENG = 1;expand set MYCITY_FAC = 2;task reload&lt;/p&gt;
&lt;p&gt;FACILITIES:&amp;nbsp; expand set MYCITY_ENG = 2;expand set MYCITY_FAC = 1;task reload&lt;/p&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:12pt;"&gt;&lt;em&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;/span&gt;&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="line-height:115%;font-family:&amp;#39;Arial&amp;#39;,&amp;#39;sans-serif&amp;#39;;font-size:12pt;"&gt;&lt;em&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&lt;img src="/resized-image.ashx/__size/550x0/__key/CommunityServer-Wikis-Components-Files/00-00-00-00-04/0042._3B00_lk.jpg" border="0" alt="" /&gt;&lt;/span&gt;&lt;/span&gt;&lt;/em&gt;&lt;/span&gt;&lt;/p&gt;
&lt;/p&gt;
&lt;p class="MsoNormal"&gt;&lt;span style="font-family:arial,helvetica,sans-serif;"&gt;&lt;span style="font-size:x-small;"&gt;&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;To finish this off, let&amp;#39;s take a quick look at the keyins:&lt;/p&gt;
&lt;p&gt;Expand set sets a temporary configuration variable for the active design session.&lt;/p&gt;
&lt;p&gt;Task reload, does exactly what it implies - it reloads all of the tasks.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This tutorial is only a small sampling of what can be done with named expressions, and with a little curiosity and creativity the possibilities are seemingly endless.&amp;nbsp; &lt;/p&gt;
&lt;p&gt;Thanks for reading and have fun!&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Related Link:&lt;/p&gt;
&lt;p&gt;&lt;a href="/communities/other_communities/askinga/w/askinga/set-temporary-variables-with-the-expand-set-keyin.aspx"&gt;http://communities.bentley.com/communities/other_communities/askinga/w/askinga/set-temporary-variables-with-the-expand-set-keyin.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;
</description></item></channel></rss>