Worked example: Creating a lightweight extension of an item type
Create a new item type named MyBlock that is an extension of the SysML Block type.
1. Right-click the Model, point to New, and then click Package. Name the Package MyExts.
2. Apply the «LightweightProfile» stereotype to the MyExts package, or else Modeler will ignore any lightweight extensions you create in the Package. Right-click the MyExts package, and select Links > Stereotypes > LightweightProfile.
3. Open the Property Pages of the MyExts package and, in the Options tab, select the Profile Package check box.
The name of the Package is important because in selection dialogs it will be used to scope the new item types you create. Note that if the name of the package ends in Profile, the text 'Profile' will be removed when it appears in dialogs.
4. Create a Profile Diagram in the MyExts package. This way you can create a new Stereotype and define it as an extension of the SysML «Block» stereotype. Right-click on the Package, and select New > UML > Profiles > Profile Diagram.
5. On the Profile Diagram, create a Stereotype named MyBlock for the new item type - click the Stereotype button, click in free space, and then type MyBlock.
6. Add the SysML «Block» stereotype to the diagram. Click the Stereotype button, right-click in free space, and then select the SysML «Block» stereotype.
* 
By default on a Profile Diagram a Stereotype's Scripts and Tag Definitions are shown. In the examples shown in this topic the Scripts and Tag Definitions of the Stereotypes are hidden.
7. If you have not done so already, unprotect the SysML Profile package that contains the profile item type you want to extend.
To unprotect a SysML Profile package, open the SysML Profile package's Property Pages, click the Access Permissions tab, clear the Protected check box, and then click the Copy Protected Flag to Child Packages button.
8. Define the MyBlock type as a subtype of the Block type by creating a Generalization from the «MyBlock» stereotype to the SysML «Block» stereotype. We click the Generalization button, click the «MyBlock» stereotype, and then click the SysML «Block» stereotype.
The MyBlock type now inherits all the properties and scripts of the Block type.
9. Set the check boxes on the Options and Directly-Stereotyped Options tabs of the «MyBlock» stereotype's Property Pages to the same as those of the Stereotype you are extending. You can do this quickly through the Copy Super Stereotype Options command.
10. Specify an icon to use for the new item type, which will be used in the Modeler browsers and for its tab buttons. In addition, define the presentation of the new item type on diagrams. To do this, open the «MyBlock» stereotype's Property Pages, click the Style tab, click the Edit button, and then through the Style Modification dialog set up the icon and presentation.
11. Create roles required for creating scripts. To do this, right-click the model and select Reinitialize Profile Helper.
12. Create the scripts required for the new profile Package. To do this, use the Create Scripts command.
You must create scripts in all the supported PTC profiles that are affected by the new item type. The SysML profile requires scripts to define commands that create, link, and populate the new My Block item as well as the scripts that define the diagram buttons for creating the item on the SysML diagrams. You can create the these scripts by running the Create Scripts command against the profile packages in your model that are affected (for example, for SysML item types, update the SysML Profile package and the Requirements package).
13. Confirm that the new MyBlock type is available in the same places as the Block type in the Modeler user interface. To do this, create a Block in a Package and then create a Block Property on that Block. Modeler opens the Select Type dialog so that you can select a type to use for the Block Property. Because you can select a Block to use as a type, you can now select a MyBlock item to use as a type because MyBlock is a subtype of Block.
Notice that the Block folder is shown under the SysML folder, because the SysML «Block» stereotype appears in the SysML Profile package; the MyBlock folder is shown under the MyExts folder because the «MyBlock» stereotype appears in the MyExts package. At present there are no MyBlock items in the model, but the folder for selecting MyBlock items is available.
14. Create a SysML Requirement in the model. Right-click on Requirement, and select Links > Traceability > Requirements > Satisfied By. Previously the Links Editor listed Blocks as valid items; now MyBlocks are listed as well, because it is a subtype of the valid Block type.
15. Open a Block Definition Diagram and confirm that a new button for creating MyBlock items has been created. The My Block button is grouped with the Block button.
* 
While developing lightweight extensions you can see the effects of any changes you make without having to change the Lightweight Profile Version number by disabling Profile Helper caching. To disable Profile Helper caching, use the Caching Enabled command, and set caching enabled to False.
* 
You must change the Lightweight Profile Version to a later version number. The changes made to the lightweight extensions will take effect only after updating the Lightweight Profile Version. To change the Lightweight Profile Version, use the Build Cache/Extensions command.