![]() |
v2.0
|
|
The parameter description file in JSON format for reinforcement units must contain grouped style parameters in the following structure:
The metadata section contains data that will be displayed in the Categories window in Renga Professional. The style template version must be specified as 3 numbers separated by dots, such as "1.2.34".
The styleParameters section contains parameter groups that describe all possible object style parameters. The visibility of parameter groups in the object style editor can be enabled or disabled using the Style Template API functions.
Each parameter must contain a name, text, and type. Depending on the parameter type, additional data is specified.
Allowed parameter types:
| Value | Description |
|---|---|
| Integer | Integer |
| Real | Real number |
| String | String |
| CoreEnum | Style Template API enumeration |
| UserEnum | User enumeration |
| Length | The length in millimeters |
| Angle | The angle in decimal degrees |
| Id | Identifier |
| Boolean | Boolean (true/false) |
For all parameter types except Id, you can specify the default key. The value of this key will be the default value of the parameter. The value cannot be empty.
For numeric parameters, you can set the minimum and maximum values using the min and max keys.
For CoreEnum, specify the CoreEnumType key. Valid values for the key can be found in the Core Enums section.
For UserEnum, create an items array and set the values to select from the list.
To allow a user to select a rebar style in the reinforcement unit style parameters, create an Id parameter:
A Lua script may contain:
Functions for getting parameters, adding rebars and rebar sets, specifying symbolic geometry, and customizing the display of rebar style parameters are in the Style namespace. The function to get the rebar style is in the Project namespace.
To get parameters, use the Style.GetParameter() function, and to get parameter values, use the Style.GetParameterValues() function, which returns a table of parameters.
Example of getting a parameter value with Style.GetParameterValues():
In this case, the value of the "Width" parameter from the "Dimensions" parameter group will be printed to the log.
To set the visibility of parameters in the object style editor, you must get the parameter group or to the parameter object using the functions Style.GetParameterGroup(groupName) or Style.GetParameter(groupName, parameterName).
To get the rebar style, use the Project.GetRebarStyle() function, which returns the rebar style by ID. Then you need to cast the obtained rebar style to the parameter container using the CastToParameterContainer() function. And then you can get the style parameters using the GetParameterValues() function.
Example of how to get rebar diameter:
Functions for describing rebars:
An example of how to add a rebar set:
The detailed and simplified reinforcement geometry is automatically generated from the rebar description.
Symbolic geometry defines the symbolic representation of a reinforcement unit in a drawing.
To set the symbolic geometry, the Style.SetSymbolicGeometry(modelGeometry) function is used, which takes as an argument a model geometry. The model geometry is created from two-dimensional geometric primitives.