Gets the minimum radius of curvature for the selected surface.
in-process, unmanaged C++ COM:
/////////////////////////////////////////////////////////////////////////////
// IMinRadius implementation
STDMETHODIMP CMinRadius::StartNotepad()
{
// TODO: Add your implementation code here
CComPtr<IModelDoc> iModelDoc2;
m_iSldWorks->get_IActiveDoc(&iModelDoc2);
CComPtr<ISelectionMgr> swSelMgr;
iModelDoc2->get_ISelectionManager(&swSelMgr);
struct IDispatch* pDispSelection;
CComPtr<IFace2> swFace;
swSelMgr->GetSelectedObject6(1,-1,&pDispSelection);
pDispSelection->QueryInterface(
__uuidof(IFace2),reinterpret_cast<void**>(&swFace));
pDispSelection->Release();
double boundArr[4];
swFace->IGetUVBounds ( boundArr );
double UBound[2] = {boundArr[0],boundArr[1]};
double VBound[2] = {boundArr[2],boundArr[3]};
CComPtr<ISurface> swSurface;
swFace->IGetSurface(&swSurface);
long numOfRadius(0);
VARIANT radius,Location,UVParameter;
VARIANT_BOOL status(FALSE);
swSurface->IFindMinimumRadius(UBound,VBound,&numOfRadius,&radius,&Location,&UVParameter,&status);
SafeDoubleArray radiusSA(radius);
double test1 = radiusSA[0];
double test2 = radiusSA[1];
SafeDISPATCHArray locationSA(Location);
CComPtr<IMathPoint> swMathPoint1;
CComPtr<IMathPoint> swMathPoint2;
locationSA[0]->QueryInterface(__uuidof(IMathPoint),reinterpret_cast<void**>(&swMathPoint1));
locationSA[1]->QueryInterface(__uuidof(IMathPoint),reinterpret_cast<void**>(&swMathPoint2));
double locationArra1[3];
double locationArra2[3];
swMathPoint1->get_IArrayData(locationArra1);
swMathPoint2->get_IArrayData(locationArra2);
SafeDISPATCHArray UVParameterSA(UVParameter);
return S_OK;
}