回答(1)
huigezrx 19级 2014-09-24 23:05:53
//得到当前视图对应的Part特征 HRESULT CAAVisDlgCmd::RetrieveCurrentPart(CATISpecObject_var& spCurPart){ CATFrmEditor* piEditor = CATFrmEditor::GetCurrentEditor(); CATDocument* piDocument = piEditor->GetDocument(); CATInit_var spInit = piDocument; if(spInit == NULL_var) return E_FAIL; CATIPrtContainer_var spRootContainer = spInit->GetRootContainer("CATIPrtContainer"); if(NULL_var == spRootContainer) return E_FAIL; spCurPart = spRootContainer->GetPart(); if(NULL_var == spCurPart) return E_FAIL; return S_OK; }