iCAx开思工具箱
标题:
如何用CAA查询Catia中已经打开的document?
[打印本页]
作者:
Rebeccazhao
时间:
2005-10-26 11:31
标题:
如何用CAA查询Catia中已经打开的document?
只找到get_ActiveDocument.
以前用automation 可以获得,代码如下,但是不知道用c++ API如何获得?
INFITF:
ocuments* m_oDocuments = NULL;
HR_CHECK( m_oApplication->get_Documents( &m_oDocuments ));
HR_CHECK( m_oDocuments->get_Count( &nCount ));
作者:
acoka
时间:
2005-10-26 11:38
CATFrmEditor* pEditor = GetEditor();
...
CATILinkableObject_var spILinkableOnActive = pEditor ;
...
CATDocument* pDocument = spILinkableOnActive ->GetDocument();
作者:
Rebeccazhao
时间:
2005-10-26 12:18
谢谢acoka
可是这样得到的是不是当前的document?
如果要得到所有打开的document,也就是在catia-〉windows中可以看到的所有打开的document,该如何获得?
作者:
hick
时间:
2005-10-26 14:43
试试这个,应该得到是当前编辑的document
CATFrmEditor * pEditor =CATFrmEditor::GetCurrentEditor();
CATPathElement spPath = pEditor->GetUIActiveObject( );
CATBaseUnknown* pcurrbase = spPath.CurrentElement( );
CATILinkableObject *piLinkableObject = NULL;
HRESULT rc = pcurrbase->QueryInterface( IID_CATILinkableObject,
(void**)& piLinkableObject );
if ( SUCCEEDED(rc) )
{
CATDocument * pDocument = NULL ;
pDocument = piLinkableObject->GetDocument();
}
欢迎光临 iCAx开思工具箱 (https://t.icax.org/)
Powered by Discuz! X3.3