/************************************************************************/
/* 草圖輸入模式? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? */
/* 將草圖拆分為單獨(dú)線? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? */
/************************************************************************/
CATLISTV (CATI2DWFGeometry_var ) GeomList;
CATLISTV(CATI2DCurve_var) CrvList;
CATI2DCurve_var spCurve = NULL_var;
// 檢索草圖中的線
hr = _spSketch->GetComponents(CATI2DWFGeometry::ClassName(),GeomList);
if (SUCCEEDED(hr))
{
????????if (GeomList.Size() > 1)
????????{
????????????int indice=1;
????????????while (indice <= GeomList.Size())
????????????{
????????????????????spCurve = GeomList[indice];
????????????????????if (NULL_var != spCurve)
????????????????????{
????????????????????????CrvList.Append(spCurve);
????????????????????}
????????????????????indice++;
????????????????}
????????????}
?????? }
CATISpecObject_var spSpecOnCurve = NULL_var;
CATIMmDecodeSubElem* pSubElem = NULL;
CATIBRepAccess_var spBRep = NULL_var;
CATIFeaturize_var spFeaturize = NULL_var;
CATISpecObject_var spSpecObjectOnSketchCurve = NULL_var;
CATListValCATBaseUnknown_var brepList;
// 將其中各個線要素特征化
for (int iLoop = 1;iLoop<= CrvList.Size();iLoop++)
{
????????spSpecOnCurve = CrvList[iLoop];
????????if (NULL_var == spSpecOnCurve)
????????{
????????????continue;
????????}
????????_spSketch->QueryInterface(IID_CATIMmDecodeSubElem, (void**)&pSubElem);
????????if (NULL == pSubElem)
????????{
????????????????continue;
????????}
????????brepList.RemoveAll();
????????hr = pSubElem->GetSpecificBRepAccess(spSpecOnCurve, &brepList);
????????if (FAILED(hr) || brepList.Size() < 1)
????????{
????????????continue;
????????}
????????spBRep = brepList[1];
????????if (NULL_var == spBRep)
????????{
????????????????continue;
????????}
????????spFeaturize = spBRep;
????????if (NULL_var == spFeaturize)
????????{
????????????continue;
????????}
????????spSpecObjectOnSketchCurve = spFeaturize->FeaturizeR(MfPermanentBody|MfLastFeatureSupport|MfNoDuplicateFeature);
????????if (NULL_var == spSpecObjectOnSketchCurve)
????????{
????????????continue;
????????}
????????spInputSketchCurve.Append(spSpecObjectOnSketchCurve);
}