Basic example of a C# basic structure to tekla
Basic example of a C# basic structure to tekla
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Tekla.Structures;
using Tekla.Structures.Model;
using Tekla.Structures.Drawing;
using TS = Tekla.Structures;
using TSM = Tekla.Structures.Model;
using TSMU = Tekla.Structures.Model.UI;
using TSG = Tekla.Structures.Geometry3d;
using TSD = Tekla.Structures.Drawing;
namespace CNC_UniTecknik
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
Tekla.Structures.Model.Model TSM = new Tekla.Structures.Model.Model();
Tekla.Structures.Model.ModelObjectEnumerator baseEnum = new Tekla.Structures.Model.UI.ModelObjectSelector().GetSelectedObjects();
while (baseEnum.MoveNext())
{
int ID = baseEnum.Current.Identifier.ID;
Tekla.Structures.Identifier TeklaID = new Tekla.Structures.Identifier(ID);
Tekla.Structures.Model.ModelObject mo = TSM.SelectModelObject(TeklaID);
Tekla.Structures.Model.Assembly Ass = new TSM.Assembly();
string order_n = "";
string beam_name = "";
mo.GetUserProperty("SM_Order_01", ref order_n);
mo.GetReportProperty("CAST_UNIT_POS", ref beam_name);
string[] order_name = beam_name.Split('-');
double panel_num = 0;
Double.TryParse(order_name[1], out panel_num);
beam_name = order_name[0] + "-" + panel_num.ToString("00");
}
}
}
}
example
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Tekla.Structures;
using Tekla.Structures.Model;
using Tekla.Structures.Drawing;
using TS = Tekla.Structures;
using TSM = Tekla.Structures.Model;
using TSMU = Tekla.Structures.Model.UI;
using TSG = Tekla.Structures.Geometry3d;
using TSD = Tekla.Structures.Drawing;
namespace CNC_UniTecknik
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
Tekla.Structures.Model.Model TSM = new Tekla.Structures.Model.Model();
Tekla.Structures.Model.ModelObjectEnumerator baseEnum = new Tekla.Structures.Model.UI.ModelObjectSelector().GetSelectedObjects();
while (baseEnum.MoveNext())
{
int ID = baseEnum.Current.Identifier.ID;
Tekla.Structures.Identifier TeklaID = new Tekla.Structures.Identifier(ID);
Tekla.Structures.Model.ModelObject mo = TSM.SelectModelObject(TeklaID);
Tekla.Structures.Model.Assembly Ass = new TSM.Assembly();
string order_n = "";
string beam_name = "";
mo.GetUserProperty("SM_Order_01", ref order_n);
mo.GetReportProperty("CAST_UNIT_POS", ref beam_name);
string[] order_name = beam_name.Split('-');
double panel_num = 0;
Double.TryParse(order_name[1], out panel_num);
beam_name = order_name[0] + "-" + panel_num.ToString("00");
}
}
}
}
example
Comentários
Enviar um comentário