C# LeituraPecas
public void LeituraPecas()
{
Model Model = new Model();
Tekla.Structures.Model.ModelObjectEnumerator SelectEnum = new Tekla.Structures.Model.UI.ModelObjectSelector().GetSelectedObjects();
SelectEnum.SelectInstances = false; // Set the "SelectInstances" to false to speed up the enquiry; possible because only report properties are asked.
var ObjectAltura = "";
var ObjectComprimento = "";
while (SelectEnum.MoveNext())
{
if (SelectEnum.Current != null)
{
Beam BeamObject = SelectEnum.Current as Beam;
if (BeamObject != null)
{
string V01 = BeamObject.Type.ToString();
string V02 = BeamObject.Profile.ToString();
//string V03 = BeamObject.GetReportProperty("NAME", ref ObjectName);
//string V04 = BeamObject.GetReportProperty("NAME");
var Alt = BeamObject.GetReportProperty("HEIGTH" , ref ObjectAltura);
var Comp = BeamObject.GetReportProperty("LENGTH", ref ObjectComprimento);
MessageBox.Show("Objecto tipo Viga + " + V02);
}
else {/*MessageBox.Show("Objecto diferente de Viga");*/}
}
else
{
}
//MessageBox.Show("segunda opção");
}
}
Comentários
Enviar um comentário