Node Class

class NXOpen.BlockStyler.Node

Bases: NXOpen.TaggedObject

Represents the node created and utilized by BlockStyler.Tree.

The node represents the single row of the tree. .. versionadded:: NX7.5.0

Properties

Property Description
CrossSelection Returns or sets the flag indicating whether cross section is allowed.
DisplayIcon Returns or sets the display icon.
DisplayText Returns or sets the display text of node.
FirstChildNode Returns the first child node.
ForegroundColor Returns or sets the text color of the node.
IsExpanded Returns the flag indicating whether the node is in expanded state
IsInserted Returns the flag indicating whether the node is inserted in BlockStyler.Tree
IsSelected Returns the flag indicating whether the node is in selected state
NextNode Returns the next node which might not belong to the same hierarchy.
NextSelectedNode Returns the next selected node in the whole tree hierarchy.
NextSiblingNode Returns the next node which belongs to the same hierarchy.
ParentNode Returns the parent node.
PreviousNode Returns the previous node which might not belong to the same hierarchy.
PreviousSelectedNode Returns the previous selected node in the whole tree hierarchy.
PreviousSiblingNode Returns the previous node which belongs to the same hierarchy.
SelectedIcon Returns or sets the selected icon.
Tag Returns the Tag for this object.

Methods

Method Description
Expand Expands/collapses the node
GetColumnDisplayText Gets the column text for the given columnId.
GetNodeData
Gets node data which contains the data in the form of unique name-value pairs. In this context unique name is termed as property name. There could me more than one such property name - value pair, but the property name of the primary data should be named Data (case-sensitive). For instance, if a BlockStyler.Node represents a feature object then property name should be Data and the value should be feature object. The primary data is used by NX for some operations such cross selection.
GetState Gets the node state associated with node state icon.
ScrollTo Scrolls horizontally and vertically to make the specific column of node appear on the tree window.
SetColumnDisplayText Sets the text in the column which corresponds to given columnId.
SetState Sets the node state which is associated with node state icon.

Enumerations

NodeDragType Enumeration Represents the drag type
NodeDropType Enumeration Represents the drop type
NodeExpandOption Enumeration Represents the Expand/Collapse option
NodeScroll Enumeration Represents the scroll position to be applied on node.

Property Detail

CrossSelection

Node.CrossSelection

Returns or sets the flag indicating whether cross section is allowed.

It is useful when the node contains NXOpen.DisplayableObject as data. If the flag is true then the NXOpen.DisplayableObject is highlighted, else not. The default value is True

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

Getter Method

Signature CrossSelection()

Returns:Flag indicating whether cross selection is allowed.
Return type:bool

New in version NX7.5.0.

License requirements: None.

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

Setter Method

Signature CrossSelection(crossSelection)

Parameters:crossSelection (bool) – Flag indicating whether cross selection is allowed.

New in version NX7.5.0.

License requirements: None.

DisplayIcon

Node.DisplayIcon

Returns or sets the display icon.

This is normal icon positioned before the node text and is displayed when the node is in unselected state.

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

Getter Method

Signature DisplayIcon()

Returns:Icon.
Return type:str

New in version NX7.5.0.

License requirements: None.

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

Setter Method

Signature DisplayIcon(icon)

Parameters:icon (str) – Icon.

New in version NX7.5.0.

License requirements: None.

DisplayText

Node.DisplayText

Returns or sets the display text of node.

This is same as 0th column text of this node. Use BlockStyler.Node.SetColumnDisplayText() to fetch the text of other column of the same node.

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

Getter Method

Signature DisplayText()

Returns:Display text
Return type:str

New in version NX7.5.0.

License requirements: None.

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

Setter Method

Signature DisplayText(displayTest)

Parameters:displayTest (str) – Display text

New in version NX7.5.0.

License requirements: None.

FirstChildNode

Node.FirstChildNode

Returns the first child node.

Returns None if child node is not present.

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

Getter Method

Signature FirstChildNode()

Returns:First child node.
Return type:NXOpen.BlockStyler.Node

New in version NX7.5.0.

License requirements: None.

ForegroundColor

Node.ForegroundColor

Returns or sets the text color of the node.

The color is applicable for whole row.

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

Getter Method

Signature ForegroundColor()

Returns:Foreground color
Return type:int

New in version NX7.5.0.

License requirements: None.

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

Setter Method

Signature ForegroundColor(nodeForgroundColor)

Parameters:nodeForgroundColor (int) – Foreground color.

New in version NX7.5.0.

License requirements: None.

IsExpanded

Node.IsExpanded

Returns the flag indicating whether the node is in expanded state

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

Getter Method

Signature IsExpanded()

Returns:Flag indicating whether node is expanded.
Return type:bool

New in version NX7.5.3.

License requirements: None.

IsInserted

Node.IsInserted

Returns the flag indicating whether the node is inserted in BlockStyler.Tree

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

Getter Method

Signature IsInserted()

Returns:Flag indicating whether node is inserted.
Return type:bool

New in version NX7.5.0.

License requirements: None.

IsSelected

Node.IsSelected

Returns the flag indicating whether the node is in selected state

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

Getter Method

Signature IsSelected()

Returns:Flag indicating whether the node is in selected state.
Return type:bool

New in version NX7.5.3.

License requirements: None.

NextNode

Node.NextNode

Returns the next node which might not belong to the same hierarchy.

The next node either is a sibling node or belongs to other root node. Returns None if next node is not present

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

Getter Method

Signature NextNode()

Returns:Next node.
Return type:NXOpen.BlockStyler.Node

New in version NX7.5.0.

License requirements: None.

NextSelectedNode

Node.NextSelectedNode

