Book a Demo

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

Prev Next

Source Code Options

You can set a wide range of options for generating code in the models you work with. These include:

  • How to format the generated code
  • How to respond to certain events during code generation
  • Whether to generate a diagram from the code

Access

On the 'Preferences' dialog, select the 'Source Code Engineering' option

Ribbon

Start > Appearance > Preferences > Preferences

Keyboard Shortcuts

Ctrl+F9

Configure code generation options

Field

Action

See also

Wrap long comment lines at

Type in the number of characters to allow in a comment line before wrapping the text to the next line.

Auto Layout Diagram on Import

Click on the drop-down arrow and select if and when a diagram is automatically generated on code import.

Default Layout Diagram type

Click on the drop-down arrow and select the layout type to apply to diagrams generated from code.

Layout Diagrams

Output files use both CR & LF

Select the checkbox to include carriage returns and line feeds; set this option according to what operating system is currently in use, as code might not render correctly.

Prompt when synchronizing (reversing)

Select the checkbox to display a prompt when synchronization occurs.

Remove hard breaks from comments on import

Select the checkbox to remove hard breaks from commented sections on importation.

Auto generate role names when creating code

Select the checkbox to generate role names when creating code.

Do not generate members where association direction is 'Unspecified'

Select the checkbox to prevent generation of members if the Association direction is unspecified.

Create dependencies for operation returns and parameter types

Select the checkbox to generate dependencies for operation returns and parameter types.

Comments: Generate

Select the checkbox to generate comments.

Comments: Reverse

Select the checkbox to generate reverse comments.

Remove prefixes when generating Get/Set properties

Type in the prefixes, separated by semi-colons, used in your variable naming conventions, to be removed in the variables' corresponding get/set functions.

Treat as suffixes

Select the checkbox to use the prefixes defined in the 'Remove prefixes when generating Get/Set properties' field as suffixes.

Capitalized Attribute Name for Properties

Select the checkbox to capitalize attribute names for properties.

Use 'Is' for Boolean property Get()

Select the checkbox to use the Is keyword for the Boolean property Get().

Notes

  • It is worthwhile to configure these settings, as they serve as the defaults for all Classes in the model; you can override most of these on a per-Class basis using the custom settings (from the 'Code Generation' dialog)

Learn more