catia入门学习报告收获和心得(CATIA二次开发CAA)

二次开发第一要义:查帮助

CAA打开文档函数的帮助如下:

OpenDocument

public static HRESULT OpenDocument( const CATUnicodeString& iStorageName,

CATDocument*& oOpenedDoc,CATBoolean iReadOnly =FALSE)

功能:打开一个给定的文档。

Role: If the file already exists in the session, it will not be re-loaded.

The document must be removed from the session before exiting or when it is no longer needed. See explanations at the top of this page about the life cycle of the document.

Note: This method does not allow opening .feat or .CATfct catalogs. It is not possible to access .feat catalogs because they contain Dassault Systemes private data. To open a .CATfct catalog, see CATCatalogFactoryServices (ObjectSpecsModeler framework).

Parameters:

iStorageName

The complete access name of the file to open ( path name of the file ).

See CATDocument.StorageName for more information about the storage name.

oOpenedDoc

The opened document.

If the "open" is a "re-open", the pointer is not a new pointer. Do not remove the pointer twice.

iReadOnly

FALSE: Default value, the document will be in read/write mode.

TRUE: The document is in read only mode.

In case of a re-opening, the mode of the document is defined by the first open.

Returns:

S_OK : The document was opened sucessfully.

S_FALSE : The document has already been loaded. The returned oOpenedDoc pointer points to this document.

E_FAIL : The open operation failed.

怎么用呢,上代码:

CATSession *pSession = NULL;

HRESULT rc=NULL;

rc = ::Create_Session("CAA_PrdProp_Session", pSession);

// Opening an existing document with full path specified

CATDocument *pDoc =NULL;

CATUnicodeString strPath="C:\\Users\\weiwu-chen\\Desktop\\卷线器改\\juanxianqi.CATProduct";//juanxianqi.CATProduct";

rc = CATDocumentServices::OpenDocument(strPath, pDoc);

if (FAILED(rc)|| NULL==pDoc)

{

return;

}

catia入门学习报告收获和心得(CATIA二次开发CAA)(1)

,

免责声明:本文仅代表文章作者的个人观点,与本站无关。其原创性、真实性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容文字的真实性、完整性和原创性本站不作任何保证或承诺,请读者仅作参考,并自行核实相关内容。文章投诉邮箱:anhduc.ph@yahoo.com

    分享
    投诉
    首页