Book a Demo

Author Topic: Custom code template : header file + implem file  (Read 4422 times)

vinzz38

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
Custom code template : header file + implem file
« 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.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Custom code template : header file + implem fi
« Reply #1 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

vinzz38

  • EA Novice
  • *
  • Posts: 7
  • Karma: +0/-0
    • View Profile
Re: Custom code template : header file + implem fi
« Reply #2 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 ?

KP

  • EA Administrator
  • EA Expert
  • *****
  • Posts: 2919
  • Karma: +55/-3
    • View Profile
Re: Custom code template : header file + implem fi
« Reply #3 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.
The Sparx Team
[email protected]