Message 1 of 4
Inventor API - Problem adding Silhouette Curve

Not applicable
03-13-2017
07:24 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am looking for some help. I am trying the use the Sketch3D objects SilhouetteCurves object collection in order to get a part's extents and it seems to be failing every time.
Here is some example code.
// Inventor API client - this is created successfully
CComPtr<Application>
pInvApp;
// Get active document
PartDocumentPtr
partDoc = pInvApp->GetActiveDocument();
// Get first surface body item
SurfaceBodyPtr
surfaceBody = partDoc->ComponentDefinition->GetSurfaceBodies()->GetItem(1);
// get first face of the surface body
FacePtr
firstFaceOfSurfaceBody = surfaceBody->GetFaces()->GetItem(1);
// Calculate extents of part
HRESULT
result = sketch3d->SilhouetteCurves->Add(surfaceBody, firstFaceOfSurfaceBody, TRUE); //<---- This always returns E_FAIL