Skip to content

CODE VIEW🔗

Modelon Impact uses Modelica as its model description language. When you build or modify a model, the changes are stored as Modelica code. The Code View provides direct access to this underlying Modelica source code, allowing you to view and edit it as needed.

How to Navigate to Code View🔗

  1. Open the model you want to edit.
  2. Make sure you are in Model mode.
  3. Use the toggle button in the top toolbar to switch from Diagram to Code view.

If the model or class is write-protected (marked as “Read-only”), you will be able to view the code but not make changes. This is indicated next to the class name above the toolbar.

Editing🔗

Editing the source code is a feature intended primarily for experienced Modelica users. For most users, it is recommended to make changes in the Diagram View, which provides a safer and more intuitive interface.

You can write code directly in the editor. Syntax is checked automatically, and any errors are highlighted to help you locate and fix issues quickly. If there are unsaved edits, you must save or discard them before switching to another model.

Attention

Edits are temporarily stored in your browser’s memory until you save. To avoid losing work due to browser or session interruptions, remember to save frequently.

Keyboard Shortcuts🔗

Keyboard shortcuts are listed here.

Command Palette🔗

The Command Palette gives quick access to common editor actions. Open it by clicking Shift + Ctrl/Cmd + P while the editor is active and start typing to find a command.

Examples of useful features are:

  • Go to Line – Jump directly to a specific line number, useful when locating errors.
  • Fold/Unfold Code – Collapse or expand code blocks.
  • Toggle Comments – Quickly comment or uncomment selected lines.
  • Adjust Font Size – Change font size.

You can also use the Command Palette to discover useful keyboard shortcuts.

Toolbar🔗

The toolbar gives you quick access to frequently used actions:

  • Save – Save your current code changes.
  • Navigate Back / Forward – Move between previously viewed classes.
  • Check Local Balance – Analyze the model to check if the number of equations matches the number of unknowns.

Diagnostics🔗

Check Local Balance🔗

The local balance check verifies that the number of variables and equations in the current class match. A balanced model means it is mathematically solvable.

Syntax Check🔗

The editor continuously checks your code for syntax errors as you type. Errors are highlighted so you can correct them before saving or switching views.

Back to top