SubOccurrences

Top  Previous  Next

SubOccurrences of an assembly can be parts or assemblies. Given an assembly this code fragment lists their names:

 

   CComPtr<ComponentOccurrencesEnumerator> pCompOccsEnum = nullptr ;

   pAttOcc->get_SubOccurrences (&pCompOccsEnum) ;

   UINT iNumSubOccurrences = pCompOccsEnum->Count ;

   for (UINT i = 1 ; i <= iNumSubOccurrences ; i++) {

       TRACE (L"Occ%d = %s\n",pCompOccsEnum->Item [1]->Name ) ;

   }

 

 

Text, images and diagrams © 2021 Owen F. Ransen. All rights reserved. (But copy the source code as much as you want!)