Skip to main content

Rocky PrePost scripting 2026 R1

RAMeshColoring

Last update: 23.02.2026

class RAMeshColoring

Rocky PrePost Scripting wrapper to manipulate Mesh Colorings.

This wrapper can be accessed via the project’s classes GetMeshColoring that allow coloring:

window = app.Create3DWindow('Win 01')
particles = study.GetParticles()
particles_coloring = particles.GetMeshColoring('Win 01')
particles_coloring.SetNodeVisible(True)

Valid coloring modes, i.e. Node, Edges, Faces or Vectors can be accessed via GetValidColoringModes. The property being shown can be additionally modified:

particles_coloring.SetNodeGridFunction(None)  # for solid colors
particles_coloring.SetNodeColor((1.0, 1.0, 1.0))
particles_coloring.SetNodeGridFunction('Absolute Rotational Velocity')  # for properties

Methods:

Name Description
GetAvailableGridFunctions() Get a list of all possible values for "GridFunctions".
GetAvailableGridFunctionsNames() Get a list of all possible values for "GridFunctions" names.
GetAvailableVectorGridFunctions() Get a list of all possible values for Vector "GridFunctions".
GetAvailableVectorGridFunctionsNames() Get a list of all possible values for Vector "GridFunctions" names.
GetEdgeColor() Get the value of "Edge Color".
GetEdgeGridFunction() Get the value of "Edge GridFunction".
GetEdgeLineWidth() Get the value of "Edge Line Width".
GetEdgeVisible() Get the value of "Edge Visible".
GetFaceColor() Get the value of "Face Color".
GetFaceCustomStructuredPartitions() Get the value of "Face Custom Structured Partitions".
GetFaceGridFunction() Get the value of "Face GridFunction".
GetFaceScope() Get "Face Scope" as a string.
GetFaceShowOnNode() Get the value of "Show On Node".
GetFaceStructuredPartitions() Get "Face Structured Partitions" as a string.
GetFaceVisible() Get the value of "Face Visible".
GetLevelOfDetail() Get "Level of Detail" as a string.
GetNodeColor() Get the value of "Node Color".
GetNodeGridFunction() Get the value of "Node GridFunction".
GetNodePointSize() Get the value of "Node Point Size".
GetNodeVisible() Get the value of "Node Visible".
GetNormalizedVectorsEnabled() Get the value of "Normalized Vector".
GetStride() Get the value of "Stride".
GetTransparency() Get the value of "Transparency".
GetTransparencyEnabled() Get the value of "Transparency".
GetValidColoringModes() Get a list with all possible coloring modes names.
GetValidFaceCustomStructuredPartitions() Get a list of all possible values for "Face Custom Structured Partitions".
GetValidFaceScopes() Get a list of all possible values for "Face Scope".
GetValidFaceStructuredPartitionsValues() Get a list of all possible values for "Face Structured Partitions".
GetValidLevelOfDetailValues() Get a list of all possible values for "Level of Detail".
GetVectorGridFunction() Get the value of "Vector GridFunction".
GetVectorScale() Get the value of "Vector Scale".
GetVectorVisible() Get the value of "Vector Visible".
GetVisible() Get the value of "Visible".
SetEdgeColor(values) Set the values of "Edge Color".
SetEdgeGridFunction(value) Set the values of "Edge GridFunction".
SetEdgeLineWidth(value) Set the value of "Edge Line Width".
SetEdgeVisible(value) Set the value of "Edge Visible".
SetFaceColor(values) Set the values of "Face Color".
SetFaceCustomStructuredPartitions(values) Set the value of "Face Custom Structured Partitions".
SetFaceGridFunction(value) Set the values of "Face GridFunction".
SetFaceScope(value) Set the value of "Face Scope".
SetFaceShowOnNode(value) Set the value of "Show On Node".
SetFaceStructuredPartitions(value) Set the value of "Face Structured Partitions".
SetFaceVisible(value) Set the value of "Face Visible".
SetLevelOfDetail(value) Set the value of "Level of Detail".
SetNodeColor(values) Set the values of "Node Color".
SetNodeGridFunction(value) Set the values of "Node GridFunction".
SetNodePointSize(value) Set the value of "Node Point Size".
SetNodeVisible(value) Set the value of "Node Visible".
SetNormalizedVectorsEnabled(value) Set the value of "Normalized Vectors".
SetStride(value) Set the value of "Stride".
SetTransparency(value) Set the value of "Transparency".
SetTransparencyEnabled(value) Set the value of "Transparency".
SetVectorGridFunction(value) Set the values of "Vector GridFunction".
SetVectorScale(value) Set the value of "Vector Scale".
SetVectorVisible(value) Set the value of "Vector Visible".
SetVisible(value) Set the value of "Visible".

