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: 2024.0.0+a110b435391768740483e3032720a566518c9a63
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
Exceptions
ExceptionCondition
ArgumentExceptionThrow 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
Was this helpful?
The feedback you give here is not visible to other users. We use your comments to improve the content.
Previous
Next