RTM: Respository.GetTreeSelectedObject
You can use
Repository.GetContextObject()
to get the currently selected Object.
To get the type of the object, use Repository.GetContextItemType()
you can then assign an EA.Element
type to the object returned by Repository.GetContextObject()
private void getSelectedElement(EA.Repository Rep)
{
EA.Element ele;
switch(Rep.GetContextItemType())
{
case EA.ObjectType.otElement:
{
ele = Rep.GetContextObject();
//Operations on the selected element
break;
}
}
}
If you want to know all the possible types, see the documentation (This is for EA 13)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.