Overview of extending diagram tab through stereotypes and scripts
Modeler displays a diagram specific tab for each diagram type. You can add customized buttons to a diagram's tab, or replace all the buttons of a diagram's tab with customized buttons. A customized button adds an item to a diagram, and then optionally runs a script.
You can create customized buttons through Stereotypes and Script items:
When created through Stereotypes:
The customized button appears on a diagram tab only when the Stereotype is applied to the diagram.
The standard buttons of the diagram tab can be replaced by the customized buttons that apply to the diagram, or you can add customized buttons to the standard buttons of the diagram tab. If you replace the standard buttons, you can re-create them as customized buttons.
* 
The 'Apply to All Objects of Associated Model Item Types' option does not apply a Stereotype's buttons to any diagrams. A Stereotype can create many customized buttons.
When created through Script items:
The customized button appears on the diagram tab of all diagrams that are of a valid type.
The customized buttons are added to the standard buttons of a diagram tab.
* 
A Script can create only one customized button.
Each customized button is based on an existing diagram tab, the generic Custom Node button or the generic Custom Link button. For more information about the generic Custom Node or Custom Link buttons, see the Generic Custom Node and Custom Link Buttons section that follows.
Through the Diagram tab Command property, you select the button on which a customized button is based. The button you select through the Diagram Toolbar Command property must be valid for the diagram type that is going to use the customized button. For example, if you are creating a customized button for a Class Diagram, you cannot base that button on a Composite Structure Diagram button, it must be based on a Class Diagram button. Note that buttons that do not include a diagram name are valid for all diagram types.
If after selecting a button through the Diagram Toolbar Command property you make no further changes to the customized button, the appearance and behavior of the customized button will be that of the button on which it is based; this is how you add standard buttons to a customized diagram tab.
You can change the appearance and behavior of a customized tab button through these properties:
Command Icon - specifies the icon that appears on the button.
ToolTip Text - specifies the text of the ToolTip that is displayed for the button.
Status Bar Text - specifies the text that is displayed in the Modeler status bar for the button
Script - specifies the script that Modeler runs after an item is added to a diagram through the button. The item that is added to the diagram is passed to the script as the current object. The script can use the Modeler automation interface to perform numerous tasks, such as, applying a Stereotype to the new item. For more information, see the following topics:
Additive - specifies that the customized button is added to the standard buttons of a diagram tab, rather than replacing all the standard buttons of the diagram tab. Additive is available only for Script items, not Stereotypes.
Group - specifies whether the button is a standalone button or part of a group of buttons on the diagram tab.
Separator Before — specifies that a separator appears to the left of the button.
Stereotype applied buttons are displayed first, followed by Script applied buttons.
For customized buttons that are created through Stereotypes, you can control the order in which customized buttons are displayed in the tab. You can determine which Stereotype's buttons are displayed first through the order of the Stereotypes on the Items tab of the diagram's Property Pages. You can determine the order in which a Stereotype's buttons are displayed through the order of the tab command entries on the tab of the Stereotype's Property Pages.
For customized buttons that are created through Scripts, you can control the order in which they appear through the Category and Command properties.
Generic custom node and custom link buttons
The generic Custom Node and Custom Link buttons can be used for adding nodes and links to a diagram. In addition, you can use the Custom Node button for running any script against an item on a diagram, for example, to set property values of an item on the diagram.
The Custom Node button assumes one item on the diagram is clicked; the Custom Link button assumes two items on the diagram are clicked.
The Custom Node and Custom Link buttons do not appear on any diagram tabs and do not have any built in Modeler functionality. If you use these buttons you must write script to deal with all the behavior of the button. For example:
Script for any user interface required for selecting an item within the SelectObject function.
Script to deal with a right-click on the diagram after clicking the button.
Script to deal with any required validity checks.
Script to create the symbol on the diagram and return that symbol through the AddedSymbol script property.
Script to link the symbol to the diagram and its dictionary item, which the script might have to create if one is not selected.
The following script attributes and script objects can be used with the Custom Node and Custom Link buttons:
AddedSymbol script object
SelectedDictionaryItem script object
PasteAtX script attribute
PasteAtY script attribute
ReverseWaypoints script attribute (Custom Link only)
Note that the Custom Node and Custom Link buttons do not have icons assigned to their button.
For more information about the preceding script attributes and script objects, including within which script functions they can be used, see the following topics: