RACustomCurveAndGridProperty#

class ansys.rocky.app.ra_custom_calculators.RACustomCurveAndGridProperty#

Helper class, to add, edit and remove custom curves and grid properties.

particles = study.GetParticles()
particles.AddCustomCurve(name='Custom Curve', scope='user', sources={'A': 'Particles Mass', 'B': 'Particles In Count'})
particles.EditCustomCurve(edit_curve='Custom Curve', expression='A+B')
particles.RemoveCustomCurve(name='Custom Curve')

particles.AddCustomProperty(name='Property A', sources={'A': 'Coordinate : X', 'B': 'Coordinate : Y'})
particles.EditCustomProperty(edit_property='Property A', new_name='New Property', expression='A*B')
particles.RemoveCustomProperty(name='New Property')

Overview#

AddCustomCurve

Add a custom curve in the database.

EditCustomCurve

Edit a custom curve saved in the database.

RemoveCustomCurve

Remove the curve from the database

AddCustomProperty

Add a custom property to the database

EditCustomProperty

Edit a custom property saved in the database.

RemoveCustomProperty

Remove the property from the database

Import detail#

from ansys.rocky.app.ra_custom_calculators import RACustomCurveAndGridProperty

Method detail#

RACustomCurveAndGridProperty.AddCustomCurve(name: str, curve_type: str = ..., output_unit: str = ..., scope: str = ..., sources: dict[str, str] | None = None, expression: str = '') None#

Add a custom curve in the database. :param name:

The name of the curve to be set.

Parameters:
  • curve_type – The type of the custom curve to be added.

  • output_unit – The output unit, in which case the unit database will be queried for a quantity that makes sense. If None, the quantity is considered unknown.

  • scope – The scope to be set.

  • sources – A dict pointing the variable used to the curve association it represents and a string indicating in which unit the input data should be gotten.

  • expression – The expression to be set.

RACustomCurveAndGridProperty.EditCustomCurve(edit_curve: str, new_name: str | None = None, sources: dict[str, str] | None = None, expression: str | None = None) None#

Edit a custom curve saved in the database. :param edit_curve:

The name of the curve to be edited.

Parameters:
  • new_name – The new name of the curve to be set.

  • sources – A dict pointing the variable used to the curve association it represents and a string indicating in which unit the input data should be gotten.

  • expression – The expression to be set.

RACustomCurveAndGridProperty.RemoveCustomCurve(name: str) None#

Remove the curve from the database :param name:

The name of the curve to be removed.

RACustomCurveAndGridProperty.AddCustomProperty(name: str, property_type: str = ..., output_unit: str = ..., scope: str = ..., sources: dict[str, str] | None = None, expression: str = '') None#

Add a custom property to the database

Parameters:
  • name – The name of the property to be set.

  • property_type – The type of the custom property to be added.

  • output_unit – The output unit, in which case the unit database will be queried for a quantity that makes sense. If None, the quantity is considered unknown.

  • scope – The scope to be set.

  • sources – A dict pointing the variable used to the property association it represents and a string indicating in which unit the input data should be gotten.

  • expression – The expression to be set.

RACustomCurveAndGridProperty.EditCustomProperty(edit_property: str, new_name: str | None = None, sources: dict[str, str] | None = None, expression: str | None = None) None#

Edit a custom property saved in the database. :param edit_property:

The name of the property to be edited.

Parameters:
  • new_name – The new name of the property to be set.

  • sources – A dict pointing the variable used to the property association it represents and a string indicating in which unit the input data should be gotten.

  • expression – The expression to be set.

RACustomCurveAndGridProperty.RemoveCustomProperty(name: str) None#

Remove the property from the database :param name:

The name of the property to be removed.