Cancel
Showing results for 
Search instead for 
Did you mean: 

Select Component Programatically In Tree?

Valued Contributor
Valued Contributor

Is there a was to programmatically select a component from the object tree (ver 13.1)?   In other words, simulate picking it with the mouse so that it is highlighted and active selection?

 

Something like SelectNodeByInternalId(string InternalId)

2 REPLIES 2

Re: Select Component Programatically In Tree?

Genius
Genius

Have you tried to add the object of interest to TxApplication.ActiveSelection?

Re: Select Component Programatically In Tree?

Valued Contributor
Valued Contributor

Ugh .. so simple!  Smiley Happy  I did not even realize that was an option, the only thing I ever use that for is to get user selection.  Thanks!

 

//ITxObject obj definded previously
...
TxObjectList list = new TxObjectList(); list.Add(obj);

TxApplication.ActiveSelection.Clear(); // Optional - depending on what you want to do TxApplication.ActiveSelection.SetItems(list);