06-01-2013, 03:47 PM
Hi kvtasp,
This is my code to create a silos ( practice from the exercise " Create Beam").
using Tekla.Structures.Model;
using Tekla.Structures.Solid;
using Tekla.Structures.Geometry3d;
using T3D = Tekla.Structures.Geometry3d;
using TSM = Tekla.Structures.Model;
using TSMUI = Tekla.Structures.Model.UI;
// Additional Namespace references
using System.Collections;
using System.Diagnostics;
using System.IO;
using System.Globalization;
using System.Threading;
namespace Create_Beam
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
Model model = new Model();
double a = Math.Tan(int.Parse(textBox4.Text) * 2 * 3.141592654 / 360);
double c = (int.Parse(textBox1.Text)/2 - int.Parse(textBox2.Text)/2 )* a ;
Beam beam = new Beam (new T3D.Point (0,0,c),new T3D.Point (0,0,0)) ;
beam.Profile.ProfileString = "EPD"+textBox1.Text + "*" + textBox1.Text + "*" + textBox2.Text + "*"+ textBox2.Text + "*" + textBox3.Text ;
// beam.Position.Rotation.
beam.Insert();
Beam beam2 = new Beam (new T3D.Point(0,0, c+int.Parse(textBox5.Text)), new T3D.Point (0,0,c));
beam2.Profile.ProfileString = "PD" + textBox1.Text + "*" + textBox3.Text ;
beam2.Insert();
model.CommitChanges() ;
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
}
private void label1_Click(object sender, EventArgs e)
{
}
private void textBox2_TextChanged(object sender, EventArgs e)
{
}
private void textBox3_TextChanged(object sender, EventArgs e)
{
}
private void textBox4_TextChanged(object sender, EventArgs e)
{
}
private void textBox5_TextChanged(object sender, EventArgs e)
{
}
private void pictureBox1_Click(object sender, EventArgs e)
{
}
}
}
I did some buttons to allow the user prompt the dimension of the silo. I have no idea how to upload a small application file here. But we can discuss my code and I can explain for you.
Hope you will be better with this example!
This is my code to create a silos ( practice from the exercise " Create Beam").
using Tekla.Structures.Model;
using Tekla.Structures.Solid;
using Tekla.Structures.Geometry3d;
using T3D = Tekla.Structures.Geometry3d;
using TSM = Tekla.Structures.Model;
using TSMUI = Tekla.Structures.Model.UI;
// Additional Namespace references
using System.Collections;
using System.Diagnostics;
using System.IO;
using System.Globalization;
using System.Threading;
namespace Create_Beam
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
Model model = new Model();
double a = Math.Tan(int.Parse(textBox4.Text) * 2 * 3.141592654 / 360);
double c = (int.Parse(textBox1.Text)/2 - int.Parse(textBox2.Text)/2 )* a ;
Beam beam = new Beam (new T3D.Point (0,0,c),new T3D.Point (0,0,0)) ;
beam.Profile.ProfileString = "EPD"+textBox1.Text + "*" + textBox1.Text + "*" + textBox2.Text + "*"+ textBox2.Text + "*" + textBox3.Text ;
// beam.Position.Rotation.
beam.Insert();
Beam beam2 = new Beam (new T3D.Point(0,0, c+int.Parse(textBox5.Text)), new T3D.Point (0,0,c));
beam2.Profile.ProfileString = "PD" + textBox1.Text + "*" + textBox3.Text ;
beam2.Insert();
model.CommitChanges() ;
}
private void textBox1_TextChanged(object sender, EventArgs e)
{
}
private void label1_Click(object sender, EventArgs e)
{
}
private void textBox2_TextChanged(object sender, EventArgs e)
{
}
private void textBox3_TextChanged(object sender, EventArgs e)
{
}
private void textBox4_TextChanged(object sender, EventArgs e)
{
}
private void textBox5_TextChanged(object sender, EventArgs e)
{
}
private void pictureBox1_Click(object sender, EventArgs e)
{
}
}
}
I did some buttons to allow the user prompt the dimension of the silo. I have no idea how to upload a small application file here. But we can discuss my code and I can explain for you.
Hope you will be better with this example!