Site Standards - Migrating Custom Tools From V8i to CONNECT

This article explains how to add a menu with links to useful locations or files in V8i applications and how to migrate the menu to CONNECT applications.

The general processes for creating custom tools in V8i are covered in the help documents and Customizing tools and tool boxes in MicroStation. How to Migrate Old Customizations to the Ribbon covers the general principles of tool migration. One useful thing to do with this feature set is add tools to quickly go to useful locations or documents in Windows Explorer or other applications.

Windows Application key-ins

The key-in %explorer C:\ will open Windows Explorer at the C:\ drive.

This uses the simplest example of the syntax: %<executable name> <path>.

Using hardcoded paths is obviously limiting and will require maintenance. Adding the statement 'expand keyin' allow the use of both Bentley configuration variables and Windows environment variables. For example this will open Windows Explorer in the user's root folder C:\Users\<username>

expand keyin %explorer $(USERPROFILE)

The 'expand keyin' statement can be replaced with '$' making command strings shorter:

$ %explorer $(USERPROFILE)

This syntax will be used in all of the following examples.

Other executable names can be used. To open CompanyProcedures.pdf located in W:\SS6\Standards\Documentation any of the following commands could be used with the _USTN_SITE configuration variable:

To open in either Internet Explorer or Chrome (other browsers are available!) use the File: qualifier:

$ %iexplore File:$(_USTN_SITE)Documentation\CompanyProcedures.pdf

$ %chrome File:$(_USTN_SITE)Documentation\CompanyProcedures.pdf

To open with Acrobat Reader:

$ %AcroRd32 $(_USTN_SITE)Documentation\CompanyProcedures.pdf

Bentley configuration variables are particularly useful for locations that are user or project specific as will be shown in the example below which adds a Useful Links menu to MicroStation, PowerDraft or any other V8i platform based application.

Adding a Useful Links Menu to the Quick Access Toolbar

Using the standard custom tool creation process create a dgnlib in one of the locations specified by MS_GUIDGNLIBLIST. To make the menu available to all users the ...Standards\dgnlib folder would be the best place, e.g. in the QuickConfig examples "W:\SS6\Standards\dgnlib".

Create the tools under the User Tools tree on the left, then simple drag them over to the desired location in the Menu bar on the right. Note that I have used the Toolbox name User Links on the left but chnaged it to Useful Links on the right. I also inserted the '~' to provide a key-stroke to open the menu (Alt + i when input focus is at Home).

The four key-in strings used are:

Open Current User's Folder $ %explorer $(_USTN_USER)
Open Current Project Data Folder $ %explorer $(_USTN_PROJECTDATA)
Open Current Project Out Folder $ %explorer $(_USTN_OUT)
Open Current Folder $ %explorer $(_DGNDIR)

The icon used is the standard Windows Explorer icon, you can add your own.

This menu can also be used in CONNECT Edition applications.

At this point consider whether to import existing customisations or recreate them uisng the CONNECT Ribbon tools. Import may be quicker but could make futher maintenance more laborious.

Let's look at the import process.

Copy your dgnlib to the appropriate MS_GUIDGNLIBLIST location for CONNECT, to apply to all users this could be a location similar to 'W:\CONNECT\Organization\Dgnlib\Gui'.

Once the dgnlib is in place it is accessible from the CONNECT customisation tools. The quickest way to access these is via 'Customize Quick Access Toolbar' above the ribbon.

The Customize Ribbon dialog allows customisation of both the Ribbon and the Quick Access Toolbar. Any changes made will be stored in the active dgnlib. Click Custom Tools and Tasks at the lower left to see the CONNECT version of the V8i Customize dialog:

Note that the MenuBar section is no longer present:

This dialog can be used to import, create and modify custom tools that are then added to the CONNECT Ribbon and/or Quick Access Toolbar.

To add the custom tools pick Choose Components from: > Tollboxes (Custom)

Then expand the toolbox to see it's contents:

the drag the tools to where you want them in the Quick Access Toolbar:

Note that in the example above the Key-in is the less than obvious 'DMSG ACTIVATETOOLBYPATH User Links\Open Current Project Data Folder' linking to the imported V8i toolbox. This is where future maintenance could be complicated by additional steps and dialogs.

To avoid this, tools could be created from scratch, but that requires the repeat of a whole series of steps and inputs. Fortunately in the case of simple tools like this all you have to do is copy the key-in from the custom tools and replace the link commands:

That way you recive the benefit of drag and drop of the previosuly input names, tool sequence, icons, etc.

For the best result make all changes to the tools copied into the Quick Access Toolbar, name changes, replacing key-ins, before clicking Apply.

The changes needed to reflect the configuration changes between V8i and CONNECT Editions are:

Tool name V8i CONNECT
Open Current User's Folder $ %explorer $(_USTN_USER) $ %explorer $(_USTN_LOCALUSERAPPDATAPATH)
Open Current Project Data Folder $ %explorer $(_USTN_PROJECTDATA) $ %explorer $(_USTN_WORKSETROOT)
Open Current Project Out Folder $ %explorer $(_USTN_OUT)
Open Current Folder $ %explorer $(_DGNDIR)

The word Project in the name is replaced with WorkSet for consistency with Bentley terminology but could be a company specific phrase.

Click Apply and the new menu will appear:

Note: when testing tools in an organisation dgnlib that is not associated with a workset (click no whan asked!) tools such as the example above that link to a WorkSet specific location will just open Windows Explorer in a neutral location (My Documents in my case).

Importing tools to the Ribbon.

The same technique can be applied to importing tools ino the Ribbon. Once a tool is added to the Ribbon it is made available in the Buttons list.

Once a custom Ribbon Group is created it will appear in the Groups list and can be reused:

Anonymous