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