LayoutCollection Class

class NXOpen.LayoutCollection

Bases: object

Represents a collection of layouts.

To obtain an instance of this class, refer to NXOpen.BasePart

New in version NX3.0.0.

Properties

Property Description
Current Returns the current layout of the part.

Methods

Method Description
ChangeLayout Sets the given layout as current layout
ChangeLayoutWithOptions Sets the given layout as current layout and optionally removes the old and/or new layout caches
Create Creates a layout using an NXOpen.LayoutDefinition.
CreateSplitScreenLayoutAndNamedViews This method creates a layout with two modeling views.
DestroySplitScreenLayoutAndNamedViews This method destroys the split screen layout along with the views * that are there in it
FindObject Finds the NXOpen.Layout with the given identifier as recorded in a journal.
NewLayoutDefinition Constructs a NXOpen.LayoutDefinition object to be used to create a layout.
RenameViewsInSplitScreenLayout Using given names renames the views in split screen layout.

Property Detail

Current

LayoutCollection.Current

Returns the current layout of the part.

When in the drafting application and a drawing sheet is not displayed, this will return a layout that has limited operations that can be performed on it.

-------------------------------------

Getter Method

Signature Current

Returns:
Return type:NXOpen.Layout

New in version NX3.0.0.

License requirements: None.

Method Detail

ChangeLayout

LayoutCollection.ChangeLayout

Sets the given layout as current layout

Signature ChangeLayout(layout)

Parameters:layout (NXOpen.Layout) – Layout

New in version NX6.0.0.

License requirements: None.

ChangeLayoutWithOptions

LayoutCollection.ChangeLayoutWithOptions

Sets the given layout as current layout and optionally removes the old and/or new layout caches

Signature ChangeLayoutWithOptions(layout, removeOldLayoutCache, ignoreNewLayoutCache)

Parameters:
  • layout (NXOpen.Layout) – Layout
  • removeOldLayoutCache (bool) – Flag to indicate if the current layout’s cache should be removed
  • ignoreNewLayoutCache (bool) – Flag to indicate if the new layout’s cache should be used or removed

New in version NX11.0.0.

License requirements: None.

Create

LayoutCollection.Create

Creates a layout using an NXOpen.LayoutDefinition.

Signature Create(name, layoutArrangement, fitAllViews)

Parameters:
  • name (str) – Name of layout
  • layoutArrangement (NXOpen.LayoutDefinition) – Arrangement and view location information
  • fitAllViews (bool) – Flag that indicates for the system to perform a fit before displaying the view. Otherwise the system displays the view at the scale at which it was last saved.
Returns:

Return type:

NXOpen.Layout

New in version NX3.0.0.

License requirements: None.

CreateSplitScreenLayoutAndNamedViews

LayoutCollection.CreateSplitScreenLayoutAndNamedViews

This method creates a layout with two modeling views.

The views ** are created with names given. Layout and view tags are returned

Signature CreateSplitScreenLayoutAndNamedViews(leftViewName, rightViewname)

Parameters:
  • leftViewName (str) – name for the left view
  • rightViewname (str) – name for the right view
Returns:

a tuple

Return type:

A tuple consisting of (layout, leftView, rightView). layout is a NXOpen.Layout. Layout leftView is a NXOpen.View. View rightView is a NXOpen.View. View

New in version NX6.0.0.

License requirements: None.

DestroySplitScreenLayoutAndNamedViews

LayoutCollection.DestroySplitScreenLayoutAndNamedViews

This method destroys the split screen layout along with the views * that are there in it

Signature DestroySplitScreenLayoutAndNamedViews(layout)

Parameters:layout (NXOpen.Layout) – Layout

New in version NX6.0.0.

License requirements: None.

FindObject

LayoutCollection.FindObject

Finds the NXOpen.Layout with the given identifier as recorded in a journal.

An object may not return the same value as its JournalIdentifier in different versions of the software. However newer versions of the software should find the same object when FindObject is passed older versions of its journal identifier. In general, this method should not be used in handwritten code and exists to support record and playback of journals.

An exception will be thrown if no object can be found with the given journal identifier.

Signature FindObject(journalIdentifier)

Parameters:journalIdentifier (str) – Identifier to be found
Returns:Layout found
Return type:NXOpen.Layout

New in version NX3.0.0.

License requirements: None.

NewLayoutDefinition

LayoutCollection.NewLayoutDefinition

Constructs a NXOpen.LayoutDefinition object to be used to create a layout.

If a layout is not created using the created definition object, the client is responsible for deleting it.

Signature NewLayoutDefinition(arrangement)

Parameters:arrangement (NXOpen.LayoutDefinitionArrangementType) – Arrangement type
Returns:Layout arrangement used

to create a layout :rtype: NXOpen.LayoutDefinition

New in version NX3.0.0.

License requirements: None.

RenameViewsInSplitScreenLayout

LayoutCollection.RenameViewsInSplitScreenLayout

Using given names renames the views in split screen layout.

Signature RenameViewsInSplitScreenLayout(layout, leftViewName, rightViewName)

Parameters:
  • layout (NXOpen.Layout) – Layout
  • leftViewName (str) – name for the left view
  • rightViewName (str) – name for the right view

New in version NX6.0.0.

License requirements: None.