Sparx Systems Forum

Enterprise Architect => General Board => Topic started by: Agamenon on March 08, 2007, 04:58:51 am

Title: Using custom templates
Post by: Agamenon on March 08, 2007, 04:58:51 am
Hi,

I'm using EA trial and I'm triyng to use a template that I create "Class_Teste". Inside I put teh phrase "Teste", and called it before the %ClassBody%, like this:

//Template Class
%ClassNotes%
%PI=" "%
%ClassDeclaration%
%ClassBody%
%Operation_Teste%

But the word "Teste" do not appear in the end of the class.

I'm doing something wrong?

Title: Re: Using custom templates
Post by: Eve on March 08, 2007, 01:10:16 pm
Two things:
1. Custom templates contain a double underscore, you've only used a single underscore.
2. You've created a template "Class__Teste" and trying to call a different template "Operation__Teste".  (Once I add the extra underscore)
Title: Re: Using custom templates
Post by: Agamenon on March 09, 2007, 05:24:14 am
Hi Simon,

Was my error indeed. But I have another question: how can I take the project name in the script? I don't found any MACRO to do this. Do you know how?

Thanks a lot.
Title: Re: Using custom templates
Post by: Eve on March 12, 2007, 01:36:58 pm
What do you mean project name?
Title: Re: Using custom templates
Post by: Agamenon on March 13, 2007, 06:09:27 am
Hi Simon,

When I create a new project in EA he asks me to give a name to the file *.ead. I want to get this name and use it in the script.

Any idea?

Thanks
Title: Re: Using custom templates
Post by: Eve on March 13, 2007, 11:53:59 am
Sorry, it's not accessible unless you want to use EXEC_ADD_IN and Repository.ConnectionString.