Finds the minimum radius of curvature of the selected curve and its position and u-v parameters.
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<IEdge> swEdge;
swSelMgr->GetSelectedObject6(1,-1,&pDispSelection);
pDispSelection->QueryInterface(
__uuidof(IEdge),reinterpret_cast<void**>(&swEdge));
pDispSelection->Release();
double boundArr[2];
CComPtr<ICurve> swCurve;
swEdge->IGetCurve(&swCurve);
VARIANT_BOOL isClose,isPeriodic,testRetVal;
swCurve->GetEndParams(&boundArr[0],&boundArr[1],&isClose,&isPeriodic,&testRetVal);
long numOfRadius(0);
VARIANT radius,Location,UVParameter;
VARIANT_BOOL status(FALSE);
swCurve->IFindMinimumRadius(boundArr,&numOfRadius,&radius,&Location,&UVParameter,&status);
SafeDoubleArray radiusSA(radius);
double test1 = radiusSA[0];
SafeDISPATCHArray locationSA(Location);
CComPtr<IMathPoint> swMathPoint1;
locationSA[0]->QueryInterface(
__uuidof(IMathPoint),reinterpret_cast<void**>(&swMathPoint1));
double locationArra1[3];
swMathPoint1->get_IArrayData(locationArra1);
SafeDoubleArray UVParameterSA(UVParameter);
double uvpara1 = UVParameterSA[0];
return S_OK;
}