This application assigns user defined attributes to any model object base on filters and rules. This works regardless of how the objects were created (E.g. custom components, system components, etc...) This application can also set the numbering prefix, start number and other object properties if entered.
To install the extension:
- Download the extension.
- Install the extension using the 'Tekla Structures extension manager'
To run the extension, follow these steps
- Open the page 'Applications & Components' in the side pane.
- Search the Attribute Importer tool in the side pane view.
- Double click the tool icon or name
- There will then soon be a progress bar to show the program is working (It may take a few moments to load)
Please note that to get the extension application to make anything useful you need to have some attribute files containing the filter settings, attribute rules and setters. Please see the paragraph Attribute Importer settings how to create these attribute files.
Assigning of properties and user defined attributes is based on one or more set of rules. One rule set consists of:
- One standard Tekla Structures selection filter. This is the ‘main’ filter.
- Zero or more custom filters. Custom filter is based on report or user defined attribute values.
- One or more property or user defined attribute setters
The functionality is fairly straight forward as follows:
- For each rule set the application will first select all objects matching with the ‘main’ filter
- Then the application will enumerate each selected object and check if all custom filters in current rule set are matching, if yes then the application assigns the properties and/or user defined attributes given in the current rule set to the object.
The application can read both ASCII/text files or Excel based files. In your model folder you need to create a new folder called "AttributeImport". In this folder any file with *.xls, *.xlsr, or *.atr will be used as import files and read each time the tool is launched.
The application reads in each import files and creates a rule set for each row encountered in the file. Each row is independent and can vary as needed. The columns in excel separate the settings from each other, it is important to follow proper syntax in the columns and separate the various settings. The text files use a semi colon ";" to separate the different settings instead.
You can download sample settings for both .xlsx and .atr file types at the Tekla Warehouse page.
1. You must first have a Tekla Structures model filter specified.
- This must start with the string "filter_select:"
- The string after the ":" must match an existing Tekla Structures model filter from the XS_SYSTEM path.
- Example filter_select:HTA
2. Next you can choose to set the numbering prefix and start numbers
- The numbering prefix must start with the string "prefix:"
- The numbering start number must start with the string "startno:"
- You can choose to have Tekla Structures automatically number the objects by using a positive integer value, E.g. 1, 2, 3
- You can use a - for the start number to manually set the numbering, E.g. -6
- Example prefix:E147
- Example startno:-6
- Example result mark = E1476
- Please note that setters "prefix:" and "startno:" will set the part and assembly numbering series to be same. If you need to get the part and assembly series values different you can use the property setters as shown below.
3. Next you can have multiple report and/or uda type custom secondary filters
- Report type filters must start with the string "filter_report:"
- Uda type filters must start with the string "filter_uda:"
- Example filter_report:LENGTH=500.00
- Example filter_uda:comment=FVZ
4. Next you can have multiple setters for user defined attributes
- This must start with the string "uda:" following the name of the UDA, equal sign and the value.
- Example uda:PRODUCT_DESCR=HTA500
- Please make sure the value is compatible with the data type of the UDA. For number type give the number without decimal dot, for float type of UDA give always the value with decimal separator (.). If you need to assign numerical value to a UDA of string type give the value by enclosing the number into quotes. For example PRODUCT_DESCR="100".
- This must start with the string "property:" following the name of the property, equal sign and the value.
- Property naming follows the Tekla Open API naming, some are given in following examples but for complete specification please take a look on Open API reference.
- Example property:Finish=Zinc coated
- Example property:Material.MaterialString=C30/35
- With property setter you can control the part and assembly numbering series individually. To set the numbering series prefix and/or start numbers please add one ot more of the following property setters (replace the example values below to whatever values you prefer)
- Attribute importer can be used to set the object properties which data type is either a number (int), decimal number (double) , text (string) or an enumerator type.
- For enumerator types give the value as a text matching with the naming as it is in Tekla Open API. For example, if you want to set the cast unit type give the setter as follows, property:CastUnitType=CAST_IN_PLACE (or property:CastUnitType=PRECAST)
Using a text editor you can edit the AttributeImporter.exe.config file to change advanced options.
- The setting "showLog" can be set to True or False depending on whether you want to automatically display the log file with the import process history.
- "textFileExtension" can be changed to look at only certain import files based on extension
- "excelFileExtension" can be changed to look at only certain import files
- "importFoldername" can be changed to specify a different name of the import folder to use when looking for files to run
- "logFileName" can be changed to create new/different log files under model import folder
Reading the attribute settings from text files is faster compared to reading xls-files.If you have many Excel files you can speed up the process by saving the Excel files as comma separated files and use the text file extension (*.atr).