Skip to content

Instantly share code, notes, and snippets.

@benkoshy
Last active August 1, 2024 01:52
Show Gist options
  • Save benkoshy/8d7dc8c044b4483c7d0634df6888d303 to your computer and use it in GitHub Desktop.
Save benkoshy/8d7dc8c044b4483c7d0634df6888d303 to your computer and use it in GitHub Desktop.
Tekla API: How to get objects that are currently selected.




In previous posts I have told you how to:

  • programatically select objects in Tekla. i.e. you have a set of parts in memory, and you want them selected.

In this post, we want to do the reverse:

  • The user has already selected something, and we want to capture it.
ModelObjectSelector selector = new ModelObjectSelector();
ModelObjectEnumerator enumerator =  selector.GetSelectedObjects();

foreach (ModelObject model in enumerator)
{
    Console.WriteLine("iterate through what has been selected");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment