Layer State
A layer state stores the display state of existing layers and all the hidden layers of the top-level assembly. You can create and save one or more layer states and switch between them to change the assembly display.
The object ProLayerstate represents the layer state. It has the same declaration as the ProModelitem object, only with the type set to PRO_LAYER_STATE. The declaration is as follows:
typedef struct pro_model_item
{
ProType type;
int id;
ProMdl owner;
}ProLayerstate;
Functions Introduced:
The function
ProLayerstatesGet() returns an array of layer states for a specified solid.
The function
ProLayerstateActiveGet() retrieves the active layer state in a specified solid model.
The function
ProLayerstateNameGet() retrieves the name of a specified layer state.
Use the function
ProLayerstateActivate() to activate a specified layer state.
The function
ProLayerstateCreate() creates a new layer state based on specified references. The input arguments of this function are as follows:
• p_solid—Specify the solid model in which you want to create a new layer state.
• state_name—Specify the name of the new layer state. The name can only consist of alphanumeric, underscore, and hypen characters.
• layers—Specify an array of reference layers.
• disp_arr—Specify an array of display statuses. The number of display statues is equal to the number of reference layers.
• hidden_items—Specify an array of hidden items.
|
Note:
|
ProLayerItem of type PRO_LAYER_LAYER is not supported in the function ProLayerstateCreate(), when you create a new layer state.
|
The function
ProLayerstateLayersGet() retrieves the reference data for a specified layer state.
The function
ProLayerstateLayerAdd() adds a new layer to an existing layer state. Specify the new layer, its display state, and the name of the existing layer state as input arguments to this function.
The function
ProLayerstateLayerRemove() removes a specific layer from a specified layer state.
The function
ProLayerstateActivestateUpdate() updates the layer state, which is active in the specified model. If the display statues of layers have changed, then calling this function ensures that the active layer state in the model is updated with the new display statuses of the layers.
Use the function
ProLayerstateModelitemHide() to hide the display of a specific item on the specified layer state.
Use the function
ProLayerstateModelitemUnhide() to remove a specific item from the list of hidden items on a layer state.
Use the function
ProLayerstateModelitemIsHidden() to identify if an item is hidden on a layer state.
Use the function
ProLayerstateDelete() to delete a specified layer state.
Use the function
ProLayerstateDefaultPropagateSet() to control whether layer statuses propagate from the top model to sub-models by default. The input arguments are:
• p_state—Specifies the layer state using the ProLayerstate object.
• set—Sets the value of the layer status propagation as PRO_B_TRUE or PRO_B_FALSE.
|
Note:
|
Statuses are only propagated from top model layers to sub models layers having the same name.
|
Parent topic