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.

ModelObjectSelector Class

The ModelObjectSelector class can be used to make different model object selections from the current model.
Inheritance Hierarchy
SystemObject
  Tekla.Structures.ModelModelObjectSelector

Namespace:  Tekla.Structures.Model
Assembly:  Tekla.Structures.Model (in Tekla.Structures.Model.dll) Version: 2019.0.0.0 (2019.0.0.0)
Syntax
[SerializableAttribute]
public sealed class ModelObjectSelector

The ModelObjectSelector type exposes the following members.

Methods
  Name Description
Public method GetAllObjects
Returns an enumerator of all the model objects in the current model.
Public methodCode example GetAllObjectsWithType(Type)
Returns an enumerator of all the model objects in the current model with the given base type.
Public method GetAllObjectsWithType(ModelObjectModelObjectEnum)
Returns an enumerator of all the model objects in the current model with the given type.
Public method GetEnumerator
Returns an enumerator of all the model objects in the current model.
Public method GetFilteredObjectsWithType
Returns an enumerator of the model objects in the current model with the given type and selected by the filter.
Public method GetObjectsByBoundingBox
Returns an enumerator of the model objects in the current model colliding with the given geometrical bounding box. Note that this method uses approximate bounding boxes and thus is NOT EXACT, and may return objects not necessarily colliding with the given box but only being somewhere near to it.
Public method GetObjectsByFilter
Returns an enumerator of the model objects in the current model selected by the given selection filter definition.
Public method GetObjectsByFilterName
Returns an enumerator of the model objects in the current model selected by the given selection filter.
Top
Examples
using Tekla.Structures.Model;

public class Example
{
       public void Example1()
       {
           Model Model = new Model();

           ModelObjectSelector Selector = Model.GetModelObjectSelector();

           foreach(ModelObject MO in Selector)
           {
               Beam B = MO as Beam;
               if(B != null)
               {
                   Solid solid = B.GetSolid();
               }
           }
       }
}
See Also