Skip to main content
1-Visitor
April 13, 2017
Solved

Creating a Custom Stereotype

  • April 13, 2017
  • 1 reply
  • 2528 views

How do I create a custom Stereotype so that I can assign it to some blocks?

    Best answer by PatrickOllerton

    Hi Chris,

    To create a new stereotype:

    • Create a new package. Click the package, then Options tab and select the "Profile Package" checkbox.
    • Right-click on the package and select New > UML > Profiles > Stereotype
    • Stereotype1 will be created. Select the stereotype and click the Items tab. Select Model Item types , and click the Link icon .
    • In the Link Editor , choose the types that this stereotype can be applied to. For blocks, check the Class box and click OK.

     

    You can now select a block in a browser or diagram, right click and choose Applied Stereotypes. The new Stereotype1 will be available for selection.

    (Alternatively you can select a block, click on the Items tab and select Stereotypes to link/unlink stereotypes)

    If you want the stereotypes to be displayed on a symbol on a diagram, right click the item and select Show/Hide Compartments. Select the Role called Assigned Stereotypes.

    Regards,

    Patrick

    1 reply

    16-Pearl
    April 21, 2017

    Hi Chris,

    To create a new stereotype:

    • Create a new package. Click the package, then Options tab and select the "Profile Package" checkbox.
    • Right-click on the package and select New > UML > Profiles > Stereotype
    • Stereotype1 will be created. Select the stereotype and click the Items tab. Select Model Item types , and click the Link icon .
    • In the Link Editor , choose the types that this stereotype can be applied to. For blocks, check the Class box and click OK.

     

    You can now select a block in a browser or diagram, right click and choose Applied Stereotypes. The new Stereotype1 will be available for selection.

    (Alternatively you can select a block, click on the Items tab and select Stereotypes to link/unlink stereotypes)

    If you want the stereotypes to be displayed on a symbol on a diagram, right click the item and select Show/Hide Compartments. Select the Role called Assigned Stereotypes.

    Regards,

    Patrick

    cfreund1-VisitorAuthor
    1-Visitor
    April 21, 2017

    Thanks Patrick,

    I actually got in touch with Matthew Hause yesterday, and he was able to walk me through this.

    Question though, as I was going through the Help Topics, the guide insisted that I needed to create and associate a tag definition with each new stereotype before I would be able to use it, but your solution seems to suggest that it is not necessary.  Do you know anything about this>

    16-Pearl
    April 25, 2017

    hi Chris,

    Stereotypes can be used to create new types (refer to Help topic "Overview of extending model item properties through stereotypes and tag definitions") but you also need the tag definition which is used to define additional properties for that type. Stereotypes on their own can be applied to items (as I describe above), but without tag definitions they act more as a classification/taxonomy. Also refer to Help topic "Overview of lightweight extensions of PTC profiles".

    Hope this helps.

    Regards,

    Patrick