2014-07-01 18:41:19|?次阅读|上传:wustguangh【已有?条评论】发表评论
关键词:CAA, CATIA|来源:唯设编程网
使用CAA隐藏CATIA中的元素,首先需要通过QueryInterface函数得到对应元素的CATIVisProperties接口,然后调用CATIVisProperties接口的SetPropertiesAttr函数设置元素的显示属性,具体代码如下:
/** * 隐藏元素 * @param ipListElemObj * 元素列表 */ void BasicGlobalFunc::HideElements(CATLISTV(CATISpecObject_var) ipListElemObj) { for(int i=1;i<=ipListElemObj.Size();i++){ CATIVisProperties* pPropOnElem = NULL; HRESULT rc = ipListElemObj[i]->QueryInterface(IID_CATIVisProperties, (void**)&pPropOnElem); if(NULL != pPropOnElem){ CATVisPropertiesValues PropValue; CATVisPropertyType PropTypeOnPtObj = CATVPShow; CATVisGeomType GeomTypeOnPtObj = CATVPGlobalType; PropValue.SetShowAttr(CATNoShowAttr); rc = pPropOnElem->SetPropertiesAtt(PropValue, PropTypeOnPtObj, GeomTypeOnPtObj); pPropOnElem->Release(); pPropOnElem = NULL; } } }