« Back

GRAPHREP dynamics

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
GRAPHREP dynamics
community graphrep documentation visualisation configuration
Answer
3/27/14 12:15 PM
When using the LEO statement @INCLUDE in a GRAPHREP definition to link to an externally kept GRAPHREP definition, eg in a file in the filesystem, it seems that any modifications of the code obtained from that file are not shown in the model editor during run-time. For example, we would like to dynamically insert vector-graphics at model-editor run-time, which are created based on user-provided SVG files. Is there any solution to make this work?

RE: GRAPHREP dynamics
Answer
10/16/13 9:05 AM as a reply to Anonymous.
The observed behaviour that dynamic changes in GRAPHREP are not rendered during runtime is intended. During the startup of the modelling toolkit, the GRAPHREPs (among other things) are loaded into the platform's core and pre-processed for visualisation. This means that a code change would require a restart of the toolkit to re-initialize the core.

For the scenario described in your message a proposal would be to use a static GRAPHREP code and solve the dynamics in the code itself by using attribute dependent representations for the included BITMAP. The following code snipplet would use an attribute called "Image file" of type STRING and include the picture with correct aspect-ratios in the model. The file itself is potentially dynamically generated, downloaded or constructed.
1
2GRAPHREP
3# reads the attribute
4AVAL filename:"Image file"
5# reads the meta info of the image
6BITMAPINFO (filename)
7# draws the image
8BITMAP (filename) x:0cm y:0cm w: (bmpwidth / 96 * 2.54cm) h: (bmpheight / 96 * 2.54cm)