Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: vinzz38 on August 24, 2013, 12:54:16 am

Title: Custom code template : header file + implem file
Post by: vinzz38 on August 24, 2013, 12:54:16 am
Hello all,

is it possible to create a custom code template who generate 2 files like C++ (.hpp and .cpp)?

Thank you.
Title: Re: Custom code template : header file + implem fi
Post by: Eve on August 26, 2013, 08:49:18 am
Yes, but you need to specify that an implementation file is required in an MDG technology.

See http://www.sparxsystems.com/enterprise_architect_user_guide/10/extending_uml_models/define_code_options.html
Title: Re: Custom code template : header file + implem fi
Post by: vinzz38 on August 26, 2013, 06:55:48 pm
Ok thank for your reply.

I create a MDG Technology file with good code options:
- if I import the file by Settings> MDG Technologies ... > Advanced ... > Add Path, the code options work.
- if I import the file programmatically( ImportTechnology, C# method of Repository object in my Addin), the technology is loaded, but the code options don't work).
I need to import my technology file programmatically, is there a way to make the code options work ?
Title: Re: Custom code template : header file + implem fi
Post by: KP on August 27, 2013, 08:55:12 am
Quote
if I import the file programmatically( ImportTechnology, C# method of Repository object in my Addin), the technology is loaded, but the code options don't work).
ImportTechnology is the old way. To quote the help file: This applies to technologies imported into pre-7.0 versions of Enterprise Architect (imported technologies), not to technologies referenced in version 7.0 and later (referenced technologies).

Instead, you need to respond to the EA_OnInitializeTechnologies event.