There is a global object that is available to all designs, models, and rules, the "R" global object (we call it "big R")—"R" because its expressions begin with "R." (R - dot).
It contains several useful properties and methods.
Here is a list of Big R's properties:
•R.version – returns the kernel version of kBridge—with "kernel" being kBridge"s underlying code
•R.rootModel – returns the root model of your model tree.
•R.world – returns the world object.
Users can also define the design ProjectGlobals with the methods and rules that can be drawn from anywhere in the project. This is done by coding, R.globals.<rule name>
The following lists Big R's methods:
•R.degrees(radians: number): number – convert radians to degrees
•R.radians(degrees: number): number – convert degrees to radians
•R.error(message: string): never – deliberately throw an error
•R.ref(refChain as string): any – returns the value of the rule located at the refChain
•R.refMethod(refchain: string, ...args: any[]): any – runs the Method located at the refChain with the given arguments
There is more information in the Reference section of this documentation, Global R Object.