Prerequisites
- You need a Designer license
- You should have read the following tutorial: arKItect Designer Getting Started
- You need to create a new empty project
Hello world
Meta-model prerequisites
To run a script, there are some prerequisites:
- Run
arKItect and create a new project without a template
- Create a Program attribute at the root of Rules (used to store the script and launch it)
- In order to launch the script, we need to have at least one projection where the script is accessible, so create a filter (named all for example) where all rules are checked
Creation of your first script
Now you can create and run your first script.
To get started, we can try to run a "Hello world" program:
Result:
Hello world! ===={ Script Execution Terminated }==========================
It is important to know that all the code you write must be in a function with a parameter self (the function can be named as you want). The value of self represents a reference to the object where this script is run (near the root object in view all).
A script to create a simple meta-model
Create rules
Create a simple architecture with flow connecting functions allocated to systems.
Add attributes to a given type
Result:
Date Description ===={ Script Execution Terminated }==========================
We can see that the attributes have been created by a script.
Change the properties of a given type
Result:
(0, 0, 0) Rectangle (0, 255, 0) Rounded Rectangle Description ===={ Script Execution Terminated }==========================
The roperties have been changed.
Create filters
Result:
all Functions only all System and Functions ===={ Script Execution Terminated }==========================
Check rules
In the filter Functions, no rules are checked, so we need check the rule Function in this filter.
Add data in the project
We will try to add some data to check if our meta-model works fine.
Do the same actions in only one script
You can write all previous scripts in only one script: