Please note : This help page is not for the latest version of Enterprise Architect. The latest help can be found here.

EA_OnRetrieveModelTemplate

Topics:

Topic

Detail

See Also

Details

EA_OnRetrieveModelTemplate requests that an Add-In pass a model template to Enterprise Architect

This event occurs when a user executes the Add a New Model Using Wizard command to add a model that has been defined by an MDG Technology

Incorporate Model Templates

Syntax

Function EA_OnRetrieveModelTemplate(Repository As EA.Repository,sLocation As String) As String

The EA_OnRetrieveModelTemplate function syntax contains the following elements:

Parameter

Type

Direction

Description

Repository

EA.Repository

IN

An EA.Repository object representing the currently open Enterprise Architect model

Poll its members to retrieve model data and user interface status information

sLocation

String

IN

The name of the template requested; this should match the location attribute in the <ModelTemplates> section of an MDG Technology File

Return Value

Return a string containing the XMI export of the model that is being used as a template

Example

 

Public Function EA_OnRetrieveModelTemplate(ByRef Rep As EA.Repository, ByRef sLocation As String) As String

 Dim sTemplate As String

 Select Case sLocation

         Case "Templates\Template1.xml"

                 sTemplate = My.Resources.Template1

         Case "Templates\Template2.xml"

                 sTemplate = My.Resources.Template2

         Case "Templates\Template3.xml"

                 sTemplate = My.Resources.Template3

         Case Else

                 MsgBox("Path for " & sLocation & " not found")

                 sTemplate = ""

 End Select

 EA_OnRetrieveModelTemplate = sTemplate

End Function