KEEP IN MIND THAT YOU CANNOT USE A REF PLANE THAT IS RETRIEVED FROM A MODEL, YOU NEED TO USE THE ONE THAT IS RETRIEVED IN THE ASSEMBLY BECAUSE THAT PLANE ENTITY HAS A COMPONENT. otherwise it is the source plane, not an instance of the plane in the assembly. the source plane has no relevance in the assembly.
if the plane is retrieved from the ASSEMBLY COMPONENT INSTANCE then proceed with the following
without going too deep
you can use ISelectionManager::SuspendSelectionList then
you could use IEntity.Select4
then use selectionmgr.getselectedobjectscomponent
if that doesnt work then resort to selection based.
Function GetComponent(byval SwModel as modeldoc2, byval SwPlane as refplane) as component2
Dim RefEnt as entity
Set RefEnt = swplane
if refent.GetComponent is nothing then
Dim Selmgr as selectionmgr
set Selmgr = swmodel.selectionmanager
Dim SelData as selectdata
set seldata = selmgr.createselectdata
Getcomponent = selmgr.getselectedobjectsComponent4(1,-1)
GetComponent = RefEnt.GetComponent
Thank you for your beautiful sample code,
although I may not understand enough about explanation you highlighted first, retrieved-from-model/assy story,
I finally could get Component2 from a Refplane object using the idea of your sample function GetComponent!