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.
Methods Introduced:
Use the method
wfcLayerState.LayerState.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.LayerState.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.LayerState.DeleteLayerState to delete a specified layer state.
Use the methods
wfcLayerState.LayerState.GetDefaultLayer and
wfcLayerState.LayerState.SetDefaultLayer to set up a default layer with a specified name and type respectively. The method
wfcLayerState.LayerState.SetDefaultLayer requires the default layer type, which is defined in the enumerated type
wfcLayerState.DefLayerType.
The method
wfcLayerState.LayerState.GetLayerData retrieves the reference data for a specified layer state.
The method
wfcLayerState.LayerState.GetLayerStateName retrieves the name of a specified layer state.
Use the method
wfcLayerState.LayerState.HideLayerItem to hide a specific item on the specified layer state.
Use the method
wfcLayerState.LayerState.UnhideLayerItem to remove a specific item from the list of hidden items on a layer state.
Use the method
wfcLayerState.LayerState.IsLayerItemHidden to check if an item is hidden on a layer state.
The method
wfcLayerState.wfcLayerState.LayerStateData_Create removes a specific layer from a specified layer state.
Use the method
wfcLayerState.wfcLayerState.LayerStateData_Create to create a new instance of the
wfcLayerState object. This object contains information about layer state data.
The methods
wfcLayerState.LayerStateData.GetDisplayStatuses and
wfcLayerState.LayerStateData.SetDisplayStatuses get 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
wfcModel.WModel.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
wfcLayerState.LayerStateData.SetLayerStateName and
wfcLayerState.LayerStateData.SetLayerStateName get and set the name of the new layer state. The name must only consist of alphanumeric, underscore, and hypen characters.
The method
wfcModel.WModel.ListLayers returns an array containing the layers in the model.
The method
wfcSolid.WSolid.ListLayerStates returns an array of layer states in the specified model.
The method
wfcSolid.WSolid.CreateLayerState creates a new layer state.
The method
wfcSolid.WSolid.GetActiveLayerState retrieves the active layer state in a specified solid model.
Use the method
wfcModel.WModel.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
wfcSolid.WSolid.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.