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 select objects from the Tekla Structures user interface. Currently, these selections both select the objects from the database and highlight them visually.
Inheritance Hierarchy
SystemObject
  Tekla.Structures.Model.UIModelObjectSelector

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

The ModelObjectSelector type exposes the following members.

Constructors
  Name Description
Public method ModelObjectSelector
Creates a new model object selector instance.
Top
Methods
  Name Description
Public method GetObjectsByBoundingBox
Returns an enumerator of the given view's visible model objects that collide 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 GetSelectedObjects
Returns an enumerator of all the selected model objects in the model view.
Public method Select(ArrayList)
Selects a list of objects from the user interface.
Public method Select(ArrayList, Boolean)
Selects a list of objects from the user interface.
Top
Examples
using Tekla.Structures.Model;
using Tekla.Structures.Geometry3d;
using System.Collections;

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

           Beam B = new Beam(new Point(0,0,0), new Point(0,0,6000));
           Beam B1 = new Beam(new Point(0,1000,0), new Point(0,1000,6000));
           Beam B2 = new Beam(new Point(0,2000,0), new Point(0,2000,6000));

           B.Insert();
           B1.Insert();
           B2.Insert();

           ArrayList ObjectsToSelect = new ArrayList();
           ObjectsToSelect.Add(B);
           ObjectsToSelect.Add(B2);

           Tekla.Structures.Model.UI.ModelObjectSelector MS = new Tekla.Structures.Model.UI.ModelObjectSelector();
           MS.Select(ObjectsToSelect);

           Model.CommitChanges();
       }
}
See Also