RACustomInput#

class ansys.rocky.app.ra_custom_input.RACustomInput(id: str, model_id: str | None = None)#

Bases: ansys.rocky.app.api_element_item.ApiElementItem, ansys.rocky.app.ra_addins.ElementWithAddins, ansys.rocky.app.motion._with_movement_mixin._WithMovementMixin

Rocky PrePost Scripting wrapper for a single Custom Input.

This wrapper class corresponds to an individual entry under the “Inputs” item on the project’s data tree. Particle inputs can be retrieved from the RAStudy or the RAInletsOutletsCollection via:

input_1 = study.GetElement('Custom Input <1>')
input_2 = input_collection.GetParticleInput('Custom Input <2>')

Instances of RACustomInput gives access to its two properties: The id of the Particle that will be used in the particle generation and the path of the csv file which will contain the information for each desired particle to be generated, such as, positioning, size, release time.

Overview#

GetFilePath

Get the value of “File Path”.

SetFilePath

Set the path of the file that will be used to generate the particles

GetMotionFrame

Get the “Motion Frame”.

SetMotionFrame

Assign a Motion Frame to the custom input.

GetAvailableMotionFrames

Get all available Motion Frames.

GetDefaultTemperature

Get the value of “Default Temperature”.

SetDefaultTemperature

Set the value of “Default Temperature”.

GetName

Get the value of “Name”.

SetName

Set the value of “Name”.

GetParticle

Get the “Particle”.

SetParticle

Set the “Particle”.

GetAvailableParticles

Get all available Particles.

Import detail#

from ansys.rocky.app.ra_custom_input import RACustomInput

Method detail#

classmethod RACustomInput.GetWrappedClass()#
classmethod RACustomInput.GetClassName()#
RACustomInput.GetFilePath()#

Get the value of “File Path”.

Return type:

str

RACustomInput.SetFilePath(file_path) None#

Set the path of the file that will be used to generate the particles described on the content of the file.

The accepted file extensions are [“.csv”, “.xls”, “.xlsx”, “.xlsm”, “.xlsb”, “.odf”].

Parameters:

file_path (str or Path)

RACustomInput.GetMotionFrame()#

Get the “Motion Frame”.

Return type:

RAMotionFrame

RACustomInput.SetMotionFrame(motion_frame: ansys.rocky.app.motion.ra_motion_frame.RAMotionFrame | str | None) None#

Assign a Motion Frame to the custom input.

Parameters:

motion_frame – Either the API object or its name.

RACustomInput.GetAvailableMotionFrames()#

Get all available Motion Frames.

Return type:

List[RAMotionFrame] A list of RAMotionFrame.

RACustomInput.GetDefaultTemperature(unit: str | None = None) float#

Get the value of “Default Temperature”.

Parameters:

unit – The unit for the returned value. If no unit is provided, the returned value will be in “K”.

RACustomInput.SetDefaultTemperature(value: str | float, unit: str | None = None) None#

Set the value of “Default Temperature”.

Parameters:
  • value – The value to set. This value can be an expression with input variables or float type.

  • unit – The unit for value. If no unit is provided, value is assumed to be in “K”.

RACustomInput.GetName() str#

Get the value of “Name”.

RACustomInput.SetName(value: str) None#

Set the value of “Name”.

Parameters:

value – The value to set.

RACustomInput.GetParticle()#

Get the “Particle”.

Return type:

RAParticle

RACustomInput.SetParticle(value) None#

Set the “Particle”.

:param unicode, RAParticle value:

Either the API object wrapping the desired entity or its name.

RACustomInput.GetAvailableParticles()#

Get all available Particles.

Return type:

List[RAParticle] A list of RAParticle.