Getting the workplanes of a part occurrence in an assembly

Top  Previous  Next

What you need to do here is get the occurrence and then get the part component definition of it. This requires a cast...


CComQIPtr<PartComponentDefinition> pPartCompDef = CComQIPtr<PartComponentDefinition>(pOcc->Definition);



You need to be sure that the occurrence point to a part, get its Definition, then cast it from ComponentDefinition to PartComponentDefinition, as shown above. Now you can get the workplanes from the pPartCompDef, for example:


  CComPtr<WorkPlanes> pWorkPlaneList ;

  HRESULT hRes = pPartCompDef->get_WorkPlanes(&pWorkPlaneList);








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