Modify beam with tekla live link or tekla component

here in this case am taking the existing beam which has a plane cut

i took the cutplane and tried to move it and modify the beam it does not work like that
can some one let me know any other solutions

or i need component that delete the tekla object so i can select the part and delete it then i can recreate the part

Hi, you can’t do it like this. Cut plane - that’s Tekla object, you change it, not a beam. Also you can’t do something with Tekla object using Grasshopper function, you should cast Tekla to Grasshopper:


After a moving GR plane you can do something with Tekla cut plane just throw C#.
I asked ChatGPT about this code, it looks ok, but I didn’t test it. You can start with it:

using Tekla.Structures.Model;
using Tekla.Structures.Geometry3d;
using Tekla.Structures.Model.UI;

// Inputs:
//   cutObject: existing Tekla cut object (e.g., CutPlane)
//   ghPlane: Grasshopper Plane

private void RunScript(object cutObject, Plane ghPlane, ref object A)
{
    // Validate inputs
    if (cutObject == null || ghPlane == null)
    {
        A = "Invalid input.";
        return;
    }

    var model = new Model();
    if (!model.GetConnectionStatus())
    {
        A = "Tekla model is not connected.";
        return;
    }

    // Convert Grasshopper plane to Tekla Structures plane
    Tekla.Structures.Geometry3d.Plane teklaPlane = new Tekla.Structures.Geometry3d.Plane
    {
        Origin = new Point(ghPlane.OriginX, ghPlane.OriginY, ghPlane.OriginZ),
        AxisX = new Vector(ghPlane.XAxis.X, ghPlane.XAxis.Y, ghPlane.XAxis.Z),
        AxisY = new Vector(ghPlane.YAxis.X, ghPlane.YAxis.Y, ghPlane.YAxis.Z)
    };

    // Update Tekla cut plane
    if (cutObject is CutPlane planeCut)
    {
        planeCut.Plane = teklaPlane;

        if (!planeCut.Modify())
        {
            A = "Failed to modify the cut plane.";
            return;
        }

        model.CommitChanges();
        A = "Cut plane updated successfully.";
    }
    else
    {
        A = "Input object is not a CutPlane.";
    }
}

thankyou so much
i shall give a try and check and come back by evening ..

@YAHOR thank you so much i to got help from chatgpt and made it work below code solved now i can modify the cut plane

using TSM = Tekla.Structures.Model;
using TSG = Tekla.Structures.Geometry3d;
using RhinoPlane = Rhino.Geometry.Plane;

// Connect to Tekla model
var model = new TSM.Model();
if (!model.GetConnectionStatus())
{
  A = "No Tekla model connection.";
  return;
}

// Cast Tekla CutPlane
var cut = planeCut as TSM.CutPlane;
if (cut == null)
{
  A = "Input is not a Tekla CutPlane.";
  return;
}

// Cast Rhino plane (value type = cannot use 'as')
if (!(ghPlane is RhinoPlane))
{
  A = "Input plane is not a Rhino.Geometry.Plane.";
  return;
}
RhinoPlane rPlane = (RhinoPlane) ghPlane;

// Build Tekla model Plane
var tPlane = new TSM.Plane
  {
    Origin = new TSG.Point(rPlane.Origin.X, rPlane.Origin.Y, rPlane.Origin.Z),
    AxisX = new TSG.Vector(rPlane.XAxis.X, rPlane.XAxis.Y, rPlane.XAxis.Z),
    AxisY = new TSG.Vector(rPlane.YAxis.X, rPlane.YAxis.Y, rPlane.YAxis.Z)
    };

// Apply and commit
cut.Plane = tPlane;

if (!cut.Modify())
{
  A = "Failed to modify the CutPlane.";
  return;
}

model.CommitChanges();
A = "Cut-plane updated successfully.";

here is the visual script