GetAvailableGridFunctions()

Get a list of all possible values for “GridFunctions”.

  • Returns: The returned set contains the SemanticAssociation of the available Grid Functions.

GetAvailableGridFunctionsNames()

Get a list of all possible values for “GridFunctions” names.

  • Returns: The returned set contains the names of the available Grid Functions.

GetAvailableVectorGridFunctions()

Get a list of all possible values for Vector “GridFunctions”.

  • Returns: The returned set contains the SemanticAssociation of the available Vector Grid Functions.

GetAvailableVectorGridFunctionsNames()

Get a list of all possible values for Vector “GridFunctions” names.

  • Returns: The returned set contains the names of the available Vector Grid Functions.

GetEdgeColor()

Get the value of “Edge Color”.

GetEdgeGridFunction()

Get the value of “Edge GridFunction”.

GetEdgeLineWidth()

Get the value of “Edge Line Width”.

GetEdgeVisible()

Get the value of “Edge Visible”.

GetFaceColor()

Get the value of “Face Color”.

GetFaceCustomStructuredPartitions()

> Get the value of “Face Custom Structured Partitions”.

  • Returns: The returned value will be a combination of [‘Top’, ‘Bottom’, ‘North’, ‘South’, ‘East’, ‘West’].

GetFaceGridFunction()

Get the value of “Face GridFunction”.

GetFaceScope()

Get “Face Scope” as a string.

  • Returns: The return will be one of the “GetValidFaceScopes” values.

GetFaceShowOnNode()

Get the value of “Show On Node”.

GetFaceStructuredPartitions()

Get “Face Structured Partitions” as a string.

  • Returns: The returned value will be one of [‘All’, ‘Custom…’].

GetFaceVisible()

Get the value of “Face Visible”.

GetLevelOfDetail()

Get “Level of Detail” as a string.

  • Returns: The returned value will be one of [‘Rich’, ‘Automatic’, ‘Simple’].

GetNodeColor()

Get the value of “Node Color”.

GetNodeGridFunction()

Get the value of “Node GridFunction”.

GetNodePointSize()

Get the value of “Node Point Size”.

GetNodeVisible()

Get the value of “Node Visible”.

GetNormalizedVectorsEnabled()

Get the value of “Normalized Vector”.

GetStride()

Get the value of “Stride”.

GetTransparency()

Get the value of “Transparency”.

GetTransparencyEnabled()

Get the value of “Transparency”.

GetValidColoringModes()

Get a list with all possible coloring modes names.

  • Returns: The returned values will be a combination of [‘Node’, ‘Edge’, ‘Face’, ‘Vector’]

GetValidFaceCustomStructuredPartitions()

Get a list of all possible values for “Face Custom Structured Partitions”.

> * return: > The returned list is [‘Top’, ‘Bottom’, ‘North’, ‘South’, ‘East’, ‘West’].

GetValidFaceScopes()

Get a list of all possible values for “Face Scope”.

  • Returns: The returned list with the valid scope options.

GetValidFaceStructuredPartitionsValues()

Get a list of all possible values for “Face Structured Partitions”.

  • Returns: The returned list is [‘All’, ‘Custom…’].

GetValidLevelOfDetailValues()

Get a list of all possible values for “Level of Detail”.

  • Returns: The returned list is [‘Rich’, ‘Automatic’, ‘Simple’].

GetVectorGridFunction()

Get the value of “Vector GridFunction”.

GetVectorScale()

Get the value of “Vector Scale”.

GetVectorVisible()

Get the value of “Vector Visible”.

GetVisible()

Get the value of “Visible”.

SetEdgeColor(values: tuple[float, float, float])

Set the values of “Edge Color”.

  • Parameters: values – The values to set. The values must be a tuple of floats. Must have exactly 3 elements.
  • Raises: RockyApiError – If values doesn’t have exactly 3 elements or values is not a tuple.

SetEdgeGridFunction(value: SemanticAssociation | str | None)