Returns the next selected node in the whole tree hierarchy.

The node on which this method is called does not have to be selected. Returns None if none of the next nodes are selected.

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

Getter Method

Signature NextSelectedNode()

Returns:Selected node following the provided node.
Return type:NXOpen.BlockStyler.Node

New in version NX7.5.0.

License requirements: None.

NextSiblingNode

Node.NextSiblingNode

Returns the next node which belongs to the same hierarchy.

Returns None null if next sibling node is not present.

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

Getter Method

Signature NextSiblingNode()

Returns:Next sibling node.
Return type:NXOpen.BlockStyler.Node

New in version NX7.5.0.

License requirements: None.

ParentNode

Node.ParentNode

Returns the parent node.

Returns None if parent node is not present

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

Getter Method

Signature ParentNode()

Returns:Parent node.
Return type:NXOpen.BlockStyler.Node

New in version NX7.5.0.

License requirements: None.

PreviousNode

Node.PreviousNode

Returns the previous node which might not belong to the same hierarchy.

Returns None null if previous node is not present

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

Getter Method

Signature PreviousNode()

Returns:Previous node.
Return type:NXOpen.BlockStyler.Node

New in version NX7.5.0.

License requirements: None.

PreviousSelectedNode

Node.PreviousSelectedNode

Returns the previous selected node in the whole tree hierarchy.

The node on which this method is called does not have to be selected. Returns None if none of the previous nodes are selected.

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

Getter Method

Signature PreviousSelectedNode()

Returns:Previous selected node.
Return type:NXOpen.BlockStyler.Node

New in version NX7.5.0.

License requirements: None.

PreviousSiblingNode

Node.PreviousSiblingNode

Returns the previous node which belongs to the same hierarchy.

Returns None if previous sibling node is not present.

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

Getter Method

Signature PreviousSiblingNode()

Returns:Previous sibling node.
Return type:NXOpen.BlockStyler.Node

New in version NX7.5.0.

License requirements: None.

SelectedIcon

Node.SelectedIcon

Returns or sets the selected icon.

This icon appears on node selection and is positioned before the node text replacing the BlockStyler.Node.DisplayIcon`().

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

Getter Method

Signature SelectedIcon()

Returns:Icon
Return type:str

New in version NX7.5.0.

License requirements: None.

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

Setter Method

Signature SelectedIcon(icon)

Parameters:icon (str) – Icon.

New in version NX7.5.0.

License requirements: None.

Method Detail

Expand

Node.Expand

Expands/collapses the node

Signature Expand(expandOption)

Parameters:expandOption (NXOpen.BlockStyler.NodeExpandOption) – Expand option

New in version NX7.5.0.

License requirements: None.

GetColumnDisplayText

Node.GetColumnDisplayText

Gets the column text for the given columnId.

The text is interpreted as icon if the column display type is BlockStyler.TreeColumnDisplay.Icon.

Signature GetColumnDisplayText(columnID)

Parameters:columnID (int) – Unique column id of the column.
Returns:Text associated with column.
Return type:str

New in version NX7.5.0.

License requirements: None.

GetNodeData

Node.GetNodeData

Gets node data which contains the data in the form of unique name-value pairs. In this context unique name is termed as property name. There could me more than one such property name - value pair, but the property name of the primary data should be named “Data” (case-sensitive). For instance, if a BlockStyler.Node represents a feature object then property name should be “Data” and the value should be feature object. The primary data is used by NX for some operations such cross selection.

Initialy the container or list is empty and it is expected that data would be added to it. Additional property name - value pair can be added to the container or list, but it should be made sure that there is no dublicate property name exists in the container or list. The additional data can be seen as book keeping information for node. At any point the node data can be fetched and value can be extracted using the corresponding property name. Refer to NXOpen.DataContainer on how property name-value pair is added to the container or list.

Signature GetNodeData()

Returns:Node data which is list of property name - value pair. New property name - value pair can be added to it and existing value can be fetched using corresponding property name.
Return type:NXOpen.DataContainer

New in version NX7.5.0.

License requirements: None.

GetState

Node.GetState

Gets the node state associated with node state icon.

Node state is an iconic representation, e.g., checked/unchecked icons for corresponding state. Node state value 1 and 2 represents the standard checked and unchecked state respectively.

Signature GetState()

Returns:Node state
Return type:int

New in version NX7.5.0.

License requirements: None.

ScrollTo

Node.ScrollTo

Scrolls horizontally and vertically to make the specific column of node appear on the tree window.

Signature ScrollTo(columnID, visibleOption)

Parameters:
  • columnID (int) – ColumnId of the column to which tree window scrolls horizontally.
  • visibleOption (NXOpen.BlockStyler.NodeScroll) – Option to scroll the tree window vertically.

New in version NX7.5.0.

License requirements: None.

SetColumnDisplayText

Node.SetColumnDisplayText

Sets the text in the column which corresponds to given columnId.

The text is interpreted as icon if the column display type is BlockStyler.TreeColumnDisplay.Icon.

Signature SetColumnDisplayText(columnID, columnDisplayText)

Parameters:
  • columnID (int) – Unique coulmn id of the column.
  • columnDisplayText (str) – Text associated with column

New in version NX7.5.0.

License requirements: None.

SetState

Node.SetState

Sets the node state which is associated with node state icon.

Node state is an iconic representation, e.g., checked/unchecked state. Setting node state to value other than 1 and 2 calls BlockStyler.Tree.StateIconName callback to fetch the icon name. Node state can be set only after the node has been added to TreeList.

Signature SetState(state)

Parameters:state (int) – Node state

New in version NX7.5.0.

License requirements: None.