Listing RevolveFeatures of a part programatically |
Top Previous Next |
Here's a code fragment to do that:
{ gLogger.Printf (ekLogMsg,L"Object has %d features",pTroncCompDef->Features->Count) ; CComPtr<RevolveFeatures> pRevFeats = pTroncCompDef->Features->RevolveFeatures ; gLogger.Printf (ekLogMsg,L"Tronchetto has %d revolved features",pRevFeats->Count) ; for (long f = 1; f <= pRevFeats->Count; f++) { CComPtr<RevolveFeature> pFeat ; pRevFeats->get_Item (CComVariant(f),&pFeat) ; CComQIPtr<WorkAxis> pAxis = pFeat->GetAxisEntity() ; LinePtr pLine = pAxis->GetLine() ; gLogger.Printf (ekLogMsg," Origin = %.2f %.2f %.2f ",pLine->RootPoint->X,pLine->RootPoint->Y,pLine->RootPoint->Z) ; } }
Enter topic text here. |
Text, images and diagrams © 2021 Owen F. Ransen. All rights reserved. (But copy the source code as much as you want!)