狮猿社CATIA

CATIA caa高亮特征

2020-01-19  本文已影响0人  锦囊喵

原文链接

/**
* 高亮特征
* @param spSpec
*   高亮特征
*/

HRESULT HighLightSpecObject (CATISpecObject_var spSpec, CATBoolean boolClearHistory)
{
    HRESULT rc = E_FAIL;
    CATFrmEditor * pEditor = CATFrmEditor::GetCurrentEditor();
    if(NULL == pEditor )
        return rc;
    CATHSO * pHSO = pEditor->GetHSO();
    if(NULL == pHSO )
        return rc;  
    if(boolClearHistory)//为1时,清楚所有已有的高亮
        pHSO->Empty();
    CATPathElement pContext = pEditor->GetUIActiveObject();
    CATIBuildPath * piBuildPath = NULL;
    rc =spSpec->QueryInterface(IID_CATIBuildPath, (void **)&piBuildPath);
    if(SUCCEEDED(rc) && piBuildPath != NULL)
    {
        CATPathElement * pPathElement = NULL;
        rc = piBuildPath->ExtractPathElement(&pContext, &pPathElement);
        if (pPathElement != NULL)
        {
            pHSO->AddElement(pPathElement);
            pPathElement->Release();
            pPathElement = NULL;
        }
        piBuildPath->Release();
        piBuildPath = NULL;
    }
    return S_OK;
}
上一篇下一篇

猜你喜欢

热点阅读