HM_ExtAPI::CADDocumentGetComponentsCount()

Returns the number of components created for the model assembly hierarchy document.

Syntax

bool CADDocumentGetComponentsCount(
const HM_CAD_Document & doc,
int & comps_count
);

Type

HyperMesh Ext API

Description

The function CADDocumentGetComponentsCount is used together with the function HM_ExtAPI::CADDocumentGetComponent() to access geometry imported from the CAD model file.

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().

The documents of the type HM_ExtAPI::DOC_ASSEMBLY() may not have associated components in HyperMesh database.

More than one component may be created in HyperMesh database for single document. This mainly is defined by import translator options set by the user in translator initialization file (for example “catia.ini”) used by specific HyperMesh installation. See HyperMesh documentation for more details.

Components in theHyperMesh database may not have model assembly documents associated with them. This normally happens in case if the model was not imported from the CAD model file but created internally byHyperMesh commands. For the full access to the components in the database use API functions HM_ExtAPI::GetFirstComponent() and HM_ExtAPI::GetNextComponent().

Requires including hm_extapi.h.

Inputs

doc
[in] - Handle to document object that was returned by previous calls to API functions.
comps_count
[out] - Number of HyperMesh components created for the document doc.

Errors

None.