Tekla Open API

Detailed and full API reference helps you master Tekla Open API

This is the most recent version of Tekla Open API.
For older versions, please visit Tekla Warehouse.

ModelObjectGetAllReportProperties Method

Retrieves all properties for the model object in one hashtable. Type for the returned value must be checked using type casting.

Namespace:  Tekla.Structures.Model
Assembly:  Tekla.Structures.Model (in Tekla.Structures.Model.dll) Version: 2018.1.0.0 (2018.1.0.0)
Syntax
public bool GetAllReportProperties(
	ArrayList stringNames,
	ArrayList doubleNames,
	ArrayList integerNames,
	ref Hashtable values
)

Parameters

stringNames
Type: System.CollectionsArrayList
An array list containing the names of the string properties.
doubleNames
Type: System.CollectionsArrayList
An array list containing the names of the double properties.
integerNames
Type: System.CollectionsArrayList
An array list containing the names of the integer properties.
values
Type: System.CollectionsHashtable
The return value, a hash table list that contains all the values that were retrieved successfully.

Return Value

Type: Boolean
True if at least one single property was retrieved successfully.
Examples
In the following example a connection to the Tekla Structures model has already been established and next the values of some report properties attributes are going to be found out for bolt groups in model.
using Tekla.Structures.Model;
using System;
using System.Windows.Forms;

public class Example
{
        public void Example1()
        {
            ArrayList sNames = new ArrayList();
            sNames.Add("NAME");
            sNames.Add("SCREW_NAME");
            sNames.Add("SCREW_TYPE");
            sNames.Add("TYPE");
            sNames.Add("TYPE1");
            sNames.Add("TYPE2");
            sNames.Add("TYPE3");
            sNames.Add("TYPE4");
            sNames.Add("STANDARD");
            sNames.Add("SHORT_NAME");
            sNames.Add("MATERIAL");
            sNames.Add("FINISH");
            sNames.Add("GRADE");
            ArrayList iNames = new ArrayList();
            iNames.Add("DATE");
            iNames.Add("FATHER_ID");
            iNames.Add("GROUP_ID");
            iNames.Add("HIERARCHY_LEVEL");
            iNames.Add("MODEL_TOTAL");
            ArrayList dNames = new ArrayList();
            dNames.Add("EXTRA_LENGTH");
            dNames.Add("FLANGE_THICKNESS");
            dNames.Add("FLANGE_WIDTH");
            dNames.Add("HEIGHT");
            dNames.Add("LENGTH");
            dNames.Add("PRIMARYWEIGHT");
            dNames.Add("PROFILE_WEIGHT");
            dNames.Add("ROUNDING_RADIUS");
            dNames.Add("LENGTH");
            dNames.Add("DIAMETER");
            dNames.Add("WEIGHT");
            dNames.Add("HEAD_DIAMETER");
            dNames.Add("THICKNESS");
            dNames.Add("WASHER.THICKNESS");
            dNames.Add("WASHER.INNER_DIAMETER");
            dNames.Add("WASHER.OUTER_DIAMETER");
            dNames.Add("WASHER.THICKNESS1");
            dNames.Add("WASHER.INNER_DIAMETER1");
            dNames.Add("WASHER.OUTER_DIAMETER1");
            dNames.Add("WASHER.THICKNESS2");
            dNames.Add("WASHER.INNER_DIAMETER2");
            dNames.Add("WASHER.OUTER_DIAMETER2");
            dNames.Add("NUT.THICKNESS");
            dNames.Add("NUT.INNER_DIAMETER");
            dNames.Add("NUT.OUTER_DIAMETER");
            dNames.Add("NUT.THICKNESS2");
            dNames.Add("NUT.OUTER_DIAMETER2");

            ModelObjectEnumerator.AutoFetch = true;
            ModelObjectEnumerator myEnum = myModel.GetModelObjectSelector().GetAllObjectsWithType(new Type[] { typeof(BoltGroup) });
            while (myEnum.MoveNext())
            {
                try
                {
                    myObject = myEnum.Current as ModelObject;
                    if (myObject != null)
                    {
                        Hashtable sValues = new Hashtable(sNames.Count + dNames.Count + iNames.Count);
                        if (myObject.GetAllReportProperties(sNames, dNames, iNames, ref sValues))
                        {
                            foreach (DictionaryEntry value in sValues)
                                Console.WriteLine(value.Key.ToString() + " : " + value.Value.ToString());
                        }
                    }
                }
                catch { }
             }
         }
}
See Also