Sparx Systems Forum

Enterprise Architect => Automation Interface, Add-Ins and Tools => Topic started by: avantol13-2 on November 04, 2014, 04:06:08 am

Title: Change Default Code Generation Language
Post by: avantol13-2 on November 04, 2014, 04:06:08 am
How can I force generation using a specific language? e.g. change the "language" field in package or class properties.

Thanks,
Alex
Title: Re: Change Default Code Generation Language
Post by: avantol13-2 on November 05, 2014, 04:22:51 am
Using the API of course, sorry I wasn't specific.
Title: Re: Change Default Code Generation Language
Post by: EXploringEA on November 05, 2014, 08:29:46 am
Not exactly clear that I will answer your question however.

If you want to set the language that will be used when generating an element you set the GenType property for each element as required.  Elements could have different languages set and they appear to be generated independently and not aware of any mechanism to do a general override at code generate.

There is a user setting ( Tools | Options | Source code engineering) where you can set the default when the element is created.  As far as I am aware you cannot change the defaults that exist with EA's UI.

One suggestion is to override the default setting when the element is created.  You can use the OnPostNewElement event and in the code set the GenType property as you require.  

Hope this helps.



Title: Re: Change Default Code Generation Language
Post by: qwerty on November 05, 2014, 09:41:25 am
The manual way would be Advanced/Update Package Status on the package.

q.