MicroStation CONNECT Edition Help

Application Commands and Custom Commands

Commands are actions that can be assigned to buttons and drop-down menu items in the ribbon. In the Customize Ribbon dialog's Choose components from drop-down list, you have two options called Commands (Application) and Commands (Custom). Selecting Commands (Application) lists the commands that are supplied with the product. Selecting Command (Custom) lists the custom commands defined in an XML file that is pointed by the configuration variable MS_NAMEDCOMMANDSLIST. Custom commands define key-ins that are queued when activated. These are usually created by Administrators.

The format of the XML file must match the specifications defined in the XML schema file $(_USTN_SYSTEMROOT)Data\UserNamedCommands.xsd. Following is the sample content of an XML file:

<?xml version="1.0" encoding="utf-8"?>
<!-- ExampleNamedCommands.xsd was created by copying UserNamedCommands.xsd found in system data directory -->
<UserNamedCommands  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="ExampleNamedCommands.xsd">
    <UserNamedCommand>
        <Name>GeneralExample.PlaceThickCircle</Name>
        <Label>Thick Circle</Label>
        <Description>Place thick circle</Description>
        <Keyin>[CONSGEOM]PLACE CIRCLE ICON;co=4;wt=4;lc=0</Keyin>
        <IconName>PlaceCircle</IconName>
    </UserNamedCommand>
    <UserNamedCommand>
        <Name>GeneralExample.ToolWithNoIcon</Name>
        <Label>Place Line</Label>
        <Description>Place Line (No Icon)</Description>
        <Keyin>PLACE LINE;co=4;wt=4;lc=0</Keyin>
    </UserNamedCommand>
    <UserNamedCommand>
        <Name>GeneralExample.PlaceThinShape</Name>
        <Label>Thin Shape</Label>
        <Description>Place thin shape</Description>
        <Keyin>[CONSGEOM]PLACE SHAPE CONSTRAINED;co=1;wt=0;lc=0</Keyin>
        <IconName>PlaceShape</IconName>
    </UserNamedCommand>
    <UserNamedCommand>
        <Name>GeneralExample.PlaceSolidSlab</Name>
        <Label>Place Slab</Label>
        <Description>Place slab</Description>
        <Keyin>[SOLIDMODELING]PLACE SLAB ICON;co=5;wt=2;lc=0</Keyin>
        <IconName>PlaceSlab</IconName>
        <VisibilityExpression>[Session]Session.TreatActiveModelAs3D()</VisibilityExpression>
    </UserNamedCommand>
</UserNamedCommands>

The format of the <Keyin> specification is the same as what can be used in Custom Tools and Menus. The key-in may be prefixed with an MDL task name enclosed in square brackets, which specify applications that must be loaded for the command to execute properly. The specification of the [task] is optional. In the key-in shown in the example, the task CONSGEOM is specified because that MDL application must be loaded to process the PLACE SHAPE CONSTRAINED command. The semi-colons separate commands to queue. So in the example, the custom command starts the place shape constrained command and then sets the active color index to 1, the active line weight to 0, and the active line code to 0 (solid).

Any application command or custom command can be activated in any menu, custom tool, function key menu, screen menu, or keyboard shortcut using the following key-in:

RUNXCOMMAND commandName

For example, to run the example above, the key-in would be RUNXCOMMAND GeneralExample.PlaceThinShape.

You can use the PLACE ICON key-in to get a list of icon names delivered by MicroStation. These names can be used to define the icon using the <IconName> tag.