NX Open C++ Reference Guide
Public Member Functions | List of all members
NXOpen::Layer::LayerManager Class Reference

Represents an object that manages layers
To obtain an instance of this class, refer to NXOpen::BasePart

Created in NX3.0.0. More...

Public Member Functions

void ApplyMoveToLayerToOwningParts (int newLayer, const std::vector< NXOpen::DisplayableObject * > &objectArray)
 Move the selected objects to the specified layer in their Owning Parts. More...
 
void ChangeStates (const std::vector< NXOpen::Layer::StateInfo > &stateArray, bool fitAll)
 Changes the states of the specified layers in the part. More...
 
void ChangeStates (const std::vector< NXOpen::Layer::StateInfo > &stateArray)
 Changes the states of the specified layers in the part. More...
 
void CopyObjects (int newLayer, const std::vector< NXOpen::NXObject * > &objectArray)
 Copies objects to the specified layer
Objects of class NXOpen::Assemblies::Component , NXOpen::DatumAxis , NXOpen::DatumPlane NXOpen::Edge , NXOpen::Face , NXOpen::Features::Feature or NXOpen::View , may not be copied. More...
 
std::vector< NXOpen::NXObject * > GetAllObjectsOnLayer (int layer)
 Returns all objects on the specified layer. More...
 
NXOpen::Layer::State GetState (int layer)
 Gets the state of the specified layer. More...
 
NXOpen::Layer::StateCollectionGetStates ()
 Gets the states for all layers in the part. More...
 
void GetVisibilitiesInView (NXOpen::View *view, std::vector< NXOpen::Layer::StateInfo > &stateArray)
 Gets the visibility of all layers in a specified view. More...
 
void MoveDisplayableObjects (int newLayer, const std::vector< NXOpen::DisplayableObject * > &objectArray)
 Moves displayable objects to the specified layer. More...
 
void ResetViewVisibilityToGlobal (NXOpen::View *view)
 Resets a view's layer visibility to the global states. More...
 
void SetObjectsVisibilityOnLayer (NXOpen::View *view, const std::vector< NXOpen::Layer::StateInfo > &stateArray, bool doUpdate)
 Sets specified layer(s) visibility in a specified view. More...
 
void SetState (int layer, NXOpen::Layer::State state)
 Sets the state of the specified layer. More...
 
void SetState (int layer, NXOpen::Layer::State state, bool fitAll)
 Sets the state of the specified layer. More...
 
void SetStates (NXOpen::Layer::StateCollection *stateCollection, bool fitAll)
 Sets the states for all layers in the part. More...
 
void SetStates (NXOpen::Layer::StateCollection *stateCollection)
 Sets the states for all layers in the part. More...
 
void SetWorkLayer (int newWorkLayer)
 Sets the work layer. More...
 
tag_t Tag () const
 Returns the tag of this object. More...
 
int WorkLayer ()
 Returns the work layer. More...
 

Detailed Description

Represents an object that manages layers
To obtain an instance of this class, refer to NXOpen::BasePart

Created in NX3.0.0.


Member Function Documentation

void NXOpen::Layer::LayerManager::ApplyMoveToLayerToOwningParts ( int  newLayer,
const std::vector< NXOpen::DisplayableObject * > &  objectArray 
)

Move the selected objects to the specified layer in their Owning Parts.

This only works when a single layer has been selected on the Layer Settings dialog.
The owning parts will be fully loaded if they are not already.

Objects of class NXOpen::CAE::CAEEdge , NXOpen::CAE::CAEFace , NXOpen::CAE::CAEVertex , NXOpen::Edge , NXOpen::Face or NXOpen::View may not be moved.

Created in NX7.5.0.

License requirements : solid_modeling ("SOLIDS MODELING") OR drafting ("DRAFTING")

Parameters
newLayerThe layer in the owning parts to move the objects to
objectArrayThe objects to be moved
void NXOpen::Layer::LayerManager::ChangeStates ( const std::vector< NXOpen::Layer::StateInfo > &  stateArray,
bool  fitAll 
)

Changes the states of the specified layers in the part.

Note: there must be exactly one work layer. If you change the work layer, you must specify a new work layer. If you set the work layer, the old work layer will be changed to Selectable, unless you specify otherwise. The part must be the displayed part.


Created in NX3.0.0.

License requirements : None

Parameters
stateArrayIndicates the new states for the layers.
fitAllWhether to refit the view to what is visible after the layer states have been changed
void NXOpen::Layer::LayerManager::ChangeStates ( const std::vector< NXOpen::Layer::StateInfo > &  stateArray)

Changes the states of the specified layers in the part.

Note: there must be exactly one work layer. If you change the work layer, you must specify a new work layer. If you set the work layer, the old work layer will be changed to Selectable, unless you specify otherwise. The part must be the displayed part.


Created in NX3.0.0.

License requirements : None

Parameters
stateArrayIndicates the new states for the layers.
void NXOpen::Layer::LayerManager::CopyObjects ( int  newLayer,
const std::vector< NXOpen::NXObject * > &  objectArray 
)

Copies objects to the specified layer
Objects of class NXOpen::Assemblies::Component , NXOpen::DatumAxis , NXOpen::DatumPlane NXOpen::Edge , NXOpen::Face , NXOpen::Features::Feature or NXOpen::View , may not be copied.



Objects of type UF_cs2_vertex_type may not be copied.

The part must be the work part.

Created in NX4.0.0.

License requirements : solid_modeling ("SOLIDS MODELING") OR drafting ("DRAFTING")

