This is a console application.
You will need to install the approriate dlls from Tekla. This can now be down via a Nuget package:
We want to select a single object in the model using a picker. Here is some sample code. You can of course, configure this to select model objects if you wish.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tekla.Structures.Model;
using Tekla.Structures.Model.UI;
namespace TestSelectObject
{
internal class Program
{
static void Main(string[] args)
{
Picker picker = new Picker();
ModelObject modelObject = picker.PickObject(Picker.PickObjectEnum.PICK_ONE_OBJECT);
// we can do whatever we want once we have the model object:
Console.WriteLine($"GUID is: {modelObject.Identifier.GUID}, and then ID is: {modelObject.Identifier.ID}");
// from the object itself:
// GUID is: 9651ed88 - 13e5 - 486f - 9541 - c878110c456e, and then ID is: 4144162
Console.ReadLine();
}
}
}