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.

OperationCopyObject Method (ModelObject, Vector)

Copies the model object using the given translation vector.

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 ModelObject CopyObject(
	ModelObject Object,
	Vector CopyVector
)

Parameters

Object
Type: Tekla.Structures.ModelModelObject
The model object to copy.
CopyVector
Type: Tekla.Structures.Geometry3dVector
The translation vector for copying.

Return Value

Type: ModelObject
The copied model object on success, null on failure.
Examples
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 copies the beam to a location that is one meter in the x and y directions.
using Tekla.Structures.Model;
using Tekla.Structures.Model.Operations;
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));
           Vector Vector1 = new Vector(1000, 1000, 0);
           Beam1.Profile.ProfileString = "PL10*140";
           if(Beam1.Insert())
           {
               Beam Beam2 = Operation.CopyObject(Beam1, Vector1) as Beam;
               if(Beam2 != null)
                   MessageBox.Show("Copy succeeded");
           }
       }
}
See Also