Parameters
newLayerThe layer to move the objects to
objectArrayThe objects to be copied
std::vector<NXOpen::NXObject *> NXOpen::Layer::LayerManager::GetAllObjectsOnLayer ( int  layer)

Returns all objects on the specified layer.

This includes objects which are not counted as objects on the layer by the "Layer Settings" dialog.
The part must be the displayed part.

Returns
All the objects on the specified layer
Created in NX3.0.0.

License requirements : None
Parameters
layerlayer
NXOpen::Layer::State NXOpen::Layer::LayerManager::GetState ( int  layer)

Gets the state of the specified layer.

The part must be the displayed part.

Returns

Created in NX3.0.0.

License requirements : None
Parameters
layerlayer
NXOpen::Layer::StateCollection* NXOpen::Layer::LayerManager::GetStates ( )

Gets the states for all layers in the part.

The part must be the displayed part.

Returns
Indicates the states for all layers in the part.
Created in NX3.0.0.

License requirements : None
void NXOpen::Layer::LayerManager::GetVisibilitiesInView ( NXOpen::View view,
std::vector< NXOpen::Layer::StateInfo > &  stateArray 
)

Gets the visibility of all layers in a specified view.

The part must be the displayed part.
Created in NX4.0.3.

License requirements : None

Parameters
viewThe view object being queried
stateArrayThe current states for the layers. The returned states can only be Layer::StateVisible and Layer::StateHidden . state_array[i] is for layer i+1
void NXOpen::Layer::LayerManager::MoveDisplayableObjects ( int  newLayer,
const std::vector< NXOpen::DisplayableObject * > &  objectArray 
)

Moves displayable objects to the specified layer.

The specified part may be the displayed part or the work part. If it is the work part but not the displayed part, then none of the objects to be moved may be currently displayed.
This method is the preferred way to change the layer of one or more objects, because NXOpen::DisplayableObject::SetLayer does not correct the display of the objects and does not work as expected for sketches and components, because it does not move the members of the sketch or component.

Objects of class NXOpen::CAE::CAEEdge , NXOpen::CAE::CAEFace , NXOpen::CAE::CAEVertex , NXOpen::Edge , NXOpen::Face or NXOpen::View may not be moved.

Created in NX5.0.0.

License requirements : solid_modeling ("SOLIDS MODELING") OR drafting ("DRAFTING")

Parameters
newLayerThe layer to move the objects to
objectArrayThe objects to be moved
void NXOpen::Layer::LayerManager::ResetViewVisibilityToGlobal ( NXOpen::View view)

Resets a view's layer visibility to the global states.

The part must be the displayed part.
Created in NX4.0.0.

License requirements : None

Parameters
viewThe view object
void NXOpen::Layer::LayerManager::SetObjectsVisibilityOnLayer ( NXOpen::View view,
const std::vector< NXOpen::Layer::StateInfo > &  stateArray,
bool  doUpdate 
)

Sets specified layer(s) visibility in a specified view.

The part must be the displayed part.
Created in NX4.0.0.

License requirements : None

Parameters
viewThe view object being modified
stateArrayThe new states for the layers. The given states may only be Layer::StateVisible and Layer::StateHidden .
doUpdateWhether to update the view(s) after the layer states have been changed
void NXOpen::Layer::LayerManager::SetState ( int  layer,
NXOpen::Layer::State  state 
)

Sets the state of the specified layer.

The specified layer must not be the work layer. If you are changing the state of the layer to Work, the old work layer will be changed to Selectable. The part must be the displayed part.


Created in NX3.0.0.

License requirements : None

Parameters
layerlayer
statestate
void NXOpen::Layer::LayerManager::SetState ( int  layer,
NXOpen::Layer::State  state,
bool  fitAll 
)

Sets the state of the specified layer.

The specified layer must not be the work layer. If you are changing the state of the layer to Work, the old work layer will be changed to Selectable. The part must be the displayed part.


Created in NX3.0.0.

License requirements : None

Parameters
layerlayer
statestate
fitAllWhether to refit the view to what is visible after the layer state has been changed
void NXOpen::Layer::LayerManager::SetStates ( NXOpen::Layer::StateCollection stateCollection,
bool  fitAll 
)

Sets the states for all layers in the part.

The part must be the displayed part. Note: there must be exactly one work layer.
Created in NX3.0.0.

License requirements : None

Parameters
stateCollectionThe states for all layers in the part.
fitAllWhether to refit the view to what is visible after the layer states have been changed
void NXOpen::Layer::LayerManager::SetStates ( NXOpen::Layer::StateCollection stateCollection)

Sets the states for all layers in the part.

The part must be the displayed part. Note: there must be exactly one work layer.
Created in NX3.0.0.

License requirements : None

Parameters
stateCollectionThe states for all layers in the part.
void NXOpen::Layer::LayerManager::SetWorkLayer ( int  newWorkLayer)

Sets the work layer.

If you change the work layer, the old work layer is changed to Selectable. The part must be the displayed part.
Created in NX3.0.0.

License requirements : None

Parameters
newWorkLayerLayer number for the new work layer
tag_t NXOpen::Layer::LayerManager::Tag ( ) const

Returns the tag of this object.

int NXOpen::Layer::LayerManager::WorkLayer ( )

Returns the work layer.

If you change the work layer, the old work layer is changed to Selectable. The part must be the displayed part.
Created in NX3.0.0.

License requirements : None


The documentation for this class was generated from the following file:
Copyright 2017 Siemens Product Lifecycle Management Software Inc. All Rights Reserved.