PartComponentDefinition from an occurrence

Top  Previous  Next

If you have an occurrence of a part, you can get the PartComponentDefinition of that part by using the Definition member and a cast as shown below:


CComQIPtr<PartComponentDefinition> pCompDef = CComQIPtr<PartComponentDefinition>(pTuboOcc->Definition);


You are casting from a ComponentDefinition to a PartComponentDefinition, note the use of CComQIPtr.


CComQIPtr<PartComponentDefinition> pCompDef = pTuboOcc->Definition;


It may be that you do not need the cast. Check the result though

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