0% found this document useful (0 votes)
50 views1 page

Create Beam Using Two Points

The document contains a C# code snippet that connects to a Tekla Structures Model and creates a new beam with specified start and end points. It sets the beam's material to 'S235JR' and profile to 'HEA400', then inserts the beam into the model. Finally, it commits the changes to ensure the model is updated and views are redrawn.

Uploaded by

Ashraf2008
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views1 page

Create Beam Using Two Points

The document contains a C# code snippet that connects to a Tekla Structures Model and creates a new beam with specified start and end points. It sets the beam's material to 'S235JR' and profile to 'HEA400', then inserts the beam into the model. Finally, it commits the changes to ensure the model is updated and views are redrawn.

Uploaded by

Ashraf2008
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

using Tekla.Structures.

Model;
using TSG = Tekla.Structures.Geometry3d;

private void button1_Click(object sender, EventArgs e)


{
// Create a new Model object that represents the Tekla Structures Model you
have opened in Tekla Structures.
Model myModel = new Model();

// Check if we have a Tekla Structures Model that you can connect to.
if (myModel.GetConnectionStatus())
{
// Create a new instance of the Beam class based on created start and end
points for the beam.
Beam myBeam = new Beam(new TSG.Point(1000, 1000, 1000), new TSG.Point(6000,
6000, 1000));

// Set the Beams Material and Profile.


myBeam.Material.MaterialString = "S235JR";
myBeam.Profile.ProfileString = "HEA400";

// Insert the Beam into the Tekla Structures Model.


myBeam.Insert();

//Make sure all changes that have been done are updated in Tekla Structures
and that the model views are redrawn
//accordingly.
myModel.CommitChanges();
}
}

You might also like