Creating Ports and Parts
The set of features that a Block element defines can include Port and Part (or Property) elements. When you initially create a Port or Part on a Block Definition diagram it is rendered as an object on its parent Block element, but the object is usually then removed from the diagram and represented by a text string in a labeled compartment of the Block.
Select or create the required Block Definition diagram, which will open the 'SysML Block Definition' pages of the Diagram Toolbox.
Select or create the appropriate Block element in the diagram.
Creating Ports and Parts from the Toolbox
To create a Port or Part:
- Click on the 'Port' or 'Property' icon in the SysML Block Definition Toolbox.
- Click within a Block on the diagram.
The new element is depicted as a Port or Property object on the diagram. Use the Browser window to confirm that the object has been created as a child of the Block element.
You can leave the object rendered as a graphic on the diagram, or you can remove it from the diagram and reference it as text in a compartment of the Block element.
To represent the object as text in a compartment:
- Select the Property/Port in the diagram.
- Press the
The name of the Property or Port will immediately appear in the appropriate compartment of the Block element.
to remove the object from the diagram.
Specifying the Type of a Port or Part
You might need to set a classifier as the Type of a Port or Part. To do this, you display the 'Select Property Type' dialog and browse or search for the appropriate classifier.
To display the 'Select Property Type' dialog, either:
- Click on the object element or the object name in the compartment and press , or
- Right-click on the object in the diagram, and select the 'Advanced | Set Property Type...' context menu option
Creating a Part or Port as an Instance of an Existing Block
Where you have existing Block definitions in the model, you can create an instance of one of those Blocks as a Part or Port within another Block.
With the parent Block showing in a diagram:
- In the Browser window, select the Block that will be used as the Part or Port.
- Press the
and drag that Block from the Browser window, dropping it onto the parent Block on the diagram.
- In the 'Paste item' dialog, click on the 'Drop as' drop-down arrow and select the required option (a 'Port' in the illustration) from the list.
- Click on the .
- The new Port is created within the parent Block, as an instance of the dragged Block.
- If you prefer to set the Port to show as text in a compartment, click on the Port and press the .