See the following procedures for custom View Creation dialog and submenu creation.

Updating the View Creation dialog/submenu

Reload the project for changes made to the customized View Creation dialog/submenu to take effect. Then, specify the active View Dialog via the Activating View Creation dialog.

The default name for the View Creation dialog's invocation command is Create View. If you create a dialog from scratch and do not set a new name for the command, the default name remains.

Creating a custom View Creation dialog/submenu

To create a custom View Creation dialog/submenu


  1. In the Containment tree, create a new root namespace.
  2. Open the Textual Editor for the new namespace.
  3. In the Textual Editor, create a package and name it.
  4. Within the body of the package, declare a part definition, specify the name for the dialog instance, subclassify the ViewCreationDialog definition from the DS_UIComponents::CoreUIComponents::Dialogs package, then, within the body of the definition:
    1. Manage the View Creation dialog/submenu command categories 
    2. Manage the View Creation dialog/submenu commands
  5. Click the Synchronize button.

package CustomViewCreationDialogs {
   part def NewCustomViewCreationDialog :> DS_UIComponents::CoreUIComponents::Dialogs::ViewCreationDialog { // redefining and renaming the ViewCreationDialog
   }
}

Managing the View Creation dialog/submenu command categories

Creating view creation command categories for the View Creation dialog/submenu

To create view creation command categories for the View Creation dialog/submenu


  1. Within the body of the part definition element of the new View Creation dialog instance, declare a part usage, name it (optional), then subset the itemCategories element.
  2. Click the Synchronize button.

package CustomViewCreationDialogs {
   part def NewCustomViewCreationDialog :> DS_UIComponents::CoreUIComponents::Dialogs::ViewCreationDialog
      part customSysMLViewsCategory :> itemCategories; // adding a command category
   }
}

Specifying the view creation command category attributes for the View Creation dialog/submenu

Command category attributes

View Creation dialog/submenu command category attributes predefined in the 3DS SysML Customization library's DS_UIComponents::CoreUIComponents::Components::ItemsCategory and AbstractItem are:

  • attribute :>> label default "Symbolic Views"; // attribute specifies the category name
  • attribute :>> isCollapsed default true; // attribute specifies whether the category is collapsed or expanded by default
  • If the dialog/submenu contains only one command category, then the category name is not displayed. In this case, both the label and isCollapsed attributes are ignored.
  • If the dialog/submenu contains fewer than ten view commands, then the category cannot be collapsed. In this case, the isCollapsed attribute is ignored.


To specify the view creation command category attributes for the View Creation dialog/submenu


  1. Place the cursor within the body of the new command category's element and redefine the inherited attributes that you want to modify with the needed values.
  2. Update the values as needed.
  3. Click the Synchronize button.

package CustomViewCreationDialogs {
   part def NewCustomViewCreationDialog :> DS_UIComponents::CoreUIComponents::Dialogs::ViewCreationDialog
      part customSysMLViewsCategory :> itemCategories {
         attribute :>> isCollapsed default true; // specifying the command category's default collapse state
         attribute :>> label default "SysML v2 Symbolic Views"; // specifying the command category's name
      }
   }
}

Managing the View Creation dialog/submenu commands

You can customize the View Creation dialog/submenu content by specifying which view creation commands it should contain. The view creation commands themselves are created by targeting view templates (e.g., generalViewTemplate, etc.). There can be two types of templates:

  • predefined templates. These templates are available via the DS_UIComponents::UIComponents::ViewsTemplates, which contains predefined templates for all standard predefined view definitions (symbolic and tabular). 
  • custom templates. You need to create custom view templates for any custom-created view definitions (e.g., custom symbolic view definitions) if you want their corresponding view creation commands to be available in the View Creation dialog/submenu.

Adding view creation commands to the View Creation dialog/submenu command categories

To add view creation commands to the View Creation dialog/submenu command categories


  1. Within the body of the command category's element, declare a part usage defined by DS_UIComponents::CoreUIComponents::Dialogs::DialogItem and subset abstractItems. This element instantiates the new command.
  2. Within the body of the new command's instance, specify the command's name by redefining the label attribute and specifying the command's name.
  3. Within the body of the new command's instance, declare a perform action usage defined by DS_UIComponents::CoreUIComponents::Operations::OperationFromTemplate and redefine operation. In the element's body, specify the in direction based on the view template you want to use for the command using a metaclassification expression.

    Alternatively, you can also use MetadataAccessExpression, e.g., when the templated view is named.

  4. Click the Synchronize button.

package CustomViewCreationDialogs {
    part def CustomViewCreationDialog :> DS_UIComponents::CoreUIComponents::Dialogs::ViewCreationDialog {
        part customSysMLViewsCategory :> itemCategories {

            // view creation command by targeting a custom view template:
            part reqViewItem : DS_UIComponents::CoreUIComponents::Dialogs::DialogItem :> abstractItems { // new view creation command instance
                attribute :>> label default "Custom Requirements View"; // specifying the command's name
                perform action : DS_UIComponents::CoreUIComponents::Operations::OperationFromTemplate :>> operation { // specifying the view template that should be targeted upon the clicking of the new command
                    in ref = (customRequirementsViewTemplate meta KerML::Package).ownedElement; // the specified template is a custom view template, see the procedure 'Creating view templates for custom templated commands'
                }
            }

            // view creation command by targeting a predefined view template:
            part gvButton : DS_UIComponents::CoreUIComponents::Dialogs::DialogItem :> abstractItems { // new view creation command instance
                attribute :>> label default "General View"; // specifying the command's name
                perform action : DS_UIComponents::CoreUIComponents::Operations::OperationFromTemplate :>> operation { // specifying the view template that should be targeted upon the clicking of the new command
                    in ref = (DS_UIComponents::UIComponents::ViewsTemplates::generalViewTemplate meta KerML::Package).ownedElement; // the specified template is a predefined view template from DS_UIComponents::UIComponents::ViewsTemplates
                }
            }

        }
    }
}

Creating view templates for custom templated view creation commands 

To create view templates for custom templated view creation commands 


  1. Within the body of the new dialog instance's package, create a new package for the custom view template.
  2. Within the package, declare a view usage defined by the custom view definition.
  3. Click the Synchronize button.

package CustomViewCreationDialogs {
    package customRequirementsViewTemplate { // the new template's package, which you will have to target using the OperationFromTemplate to create a view creation command for the custom element
        view : CustomRequirementsView::'Requirements View';   
    }
}