HM_ExtAPI::CreateComponent()

Creates new component in HyperMeshdatabase.

Syntax

bool CreateComponent(
HM_EntityComponent& new_comp,
const char* name,
HM_Color color
const HM_RGBColorStruct* rgb,
bool make_current
)

Type

HyperMesh Ext API Function

Description

The parameter rgb is ignored if the value of the parameter color is notHM_COLOR_USE_RGB.

If the value of the parameter color if HM_COLOR_USE_RGB and the value of the parameter rgb is NULL the the value of HM_COLOR_DEFAULT is used instead.

All new geometry in HyperMesh is created in current component unless otherwise specified by the parameter in geometry creation functions.

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

new_comp
[out] - Handle to new component object.
name
[in] - Pointer to the string that contains the name for the new component. If the pointer is NULL then new the name is created automatically.
color
[in] - Numerical constant that specifies the color of the new component. The parameter can have one of following values.
HM_COLOR_DEFAULT - The component is created with default color.
HM_COLOR_GREY - The component has grey color.
HM_COLOR_BROWN - The component has brown color.
HM_COLOR_PURPLE - The component has purple color.
HM_COLOR_PINK - The component has pink color.
HM_COLOR_LTMAGENTA - The component has light magenta color.
HM_COLOR_MAGENTA - The component has magenta color.
HM_COLOR_BLUE - The component has blue color.
HM_COLOR_LTBLUE - The component has light blue color.
HM_COLOR_CYAN - The component has cyan color.
HM_COLOR_GREEN - The component has green color.
HM_COLOR_LTGREEN - The component has light green color.
HM_COLOR_YELLOW - The component has yellow color.
HM_COLOR_LTBROWN - The component has light brown color.
HM_COLOR_ORANGE - The component has orange color.
HM_COLOR_RED - The component has red color.
HM_COLOR_WHITE - The component has white color.
HM_COLOR_USE_RGB - The color of the component does not match standard colors from HyperMesh palette. The red, green and blue values specifying the color are returned in the structure HM_RGBColorStruct, pointer to which is provided by the parameter rgb.
rgb
[in] - Pointer to HM_RGBColorStruct structure that contains values for red, green and blue components in the color of new component. The parameter is ignored if the value of the color parameter is not equal to HM_COLOR_USE_RGB.
make_current
[in] - Pointer to HM_RGBColorStruct structure that contains values for red, green and blue components in the color of new component. The parameter is ignored if the value of the color parameter is not equal toHM_COLOR_USE_RGB.
true - New component becomes current component in HyperMesh.
false - Current component in HyperMesh does not change.

Errors

None.