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.

OperationRemoveFromPourUnit Method

Removes model object from pour unit Model object types accepted are assembly types except cast in situ, reinforcements of different kind, components and bolts

Namespace:  Tekla.Structures.Model.Operations
Assembly:  Tekla.Structures.Model (in Tekla.Structures.Model.dll) Version: 2018.1.0.0 (2018.1.0.0)
Syntax
public static bool RemoveFromPourUnit(
	List<ModelObject> objectsToBeRemoved
)

Parameters

objectsToBeRemoved
Type: System.Collections.GenericListModelObject
the list of model objects to be added.

Return Value

Type: Boolean

[Missing <returns> documentation for "M:Tekla.Structures.Model.Operations.Operation.RemoveFromPourUnit(System.Collections.Generic.List{Tekla.Structures.Model.ModelObject})"]

Exceptions
Exception Condition
ArgumentException Throw exceptions if object has invalid ID, do not exist in model or not valid object type.
Examples
The following example shows how to remove one rebar group from the pour unit. You will have to replace the curly braces for the List with lesser and greater than signs.
using System.Collections.Generic;
using Tekla.Structures.Model;
using Tekla.Structures.Model.Operations;

public class Example
{
     public void ExampleRemoveRebarGroupFromPour(Guid rebarGroupGuid)
     {
         var Model = new Model();

         ModelObjectEnumerator ObjectEnumerator =
            Model.GetModelObjectSelector().GetAllObjectsWithType(ModelObject.ModelObjectEnum.REBARGROUP);

         RebarGroup rebarGroup = null;
         bool bFound = false;
         if(ObjectEnumerator.GetSize() > 0)
         {
             while(ObjectEnumerator.MoveNext())
             {
                 rebarGroup = ObjectEnumerator.Current as RebarGroup;
                 if(rebarGroup != null)
                 {
                     if(rebarGroup.Identifier.GUID == rebarGroupGuid)
                     {
                         bFound = true;
                         break;
                     }
                 }
            }
         }

         if(bFound)
         {
             var objectsToRemove = new List{ModelObject}() { rebarGroup };
             RemoveFromPourUnit(objectsToRemove);
         }
     }
}
See Also