Set the values of “Edge GridFunction”.

  • Parameters: value – The value to set. The value can be heterogeneous, it can be a SemanticAssociation, a str of its name or None for solid colors.
  • Raises: RockyApiError – If value is not a valid type or is not available for the current coloring.

SetEdgeLineWidth(value: float)

Set the value of “Edge Line Width”.

  • Parameters: value – The value to set. This value must be a float type.

SetEdgeVisible(value: bool)

Set the value of “Edge Visible”.

  • Parameters: value – The value to set.

SetFaceColor(values: tuple[float, float, float])

Set the values of “Face Color”.

  • Parameters: values – The values to set. The values must be a tuple of floats. Must have exactly 3 elements.
  • Raises: RockyApiError – If values doesn’t have exactly 3 elements or values is not a tuple.

SetFaceCustomStructuredPartitions(values: list[str])

Set the value of “Face Custom Structured Partitions”.

  • Parameters: values – A list containing all the custom partitions.
  • Raises: RockyApiError – If any of values is not a valid “Face Custom Structured Partitions” option.

SetFaceGridFunction(value: SemanticAssociation | str | None)

Set the values of “Face GridFunction”.

  • Parameters: value – The value to set. The value can be heterogeneous, it can be a SemanticAssociation, a str of its name or None for solid colors.
  • Raises: RockyApiError – If value is not a valid type or is not available for the current coloring.

SetFaceScope(value: str)

Set the value of “Face Scope”.

  • Parameters: value – The value to set.
  • Raises: RockyApiError – If value is not a valid “Face Scope” option.

SetFaceShowOnNode(value: bool)

Set the value of “Show On Node”.

  • Parameters: value – The value to set.

SetFaceStructuredPartitions(value: str)

Set the value of “Face Structured Partitions”.

  • Parameters: value – The value to set.
  • Raises: RockyApiError – If value is not a valid “Face Structured Partitions” option.

SetFaceVisible(value: bool)

Set the value of “Face Visible”.

  • Parameters: value – The value to set.

SetLevelOfDetail(value: str)

Set the value of “Level of Detail”.

  • Parameters: value – The value to set. Must be one of [‘Rich’, ‘Automatic’, ‘Simple’].
  • Raises: RockyApiError – If value is not a valid “Level of Detail” option.

SetNodeColor(values: tuple[float, float, float])

Set the values of “Node Color”.

  • Parameters: values – The values to set. The values must be a tuple of floats. Must have exactly 3 elements.
  • Raises: RockyApiError – If values doesn’t have exactly 3 elements or values is not a tuple.

SetNodeGridFunction(value: SemanticAssociation | str | None)

Set the values of “Node GridFunction”.

  • Parameters: value – The value to set. The value can be heterogeneous, it can be a SemanticAssociation, a str of its name or None for solid colors.
  • Raises: RockyApiError – If value is not a valid type or is not available for the current coloring.

SetNodePointSize(value: float)

Set the value of “Node Point Size”.

  • Parameters: value – The value to set. This value must be a float type.

SetNodeVisible(value: bool)

Set the value of “Node Visible”.

  • Parameters: value – The value to set.

SetNormalizedVectorsEnabled(value: bool)

Set the value of “Normalized Vectors”.

  • Parameters: value – The value to set.

SetStride(value: int)

Set the value of “Stride”.

  • Parameters: value – The value to set. This value must be an int type.

SetTransparency(value: float)

Set the value of “Transparency”.

  • Parameters: value – The value to set. This value must be a float type between 0 and 100.

SetTransparencyEnabled(value: bool)

Set the value of “Transparency”.

  • Parameters: value – The value to set.

SetVectorGridFunction(value: SemanticAssociation | str | None)

Set the values of “Vector GridFunction”.

  • Parameters: value – The value to set. The value can be heterogeneous, it can be a SemanticAssociation, a str of its name or None for solid colors.
  • Raises: RockyApiError – If value is not a valid type or is not available for the current coloring.

SetVectorScale(value: float)

Set the value of “Vector Scale”.

  • Parameters: value – The value to set. This value must be a float type.

SetVectorVisible(value: bool)

Set the value of “Vector Visible”.

  • Parameters: value – The value to set.

SetVisible(value: bool)

Set the value of “Visible”.

  • Parameters: value – The value to set.

Connect with Ansys