Auto Attributes
Script filled attributes
Each component in cadwork is described geometrically and with regard to its position in the entire construction project. On the other hand there is an almost unlimited number of further attributes is available. Some of these attributes like color, material, name, building (building) and storey (storey) have to be set during the generation of the component. during the generation of the component. Others are optionally available to the user. Each of these attributes are explicitly defined by the user by setting them via Modify. Attributes are used to fully describe the part properties.
Furthermore, they are used for the creation of a suitable structure of the construction project and for the transfer of specific information to downstream systems such as an such as an ERP system.
Often, the content of an attribute is dependent on the content of other attributes or even geometric information. In this case, it is tedious to define the content manually. manually. For this reason cadwork provides in version 29 attributes which can which calculate their content independently with the help of a script at runtime. These are the so-called script-filled attributes. As script language Python is used. The Python script has access to various properties of the parts via the cadwork API. of the parts. These can be evaluated in the script and the content of the attribute can be calculated.
In contrast to all previous attributes, the content of a script-filled attribute is not defined manually by the user. The task of the user is to create a Python script, which on the basis of other element properties (geometry and attributes) to calculate the content of the script-filled attribute. The calculated content is displayed as for all other attributes (Modify, info window, plan outputs), can be used for activating/deactivating as well as showing/hiding can be used for activating/deactivating and hiding, can be used as a comparison and sorting criterion for the list calculation and is exported to the different lists. The only difference to the known attributes is the automated generation of the content via a Python script.
Creation of script-filled attributes
These attributes are created similar to the user-defined attributes in the Attributes dialog (User profile -> Wood... -> Attributes) in the new Script Filled -> Configuration tab.
A created script-filled attribute is available for each element type in cadwork. In the tab "Type script populated" the evaluation of the script can be limited to single element types. Tjis can be useful if, for example different evaluations are required for plates and beams. If the evaluation is intended only for elements of the type beam, the content of this attribute remains empty for all other element types. If the element type is subsequently changed, a recalculation of the attributes is triggered.
execution status
The execution status of the scripts can be controlled. The icon for configuring the script-filled attributes is visualized in the Windows menu bar to the left of the message center icon. This display hides a button that can be used to subsequently change the selected status.
available functions
The available functions are marked in the documentation with an info description.
example code
group and length
In this example, the group as well as the component length is concatenated. The length is rounded to 4 decimal digits.
group_length.py | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 |
|
dimension check
This script checks whether the cross-sections are standard dimensions or not.
dimension_check.py | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
|
concatenate attributes and round dimension
In this example, the attributes name and material are concatenated with the geometric properties width and height. The width and height are rounded to the nearest 10.
attributes_dimension.py | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
|
material and storey
Concatenation of the Building Storey with the material.
material_storey.py | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 |
|