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

TaskRemoveObjectsFromTask Method

Removes objects from the task.

Namespace:  Tekla.Structures.Model
Assembly:  Tekla.Structures.Model (in Tekla.Structures.Model.dll) Version: 2019.0.0.0 (2019.0.0.0)
Syntax
public bool RemoveObjectsFromTask(
	ArrayList ModelObjects
)

Parameters

ModelObjects
Type: System.CollectionsArrayList
An array list of model objects to be removed from the task.

Return Value

Type: Boolean
True on success.
Examples
using Tekla.Structures.Model;
using Tekla.Structures;
using System.Collections;

public class Example
{
       public void Example1()
       {
           Identifier Identifier1 = new Identifier(357);

           // Remove all the children from the task.
           Task task = new Task(Identifier1);

           if (task.Select())
           {
               ModelObjectEnumerator taskChildren = task.GetChildren();
               ArrayList objectsToRemove = new ArrayList();

               while (taskChildren.Current != null)
               objectsToRemove.Add(taskChildren.Current);

               task.RemoveObjectsFromTask(objectsToRemove);
           }
       }
}
See Also