HM_ExtAPI::GetRootCADDocument()

Returns the root document in the model assembly hierarchy of the CAD model loaded into HyperMesh database.

Syntax

bool GetRootCADDocument(
HM_CAD_Document & doc,
Int&  doc_index
);

Type

HyperMesh Ext API Function

Description

The function GetRootCADDocument is used together with the functions HM_ExtAPI::CADDocumentGetFirstChild() and HM_ExtAPI::CADDocumentGetNext() to browse each of independent model assembly hierarchy trees.

The function GetRootCADDocument is used together with the function HM_ExtAPI::GetRootCADDocumentsCount(). The function HM_ExtAPI::GetRootCADDocumentsCount() is used to get the total number of independent assembly hierarchy trees.

If the function succeeds, the return value is true. If the function fails, the return value is false. To get extended value information, call HM_ExtAPI::GetLastErrorCode().

Requires including hm_extapi.h.

Inputs

doc
[out] - Handle to the root document. The value of the handle is zero in case if no model is loaded or there is no hierarchy associated with currently loaded model.
doc_index
[in] - Root document zero-based index. The value must be in the range from 0 to docs_count where docs_count is the number of root documents as returned by the function HM_ExtAPI::GetRootCADDocumentsCount().

Errors

None.