The contextual tab will be displayed with the selection. For example, [Modify| Walls] tab is displayed when a wall is selected with a cursor. However, you might not want this happen in some cases. For instance, you want to keep your plug-in’s ribbon tab displayed when an element is selected.
Unfortunately, you can not achieve this using API. But you can go to R>Options dialog>”User Interface” tab and unclick the “Display the contextual tab on selection”. Then, The tab stays with the selection.