OperationMoveObject Method (ModelObject, Vector)

Moves the model object using the given translation vector.

Namespace:  Tekla.Structures.Model.Operations
Assembly:  Tekla.Structures.Model (in Tekla.Structures.Model.dll) Version: 2023.0.3
Syntax
public static bool MoveObject(
	ModelObject Object,
	Vector TranslationVector
)

Parameters

Object
Type: Tekla.Structures.ModelModelObject
The model object to move.
TranslationVector
Type: Tekla.Structures.Geometry3dVector
The vector for moving the object.

Return Value

Type: Boolean
True on success, false on failure.
Remarks

Note that the object is moved and updated in the view so ModelObject.Modify() is not needed. Call Modify() only after the object's data has been updated with the ModelObject.Select() method.

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 moves the beam 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));
           Beam1.Profile.ProfileString = "PL10*140";
           if(Beam1.Insert())
           {
               Vector Vector1 = new Vector(1000, 1000, 0);

               if(Operation.MoveObject(Beam1, Vector1))
                   MessageBox.Show("Move 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