Layer State
A layer state stores the display state of existing layers and all the items on the hidden item layer of the top-level assembly. You can create and save one or more layer states and switch between them to change the display of the assembly.
Methods Introduced:
Use the method
wfcLayerState::ActivateLayerState to activate the specified layer state. The model of the layer state must be the top model in the active window.
The method
wfcLayerState::AddLayer adds a new layer to an existing layer state. Specify the new layer and its display state as input arguments to this method.
Use the method
wfcLayerState::DeleteLayerState to delete a specified layer state.
Use the methods
wfcLayerState::GetDefaultLayer and
wfcLayerState::SetDefaultLayer to set up a default layer with a specified name and type respectively. The method
wfcLayerState::SetDefaultLayer requires the default layer type, which is defined in the enumerated type
wfcDefLayerType.
The method
wfcLayerState::GetLayerData retrieves the reference data for a specified layer state.
The method
wfcLayerState::GetLayerStateName retrieves the name of a specified layer state.
Use the method
wfcLayerState::HideLayerItem to hide a specific item on the specified layer state.
Use the method
wfcLayerState::UnhideLayerItem to remove a specific item from the list of hidden items on a layer state.
Use the method
wfcLayerState::IsLayerItemHidden to check if an item is hidden on a layer state.
The method
wfcLayerState::RemoveLayer removes a specific layer from a specified layer state.
Use the method
wfcLayerStateData::Create to create a new instance of the
wfcLayerStateData object. This object contains information about layer state data.
The methods
wfcLayerStateData::GetDisplayStatuses and
wfcLayerStateData::SetDisplayStatusesget and set, respectively, the display statuses for the layers in the layer state. The number of display statuses is equal to the number of layers present in the layer state.
The method
wfcWModel::SaveLayerDisplayStatus saves the changes to the display status of the layers in the specified model and its sub models. For drawings, the display status is saved in the views contained in the drawing.
The methods
wfcLayerStateData::GetLayerItems and
wfcLayerStateData::SetLayerItems get and set the value of the specified layer item.
The methods
wfcLayerStateData::GetLayerStateName and
wfcLayerStateData::SetLayerStateName get and set the name of the new layer state. The name must only consist of alphanumeric, underscore, and hypen characters.
The methods
wfcLayerStateData::GetLayers and
wfcLayerStateData::SetLayers get and set the layer state for an array of layers.
The method
wfcWModel::ListLayers returns an array containing the layers in the model.
The method
wfcWSolid::ListLayerStates returns an array of layer states in the specified model.
The method
wfcWSolid::CreateLayerState creates a new layer state.
The method
wfcWSolid::GetActiveLayerState retrieves the active layer state in a specified solid model.
Use the method
wfcWModel::GetLayerItem to initialize a layer item structure. The valid layer item types are defined by the enumerated type
wfcLayerType. Do not use this function if the layer item owner is a drawing.
The method
wfcWSolid::UpdateActiveLayerState 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.