Yea, there is something that was added for Dynamic Components:
// A Dynamic component can set a _hideinbrowser attribute == true
// to keep a definition fron showing in the Component Browser.
definition.set_attribute('dynamic_attributes', '_hideinbrowser', true)
(Note that this is something of an internal implementation detail. But it sounds reasonable to me if the API had an official method to do this.)
On that topic I just realized we have
hidden? for definitions. And it wasn’t clear to me what they meant.
The hidden method is used to determine if this component definition should be hidden on the component browser.
The source code comment says:
// A component is "hidden" if all of its instances are within
// other external component definitions. Conversely a component
// is "visible" if it has no instances, or has any instances
// within the model or within any internal component definitions.
// Note that we use "GetHidden" to differentiate this from the
// method on CDrawingElement.
This method checks if the definition has zero instances and that all its instances are within another definition. It also checks if the definition is “internal”.
The internal? method is used to determine if the component definition is internal to the Component Browser
The source code returns true if the “loaded from path” is empty.