Bundt User's Manual · Bundt Toolset version 1.0.1.0

Scripting

Scripting means programming-in-the-small. In other words, a script is a small program that you can write and then run.

Scripting is used in the Bundt Toolset as a way to carry out repetitive or tedious processes, such as re-creating a model or adding new elements to a number of models in a systematic way.

Details

When you run a script, the code that you write does things in Bundt, such as creating or altering models or model elements.

Scripting is a very fast and powerful approach to manipulating models and their contents. Of course, you can use a Scripting Session window in ModelDesigner to attain the same goals, but scripting allows you to do things faster and more systematically. For example, you can write a script that adds some classes to a type model, and then run it against multiple models, guaranteeing that you do exactly the same thing to all of them.

If you have no previous experience in programming or scripting, you will need to get acquainted with it before you can write useful scripts. If you have some experience, you can check out the Bundt Scripting Reference for a comprehensive reference to scripting in Bundt.

A sample script

This is a small sample script:

create type model Test version '1.0.0.0';
create class Building;

The above script creates a new type model named Test and with version 1.0.0.0, and then adds a new class named Building to it. This is a very small example, and many other things can be accomplished through scripting.

Generating scripts

ModelDesigner is capable of automatically generating scripts to re-create a model or parts of a model. You can use generated scripts to check out what scripts look like, and then try to modify them to adapt them to your needs.

You can try the automatic script generation on ModelDesigner through the Scripting menu.

See Also


Contents distributed under a Creative Commons Attribution 4.0 International License · About · Terms of Use · Contact Us · last updated on 08 October 2020