Backgrounds

Navigation:  Editor > Using Models >

Backgrounds

Previous pageReturn to chapter overviewNext page

Graphical models may be shown with a background picture. In the Editor from the Settings menu choose the Model command to define the settings.

Static Backgrounds

Static backgrounds are just bitmaps files that you can define.

Dynamic Backgounds

Dynamic Background are .svg files in which you can enter 20-sim tokens (e.g. the model name, date, creator etc.). The tokens are replaced by 20-sim and then the .svg file has to be converted into a bitmap image. 20-sim uses the open source software Inkscape (http://inkscape.org) to make this conversion.

 

To get a clear understanding of this mechanism, have a look at the example model Examples\Tips and Tricks\Background images\BackgroundImage.emx. You can open it from the model library. In this model backgrounds are explained.

 

In the same folder where the model is stored, a background image named background.svg can be found. This an image file which contains 20-sim specific tokens like %SUBMODELNAME% and %DESCRIPTION%. These tokens will be automatically replaced by 20-sim. Have a look at the example model to see the list of available tokens.
In the same folder where the model is stored, an .xml file named inkscape_background.xml can be found. This is a script file that replaces the tokens and converts the .svg file into a png bitmap, using inkscape.

 

To create your own dynamic backgrounds:

1.Create an .svg image with the tokens that you want to use. Store it in the folder where your model is located.
2.Copy the .xml file inkscape_background.xml to your own .xml file and make it refer to the new .svg file. Store it in the folder where your model is located.
3.In the 20-sim model open the Model Properties. In the Background Image tab, select Script File and enter the name of your .xml file.