// ------------------------------------------------
/**
* @brief 新建标注集
* @param[in] ipiProduct 装配节点
* @param[out] opiTPSSet 标注集
* @retval TRUE:成功;FALSE:失败
* @note [详细说明]
* @attention [注意事项说明]
*/
// ------------------------------------------------
HRESULT SJDAlwaysCreateGDTCmd::GetAnnotationTool(
CATIProduct*& ipiProduct, // 装配节点
CATITPSSet*& opiTPSSet // 标注集
)
{
HRESULT rc = S_OK;
CATITPSServicesContainers *piTPSServ = NULL;
::CATTPSInstantiateComponent(DfTPS_ItfTPSServicesContainer,(void**)&piTPSServ);
if (piTPSServ == NULL)
{
return E_FAIL;
}
piTPSServ->RetrieveOrCreateCurrentTPSSet(ipiProduct,CreateIfMissing,&opiTPSSet);
if (opiTPSSet == NULL)
{
piTPSServ->Release();
return E_FAIL;
}
piTPSServ->Release();
return S_OK;
}
注:在上述函数中主要使用了CATTPSInterfaces Global Function CATTPSInstantiateComponent
Creates a TPS component from its identificator defined as a value of enum CATTPSComponent.
网友评论