API Reference

Detailed and full API reference helps you master Tekla development

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

OperationObjectMatchesToFilter Method (ModelObject, FilterExpression)

Checks whether the object matches to the criteria in the given filter.

Namespace:  Tekla.Structures.Model.Operations
Assembly:  Tekla.Structures.Model (in Tekla.Structures.Model.dll) Version: 2023.0.1
public static bool ObjectMatchesToFilter(
	ModelObject ModelObject,
	FilterExpression FilterExpression


Type: Tekla.Structures.ModelModelObject
The model object to check.
Type: Tekla.Structures.FilteringFilterExpression
The definition of a selection filter to check against.

Return Value

Type: Boolean
True if the object matches to the given filter criteria.
ArgumentExceptionThrown when the ModelObject is not valid.
In the following example a connection to the Tekla Structures model has already been established. The example code creates a beam to the model and moves the beam one meter in the x and y directions.
using Tekla.Structures.Model;
using Tekla.Structures.Model.Operations;
using Tekla.Structures.Filtering;
using Tekla.Structures.Filtering.Categories;
using Tekla.Structures.Geometry3d;
using System.Windows.Forms;

public class Example
       public void Example1()
           Beam Beam1 = new Beam(new Point(0, 0, 0), new Point(3000, 0, 0));
           Beam1.Profile.ProfileString = "PL10*140";
           Beam1.Name = "GetObjectsByFilter";
               BinaryFilterExpression FilterExpression1 = new BinaryFilterExpression(new PartFilterExpressions.Name(),
                                                              new StringConstantFilterExpression("GetObjectsByFilter"));
               if(Operation.ObjectMatchesToFilter(Beam1, FilterExpression1))
                   MessageBox.Show("Object matches the filter");
See Also
Was this helpful?
The feedback you give here is not visible to other users. We use your comments to improve the content.