pyFlightscript package

Submodules

pyFlightscript.acoustics module

pyFlightscript.acoustics.acoustic_observers_import(file_path)

Import acoustic observers from a file.

This function appends a command to the script state to import a list of acoustic observers from a specified file.

Return type:

None

Parameters:

file_path (str) – The absolute path to the file containing the observer data.

Raises:

ValueError – If file_path is not a string.

Examples

>>> # Import observers from a text file
>>> acoustic_observers_import(file_path='C:/path/to/Observers.txt')
pyFlightscript.acoustics.acoustic_sources(enable=True)

Enable or disable acoustic sources during solver initialization.

This function appends a command to the script state to control whether acoustic sources are enabled or disabled when the solver is initialized.

Return type:

None

Parameters:

enable (bool, optional) – The desired enable for the acoustic sources. Must be either ‘ENABLE’ or ‘DISABLE’. The default is True.

Raises:

ValueError – If enable is not a boolean value.

Examples

>>> # Enable acoustic sources
>>> acoustic_sources(enable=True)
>>> # Disable acoustic sources
>>> acoustic_sources(enable=False)
pyFlightscript.acoustics.compute_acoustic_signals()

Compute acoustic signals at all observers.

This function appends a command to the script state to trigger the computation of acoustic signals for all configured observers.

Return type:

None

Examples

>>> # Compute acoustic signals
>>> compute_acoustic_signals()
pyFlightscript.acoustics.create_acoustic_section(frame=1, plane='XZ', offset=-2.0, radial_observers=20, azimuth_observers=40, inner_radius=0.0, outer_radius=3.0, storage_path='C:\\\\...\\\\Acoustic_Output\\\\')

Create and export acoustic section signals.

This function appends a command to the script state to create an acoustic section with specified parameters and export the computed signals to a specified folder.

Return type:

None

Parameters:
  • frame (int)

  • plane (str)

  • offset (float)

  • radial_observers (int)

  • azimuth_observers (int)

  • inner_radius (float)

  • outer_radius (float)

  • storage_path (str)

Examples

>>> # Create an acoustic section with default parameters
>>> create_acoustic_section()
>>> # Create an acoustic section with custom parameters
>>> create_acoustic_section(frame=2, plane='XY', offset=-1.0, radial_observers=15, azimuth_observers=30, inner_radius=0.5, outer_radius=2.5, storage_path='C:/path/to/Acoustic_Output/')
pyFlightscript.acoustics.create_new_acoustic_observer(name, x=0.0, y=0.0, z=0.0)

Create a new acoustic observer.

This function appends a command to the script state to create a new acoustic observer with a specified name and coordinates.

Return type:

None

Parameters:
  • name (str) – The name for the new acoustic observer.

  • x (float, optional) – The x-coordinate of the observer. The default is 0.0.

  • y (float, optional) – The y-coordinate of the observer. The default is 0.0.

  • z (float, optional) – The z-coordinate of the observer. The default is 0.0.

Raises:

ValueError – If name is not a string or if x, y, or z are not numeric.

Examples

>>> # Create an observer at a specific location
>>> create_new_acoustic_observer(name='Observer-1', x=10.0, y=5.0, z=2.0)
>>> # Create an observer at the origin
>>> create_new_acoustic_observer(name='OriginObserver')
pyFlightscript.acoustics.delete_acoustic_observer(observer_index)

Delete an acoustic observer by its index.

This function appends a command to the script state to delete an existing acoustic observer based on its index in the acoustic toolbox UI tree.

Return type:

None

Parameters:

observer_index (int) – The index of the observer to be deleted.

Raises:

ValueError – If observer_index is not an integer.

Examples

>>> # Delete the observer at index 2
>>> delete_acoustic_observer(observer_index=2)
pyFlightscript.acoustics.delete_all_acoustic_observers()

Appends lines to script state to delete all acoustic observers.

Example usage: >>> delete_all_acoustic_observers()

pyFlightscript.acoustics.export_acoustic_signals(filename)

Export acoustic signals at all observers to an external file.

This function appends a command to the script state to save the computed acoustic signals for all configured observers to a specified file.

Return type:

None

Parameters:

filename (str) – The absolute path to the file where the acoustic signals will be saved.

Raises:

ValueError – If filename is not a string.

Examples

>>> # Export acoustic signals to a file
>>> export_acoustic_signals(filename='C:/path/to/output.txt')
pyFlightscript.acoustics.set_acoustic_observer_time(initial_time=0.0, final_time=0.2, time_steps=300)

Set the time parameters for acoustic observers.

This function appends a command to the script state to define the time range and resolution for the acoustic signal computation.

Return type:

None

Parameters:
  • initial_time (float, optional) – The initial time for the observer signal in seconds. The default is 0.0.

  • final_time (float, optional) – The final time for the observer signal in seconds. The default is 0.2.

  • time_steps (int, optional) – The total number of time steps between the initial and final times. The default is 300.

Raises:

ValueError – If initial_time or final_time are not numeric, or if time_steps is not an integer.

Examples

>>> # Use default time parameters
>>> set_acoustic_observer_time()
>>> # Set a custom time range and number of steps
>>> set_acoustic_observer_time(initial_time=0.1, final_time=0.5, time_steps=500)

pyFlightscript.actuators module

pyFlightscript.actuators.create_new_actuator(actuator_type='PROPELLER')

Create a new actuator.

This function appends a command to the script state to create a new actuator of a specified type.

Return type:

None

Parameters:

actuator_type (ValidActuatorTypes, optional) – The type of actuator to create. Must be either ‘PROPELLER’ or ‘JET_EXHAUST’. The default is ‘PROPELLER’.

Raises:

ValueError – If actuator_type is not ‘PROPELLER’ or ‘JET_EXHAUST’.

Examples

>>> # Create a propeller actuator
>>> create_new_actuator(actuator_type='PROPELLER')
>>> # Create a jet exhaust actuator
>>> create_new_actuator(actuator_type='JET_EXHAUST')
pyFlightscript.actuators.delete_actuator(actuator_index)

Delete an existing actuator.

This function appends a command to the script state to delete a specified actuator by its index.

Return type:

None

Parameters:

actuator_index (int) – The index of the actuator to be deleted.

Raises:

ValueError – If actuator_index is not a positive integer.

Examples

>>> # Delete actuator with index 1
>>> delete_actuator(actuator_index=1)
pyFlightscript.actuators.disable_actuator(actuator_id)

Disable an existing actuator.

This function appends a command to the script state to disable a specified actuator by its ID.

Return type:

None

Parameters:

actuator_id (int) – The ID of the actuator to be disabled.

Raises:

ValueError – If actuator_id is not an integer.

Examples

>>> # Disable actuator with ID 2
>>> disable_actuator(actuator_id=2)
pyFlightscript.actuators.edit_actuator(actuator, name, actuator_type, frame, axis, offset, radius, ct=None, rpm=None, swirl_velocity=None, velocity=None, density=None, cm=None)

Edit an existing actuator’s properties.

This function appends a command to the script state to modify the parameters of a specified actuator. The available parameters depend on the actuator type.

Return type:

None

Parameters:
  • actuator (int) – The index of the actuator to be edited.

  • name (str) – The new name to be assigned to the actuator.

  • actuator_type (ValidActuatorTypes) – The type of the actuator, either ‘PROPELLER’ or ‘JET_EXHAUST’.

  • frame (int) – The index of the coordinate system for the actuator.

  • axis (int) – The directional axis for the actuator disc (1 for X, 2 for Y, 3 for Z).

  • offset (Union[int, float]) – The offset distance along the axis for the actuator disc.

  • radius (Union[int, float]) – The radius of the actuator disc.

  • ct (Optional[Union[int, float]], optional) – The thrust coefficient of the propeller (for ‘PROPELLER’ type only). Defaults to None.

  • rpm (Optional[Union[int, float]], optional) – The RPM of the propeller (for ‘PROPELLER’ type only). Defaults to None.

  • swirl_velocity (Optional[str], optional) – Enables or disables swirl velocity (‘ENABLE’ or ‘DISABLE’) (for ‘PROPELLER’ type only). Defaults to None.

  • velocity (Optional[Union[int, float]], optional) – The exhaust velocity (for ‘JET_EXHAUST’ type only). Defaults to None.

  • density (Optional[Union[int, float]], optional) – The density of the exhaust jet (for ‘JET_EXHAUST’ type only). Defaults to None.

  • cm (Optional[Union[int, float]], optional) – The jet spreading coefficient (for ‘JET_EXHAUST’ type only). Defaults to None.

Raises:

ValueError – If input parameters have invalid types or values.

Examples

>>> # Edit a propeller actuator
>>> edit_actuator(
...     actuator=1,
...     name="Prop-1",
...     actuator_type="PROPELLER",
...     frame=2,
...     axis=1,
...     offset=0.5,
...     radius=1.2,
...     ct=0.013,
...     rpm=7000,
...     swirl_velocity="ENABLE"
... )
pyFlightscript.actuators.enable_actuator(actuator_id)

Enable an existing actuator.

This function appends a command to the script state to enable a specified actuator by its ID.

Return type:

None

Parameters:

actuator_id (int) – The ID of the actuator to be enabled.

Raises:

ValueError – If actuator_id is not a non-negative integer.

Examples

>>> # Enable actuator with ID 2
>>> enable_actuator(actuator_id=2)
pyFlightscript.actuators.set_actuator_exhaust(actuator_index, del_vel, jet_density, jet_spreading_rate)

Set the exhaust properties for a jet exhaust actuator.

This function appends a command to the script state to define the exhaust properties, such as velocity, density, and spreading rate, for a specified jet exhaust actuator.

Return type:

None

Parameters:
  • actuator_index (int) – The index of the actuator to be modified.

  • del_vel (Union[int, float]) – The exhaust velocity increment (above freestream) of the jet.

  • jet_density (Union[int, float]) – The density of the jet flow.

  • jet_spreading_rate (Union[int, float]) – The jet spreading coefficient.

Raises:

ValueError – If actuator_index is not a positive integer or if del_vel, jet_density, or jet_spreading_rate are not numeric.

Examples

>>> # Set exhaust properties for actuator 2
>>> set_actuator_exhaust(
...     actuator_index=2,
...     del_vel=100.0,
...     jet_density=0.5,
...     jet_spreading_rate=0.1
... )
pyFlightscript.actuators.set_prop_actuator_profile(actuator_index, units_type, file_name)

Set the thrust profile of a propeller actuator from a file.

This function appends a command to the script state to define the thrust profile of a specified actuator using data from an external file.

Return type:

None

Parameters:
  • actuator_index (int) – The index of the actuator to be modified.

  • units_type (str) – The units of force used in the profile file. Must be one of ‘NEWTONS’, ‘KILO-NEWTONS’, ‘POUND-FORCE’, or ‘KILOGRAM-FORCE’.

  • file_name (str) – The absolute path to the TXT file containing the thrust profile data.

Raises:

ValueError – If units_type is invalid, actuator_index is not a non-negative integer, or file_name is not a string.

Examples

>>> # Set the thrust profile for actuator 1 from a file
>>> set_prop_actuator_profile(
...     actuator_index=1,
...     units_type='NEWTONS',
...     file_name='C:/path/to/thrust_profile.txt'
... )
pyFlightscript.actuators.set_prop_actuator_rpm(actuator_index=1, rpm=2000)

Set the RPM of a propeller actuator.

This function appends a command to the script state to set the rotational speed (RPM) of a specified propeller actuator.

Return type:

None

Parameters:
  • actuator_index (int, optional) – The index of the actuator to be modified. Defaults to 1.

  • rpm (Union[int, float], optional) – The new RPM value for the propeller actuator. Defaults to 2000.

Raises:

ValueError – If actuator_index is not a positive integer or if rpm is not a numeric value.

Examples

>>> # Set the RPM of actuator 1 to 2500
>>> set_prop_actuator_rpm(actuator_index=1, rpm=2500)
>>> # Use default actuator index and set RPM to 3000
>>> set_prop_actuator_rpm(rpm=3000)
pyFlightscript.actuators.set_prop_actuator_swirl(actuator_index, status='DISABLE')

Enable or disable swirl velocity for a propeller actuator.

This function appends a command to the script state to either enable or disable the swirl velocity effect for a specified propeller actuator.

Return type:

None

Parameters:
  • actuator_index (int) – The index of the actuator to be modified.

  • status (str, optional) – The desired status for the swirl velocity, either ‘ENABLE’ or ‘DISABLE’. Defaults to ‘DISABLE’.

Raises:

ValueError – If actuator_index is not a positive integer or if status is not ‘ENABLE’ or ‘DISABLE’.

Examples

>>> # Enable swirl velocity for actuator 1
>>> set_prop_actuator_swirl(actuator_index=1, status='ENABLE')
>>> # Disable swirl velocity for actuator 3
>>> set_prop_actuator_swirl(actuator_index=3, status='DISABLE')
pyFlightscript.actuators.set_prop_actuator_thrust(actuator_index, ct, thrust_type='COEFFICIENT')

Set the thrust of a propeller actuator.

This function appends a command to the script state to set the thrust of a propeller, either as a coefficient or as a force value in specified units.

Return type:

None

Parameters:
  • actuator_index (int) – The index of the actuator to be modified.

  • ct (Union[int, float]) – The thrust value, either as a coefficient or in force units.

  • thrust_type (str, optional) – The type of thrust unit. Must be one of ‘COEFFICIENT’, ‘NEWTONS’, or ‘POUNDS’. Defaults to ‘COEFFICIENT’.

Raises:

ValueError – If input parameters have invalid types or values.

Examples

>>> # Set thrust as a coefficient
>>> set_prop_actuator_thrust(actuator_index=1, ct=0.05, thrust_type='COEFFICIENT')
>>> # Set thrust in Newtons
>>> set_prop_actuator_thrust(actuator_index=1, ct=150.0, thrust_type='NEWTONS')

pyFlightscript.analysis module

pyFlightscript.analysis.analysis_boundaries(num_boundaries, boundaries_list)

Set the solver analysis boundaries.

This function appends a command to the script state to specify which boundaries are used in the solver analysis.

Return type:

None

Parameters:
  • num_boundaries (int) – The number of solver boundaries being enabled. Must be a positive integer.

  • boundaries_list (List[int]) – A list of solver boundary indices to be enabled. The length of this list must match num_boundaries.

Raises:

ValueError – If num_boundaries is not a positive integer, if boundaries_list is not a list of integers, or if the length of boundaries_list does not match num_boundaries.

Examples

>>> # Set boundaries 1, 2, 4, 5, and 7 for the analysis.
>>> analysis_boundaries(num_boundaries=5, boundaries_list=[1, 2, 4, 5, 7])
pyFlightscript.analysis.analysis_loads_frame(load_frame=1)

Set the loads frame for analysis.

This function appends a command to the script state to specify the coordinate system frame used for evaluating aerodynamic loads and moments.

Return type:

None

Parameters:

load_frame (int, optional) – The index of the coordinate system to be used for evaluating loads and moments. Defaults to 1.

Raises:

ValueError – If load_frame is not an integer.

Examples

>>> # Set the analysis loads frame to coordinate system 2
>>> analysis_loads_frame(load_frame=2)
>>> # Use the default loads frame
>>> analysis_loads_frame()
pyFlightscript.analysis.delete_vorticity_drag_boundaries()

Clears the vorticity induced-drag boundaries from the script state.

pyFlightscript.analysis.loads_and_moments_units(unit_type='NEWTONS')

Set the units for loads and moments in the analysis.

This function appends a command to the script state to specify the units used for evaluating aerodynamic loads and moments.

Return type:

None

Parameters:

unit_type (ValidForceUnits, optional) – The unit type for loads and moments. Can be one of ‘COEFFICIENTS’, ‘NEWTONS’, ‘KILO-NEWTONS’, ‘POUND-FORCE’, or ‘KILOGRAM-FORCE’. Defaults to ‘NEWTONS’.

Raises:

ValueError – If unit_type is not a valid force unit.

Examples

>>> # Set the loads and moments units to pound-force
>>> loads_and_moments_units(unit_type='POUND-FORCE')
>>> # Use the default units (Newtons)
>>> loads_and_moments_units()
pyFlightscript.analysis.scene_contour(variable=4)

Set the scene contour parameter for visualization.

This function appends a command to the script state to change the contour parameter displayed in the scene.

Return type:

None

Parameters:

variable (int, optional) –

The value corresponding to the desired contour parameter. Defaults to 4 (Vorticity).

  • 0: No contour

  • 1: X

  • 2: Y

  • 3: Z

  • 4: Vorticity

  • 5: Skin friction coefficient

  • 6: Area

  • 7: Boundary Mach Number

  • 8: Coefficient of pressure (Free-stream velocity)

  • 9: Mach Number

  • 10: Solver partition ID

  • 11: Separation marker

  • 12: Velocity X component

  • 13: Velocity Y component

  • 14: Velocity Z component

  • 15: Velocity magnitude

  • 16: Boundary layer displacement thickness

  • 17: Boundary layer streamline length

  • 18: Coefficient of pressure (reference velocity)

  • 19: Solver mesh quality

  • 20: Boundary layer transition marker

  • 21: Solver mesh stabilization

  • 22: Boundary layer momentum thickness

  • 23: Boundary layer momentum gradient

  • 24: Boundary layer shape factor

  • 25: Boundary layer stagnation marker

Raises:

ValueError – If variable is not a valid integer between 0 and 25.

Examples

>>> # Set the scene contour to display Mach Number
>>> scene_contour(variable=9)
>>> # Set the scene contour to display skin friction
>>> scene_contour(variable=5)
pyFlightscript.analysis.set_analysis_moments_model(model='PRESSURE')

Set the moments model used in the analysis.

This function appends a command to the script state to set the moments model to either ‘PRESSURE’ or ‘VORTICITY’.

Return type:

None

Parameters:

model (str, optional) – The moments model to be used. Must be either ‘PRESSURE’ or ‘VORTICITY’. Defaults to ‘PRESSURE’.

Raises:

ValueError – If model is not ‘PRESSURE’ or ‘VORTICITY’.

Examples

>>> # Set the moments model to VORTICITY
>>> set_analysis_moments_model(model='VORTICITY')
>>> # Set the moments model to PRESSURE (default)
>>> set_analysis_moments_model(model='PRESSURE')
pyFlightscript.analysis.set_analysis_symmetry_loads(enable)

Enable or disable including loads from symmetry boundaries in the analysis.

This function appends a command to the script state to control whether loads from symmetry boundaries are included in the analysis calculations.

Return type:

None

Parameters:

enable (bool) – If True, enables the inclusion of symmetry loads. If False, disables it.

Raises:

ValueError – If enable is not a boolean value.

Examples

>>> # Enable symmetry loads in the analysis
>>> set_analysis_symmetry_loads(enable=True)
>>> # Disable symmetry loads in the analysis
>>> set_analysis_symmetry_loads(enable=False)
pyFlightscript.analysis.set_inviscid_loads(enable)

Enable or disable the computation of inviscid loads and moments only.

This function appends a command to the script state to control whether the analysis should compute only inviscid loads and moments.

Return type:

None

Parameters:

enable (bool) – If True, enables the computation of inviscid loads and moments only. If False, disables it.

Raises:

ValueError – If enable is not a boolean value.

Examples

>>> # Enable inviscid loads and moments only
>>> set_inviscid_loads(enable=True)
>>> # Disable inviscid loads and moments only
>>> set_inviscid_loads(enable=False)
pyFlightscript.analysis.set_vorticity_drag_boundaries(num_boundaries, boundary_indices=None)

Set vorticity-based induced drag boundaries.

This function appends a command to the script state to define which boundaries are used for calculating vorticity-based induced drag.

Return type:

None

Parameters:
  • num_boundaries (int) – The number of boundaries to be added to the list. If -1, all boundaries are used.

  • boundary_indices (Optional[List[int]], optional) – A list of boundary indices to be used. This parameter is ignored if num_boundaries is -1. Defaults to None.

Raises:

ValueError – If num_boundaries is not an integer, or if boundary_indices is not a list of integers when required, or if its length does not match num_boundaries.

Examples

>>> # Set all boundaries for vorticity drag calculation
>>> set_vorticity_drag_boundaries(num_boundaries=-1)
>>> # Set specific boundaries for vorticity drag calculation
>>> set_vorticity_drag_boundaries(num_boundaries=3, boundary_indices=[1, 3, 5])
pyFlightscript.analysis.vorticity_lift_model(enable=True)

Enable or disable the vorticity lift model.

This function appends a command to the script state to set the lift model to vorticity mode.

Return type:

None

Parameters:

enable (bool, optional) – If True, enables the vorticity lift model. If False, disables it. Defaults to True.

Raises:

ValueError – If enable is not a boolean value.

Examples

>>> # Enable the vorticity lift model
>>> vorticity_lift_model(enable=True)
>>> # Disable the vorticity lift model
>>> vorticity_lift_model(enable=False)

pyFlightscript.base module

pyFlightscript.base.auto_detect_base_regions()

Appends lines to script state to auto-detect base regions on the geometry.

Examples

>>> #auto_detect_base_regions()
pyFlightscript.base.create_new_base_region(surface, base_type='EMPIRICAL', base_pressure_coefficient=-0.2)

Create a new base region.

This function appends a command to the script state to create a new base region with a specified surface, base type, and pressure coefficient.

Return type:

None

Parameters:
  • surface (int) – The index of the boundary surface to be marked as a base region boundary. Must be an integer greater than 0.

  • base_type (str, optional) – The type of base region calculation. Can be either ‘EMPIRICAL’ or ‘USER’. Defaults to ‘EMPIRICAL’.

  • base_pressure_coefficient (float, optional) – The pressure coefficient to be applied in the base regions. Defaults to -0.2.

Raises:

ValueError – If surface is not a positive integer, if base_type is not a valid base region type, or if base_pressure_coefficient is not a numeric value.

Examples

>>> # Create a new base region with default parameters
>>> create_new_base_region(surface=3)
>>> # Create a new base region with a constant base type
>>> create_new_base_region(surface=4, base_type='CONSTANT', base_pressure_coefficient=-0.15)
pyFlightscript.base.delete_base_region(base_region_index)

Delete an existing base region.

This function appends a command to the script state to delete an existing base region by its index.

Return type:

None

Parameters:

base_region_index (int) – The index of the base region to be deleted. Must be a positive integer.

Raises:

ValueError – If base_region_index is not an integer greater than 0.

Examples

>>> # Delete the base region with index 2
>>> delete_base_region(base_region_index=2)
pyFlightscript.base.detect_base_regions_by_surface(boundary_index=1)

Detect base regions by surface index.

This function appends a command to the script state to detect base regions using a specified mesh boundary index.

Return type:

None

Parameters:

boundary_index (int, optional) – The index of the mesh boundary to use for marking base regions. Must be a positive integer. Defaults to 1.

Raises:

ValueError – If boundary_index is not an integer greater than 0.

Examples

>>> # Detect base regions using boundary index 2
>>> detect_base_regions_by_surface(boundary_index=2)
>>> # Detect base regions using the default boundary index
>>> detect_base_regions_by_surface()
pyFlightscript.base.select_base_region(base_region_index)

Select an existing base region.

This function appends a command to the script state to select the faces of an existing base region by its index.

Return type:

None

Parameters:

base_region_index (int) – The index of the base region to be selected. Must be a positive integer.

Raises:

ValueError – If base_region_index is not an integer greater than 0.

Examples

>>> # Select the base region with index 2
>>> select_base_region(base_region_index=2)
pyFlightscript.base.set_base_region_trailing_edges(base_region_boundary=-1)

Set base region trailing edges.

This function appends a command to the script state to set the trailing edges for a specified base region boundary.

Return type:

None

Parameters:

base_region_boundary (int, optional) – The index of the base region boundary to use for marking trailing edges. A value of -1 indicates all base region boundaries. Must not be 0. Defaults to -1.

Raises:

ValueError – If base_region_boundary is not an integer or is equal to 0.

Examples

>>> # Set trailing edges for base region boundary 3
>>> set_base_region_trailing_edges(base_region_boundary=3)
>>> # Set trailing edges for all base region boundaries
>>> set_base_region_trailing_edges()

pyFlightscript.boundary_layer module

pyFlightscript.boundary_layer.delete_transition_trip(transition_trip_index)

Delete an existing transition trip edge set.

This function appends a command to the script state to delete an existing boundary layer transition trip by its index.

Return type:

None

Parameters:

transition_trip_index (int) – The index of the boundary layer transition trip edges to be deleted. Must be a positive integer.

Raises:

ValueError – If transition_trip_index is not an integer greater than 0.

Examples

>>> # Delete the transition trip with index 2
>>> delete_transition_trip(transition_trip_index=2)

pyFlightscript.cad module

pyFlightscript.cad.cad_create_auto_annular_cross_sections(frame=1, sections=20, body_index=1)

Create a series of automatic annular cross-sections.

This function appends a command to the script state to create a series of automatic annular cross-sections from a specified mesh body.

Return type:

None

Parameters:
  • frame (int, optional) – Index of the coordinate system to be used. Defaults to 1.

  • sections (int, optional) – Number of cross-sections to create (> 1). Defaults to 20.

  • body_index (int, optional) – Index of the mesh body to use for creating cross-sections. Defaults to 1.

Raises:

ValueError – If frame, sections, or body_index are not valid integers.

Examples

>>> # Create default annular cross-sections
>>> cad_create_auto_annular_cross_sections()
>>> # Create 30 annular cross-sections for body index 2
>>> cad_create_auto_annular_cross_sections(sections=30, body_index=2)
pyFlightscript.cad.cad_create_auto_cross_sections(frame=1, axis='Y', sections=20, body_index=1, growth_scheme=3, growth_rate=1.2, symmetry='NONE', cad_mesh='MESH')

Create automatic cross-sections from a mesh or CAD body.

This function appends a command to the script state to create a series of automatic cross-sections from a specified mesh or CAD body.

Return type:

None

Parameters:
  • frame (int, optional) – Index of the coordinate system to be used. Defaults to 1.

  • axis (ValidAxis, optional) – Sweep direction for creating cross-section curves (‘X’, ‘Y’, ‘Z’). Defaults to ‘Y’.

  • sections (int, optional) – Number of cross-sections to create (> 1). Defaults to 20.

  • body_index (int, optional) – Index of the mesh or CAD body to use. Defaults to 1.

  • growth_scheme (ValidGrowthScheme, optional) – Clustering scheme for positioning cross-sections. 1: Uniform, 2: Successive, 3: Dual-successive, 4: Reverse-successive. Defaults to 3.

  • growth_rate (float, optional) – Growth rate for the selected growth scheme. Defaults to 1.2.

  • symmetry (ValidSymmetry, optional) – Symmetry plane (‘XY’, ‘XZ’, ‘YZ’) for half-sections, or ‘NONE’ for full sections. Defaults to ‘NONE’.

  • cad_mesh (ValidCadMesh, optional) – Specifies whether to use the ‘CAD’ or ‘MESH’ body. Defaults to ‘MESH’.

Raises:

ValueError – If any of the input parameters are invalid.

Examples

>>> # Create default automatic cross-sections
>>> cad_create_auto_cross_sections()
>>> # Create 50 cross-sections along the X-axis with uniform growth
>>> cad_create_auto_cross_sections(
...     axis='X', sections=50, growth_scheme=1, growth_rate=1.0
... )
pyFlightscript.cad.cad_create_cross_section(frame=1, plane='XZ', offset=0.0, body_index=1, quadrant=3)

Create a cross-section from an existing mesh body.

This function appends a command to the script state to create a cross-section from an existing mesh body with specified parameters.

Return type:

None

Parameters:
  • frame (int, optional) – Index of the coordinate system to be used. Defaults to 1.

  • plane (ValidPlanes, optional) – Plane of the coordinate system for slicing (‘XY’, ‘XZ’, ‘YZ’). Defaults to ‘XZ’.

  • offset (float, optional) – Offset distance of the plane along its normal axis. Defaults to 0.0.

  • body_index (int, optional) – Index of the mesh body to use for creating the cross-section. Defaults to 1.

  • quadrant (ValidQuadrant, optional) – Quadrant information for creating the cross-section. - YZ plane: 1 (+Y), 2 (-Y), 3 (+Z), 4 (-Z) - XZ plane: 1 (+X), 2 (-X), 3 (+Z), 4 (-Z) - XY plane: 1 (+X), 2 (-X), 3 (+Y), 4 (-Y) Defaults to 3.

Raises:

ValueError – If any of the input parameters are invalid.

Examples

>>> # Create a default cross-section
>>> cad_create_cross_section()
>>> # Create a cross-section on the YZ plane with a specific offset
>>> cad_create_cross_section(plane='YZ', offset=5.0, quadrant=1)
pyFlightscript.cad.cad_create_curve_arc(x0=0.0, y0=0.0, z0=0.0, x1=-1.0, y1=0.0, z1=0.0, x2=0.0, y2=1.0, z2=0.0)

Create a circular arc curve in 3D space.

This function appends a command to the script state to create a circular arc curve defined by an origin, a first vertex, and a second vertex.

Return type:

None

Parameters:
  • x0 (float, optional) – Coordinates of the origin of the circular arc. Defaults to (0.0, 0.0, 0.0).

  • y0 (float, optional) – Coordinates of the origin of the circular arc. Defaults to (0.0, 0.0, 0.0).

  • z0 (float, optional) – Coordinates of the origin of the circular arc. Defaults to (0.0, 0.0, 0.0).

  • x1 (float, optional) – Coordinates of the first vertex of the circular arc. Defaults to (-1.0, 0.0, 0.0).

  • y1 (float, optional) – Coordinates of the first vertex of the circular arc. Defaults to (-1.0, 0.0, 0.0).

  • z1 (float, optional) – Coordinates of the first vertex of the circular arc. Defaults to (-1.0, 0.0, 0.0).

  • x2 (float, optional) – Coordinates of the second vertex of the circular arc. Defaults to (0.0, 1.0, 0.0).

  • y2 (float, optional) – Coordinates of the second vertex of the circular arc. Defaults to (0.0, 1.0, 0.0).

  • z2 (float, optional) – Coordinates of the second vertex of the circular arc. Defaults to (0.0, 1.0, 0.0).

Raises:

ValueError – If any of the coordinates are not numeric values.

Examples

>>> # Create a default circular arc
>>> cad_create_curve_arc()
>>> # Create a custom circular arc
>>> cad_create_curve_arc(
...     x0=1, y0=1, z0=0,
...     x1=2, y1=1, z1=0,
...     x2=1, y2=2, z2=0
... )
pyFlightscript.cad.cad_create_curve_delete_all()

Delete all CAD->Create drawing curves.

This function appends a command to the script state to delete all existing CAD->Create drawing curves.

Return type:

None

Examples

>>> # Delete all drawing curves
>>> cad_create_curve_delete_all()
pyFlightscript.cad.cad_create_curve_delete_selected()

Delete selected CAD->Create drawing curves.

This function appends a command to the script state to delete only the selected CAD->Create drawing curves.

Return type:

None

Examples

>>> # Delete all selected drawing curves
>>> cad_create_curve_delete_selected()
pyFlightscript.cad.cad_create_curve_delete_unselected()

Delete unselected CAD->Create drawing curves.

This function appends a command to the script state to delete only the unselected CAD->Create drawing curves.

Return type:

None

Examples

>>> # Delete all unselected drawing curves
>>> cad_create_curve_delete_unselected()
pyFlightscript.cad.cad_create_curve_export_ccs(file_path)

Export selected CAD->Create drawing curves to a CCS file.

This function appends a command to the script state to export the selected CAD->Create drawing curves to a specified CCS file.

Return type:

None

Parameters:

file_path (str) – The absolute path to the output CCS file.

Raises:

ValueError – If file_path is not a string.

Examples

>>> # Export selected curves to a file
>>> cad_create_curve_export_ccs(file_path='C:/path/to/exported_curves.ccs')
pyFlightscript.cad.cad_create_curve_reverse(curve_index=1)

Reverse a CAD->Create drawing curve.

This function appends a command to the script state to reverse the direction of a specified CAD->Create drawing curve.

Return type:

None

Parameters:

curve_index (int, optional) – The index of the drawing curve to be reversed. A value of -1 reverses all curves. Defaults to 1.

Raises:

ValueError – If curve_index is not an integer.

Examples

>>> # Reverse curve with index 2
>>> cad_create_curve_reverse(curve_index=2)
>>> # Reverse all curves
>>> cad_create_curve_reverse(curve_index=-1)
pyFlightscript.cad.cad_create_curve_select(curve_index=1)

Select a CAD->Create drawing curve.

This function appends a command to the script state to select one or all of the CAD->Create drawing curves.

Return type:

None

Parameters:

curve_index (int, optional) – The index of the drawing curve to be selected. A value of -1 selects all curves. Must be a non-zero integer. Defaults to 1.

Raises:

ValueError – If curve_index is 0.

Examples

>>> # Select curve with index 2
>>> cad_create_curve_select(curve_index=2)
>>> # Select all curves
>>> cad_create_curve_select(curve_index=-1)
pyFlightscript.cad.cad_create_curve_unselect(curve_index=1)

Unselect a CAD->Create drawing curve.

This function appends a command to the script state to unselect one or all of the CAD->Create drawing curves.

Return type:

None

Parameters:

curve_index (int, optional) – The index of the drawing curve to be unselected. A value of -1 unselects all curves. Must be a non-zero integer. Defaults to 1.

Raises:

ValueError – If curve_index is 0.

Examples

>>> # Unselect curve with index 1
>>> cad_create_curve_unselect(curve_index=1)
>>> # Unselect all curves
>>> cad_create_curve_unselect(curve_index=-1)
pyFlightscript.cad.cad_create_import_ccs(ccs_filepath)

Import a CAD->Create drawing curve from a CCS file.

This function appends a command to the script state to import a drawing curve from a specified CCS (Curve-Curve-Section) file.

Return type:

None

Parameters:

ccs_filepath (str) – The absolute path to the CCS file to import.

Raises:

FileNotFoundError – If ccs_filepath does not exist.

Examples

>>> # Import a curve from a CCS file
>>> cad_create_import_ccs(ccs_filepath='C:/path/to/curve.ccs')
pyFlightscript.cad.cad_create_import_curve_txt(txt_filepath, units='METER', dimension='2D', frame=1, plane='YZ')

Import a CAD->Create drawing curve from a text file.

This function appends a command to the script state to import a drawing curve from a specified text file with given parameters.

Return type:

None

Parameters:
  • txt_filepath (str) – The absolute path to the text file to import.

  • units (ValidUnits, optional) – The units for the imported curve. Defaults to ‘METER’.

  • dimension (ValidDimensions, optional) – The dimension of the curve, either ‘2D’ or ‘3D’. Defaults to ‘2D’.

  • frame (int, optional) – The coordinate system frame index. Defaults to 1.

  • plane (ValidPlanes, optional) – The plane orientation for 2D curves (‘XY’, ‘XZ’, ‘YZ’). Defaults to ‘YZ’.

Raises:
  • FileNotFoundError – If txt_filepath does not exist.

  • ValueError – If units, dimension, or plane are not valid options, or if frame is not a positive integer.

Examples

>>> # Import a 2D curve from a text file with default parameters
>>> cad_create_import_curve_txt(txt_filepath='C:/path/to/curve.txt')
>>> # Import a 3D curve with specified units
>>> cad_create_import_curve_txt(
...     txt_filepath='C:/path/to/3d_curve.txt',
...     units='INCH',
...     dimension='3D'
... )
pyFlightscript.cad.cad_create_initialize(model_index=1)

Initialize the CAD->Create pane window.

This function appends a command to the script state to initialize the CAD->Create pane window and link it to a specified model index.

Return type:

None

Parameters:

model_index (int, optional) – The model index to which the CAD->Create pane is linked. Defaults to 1.

Raises:

ValueError – If model_index is not a positive integer.

Examples

>>> # Initialize the CAD->Create pane for model index 2
>>> cad_create_initialize(model_index=2)
>>> # Initialize the CAD->Create pane with the default model index
>>> cad_create_initialize()
pyFlightscript.cad.cad_create_point_curve(x=0.0, y=1.0, z=0.0)

Create a singular point curve in 3D space.

This function appends a command to the script state to create a single point curve at the specified 3D coordinates.

Return type:

None

Parameters:
  • x (float, optional) – The X-coordinate of the point curve. Defaults to 0.0.

  • y (float, optional) – The Y-coordinate of the point curve. Defaults to 1.0.

  • z (float, optional) – The Z-coordinate of the point curve. Defaults to 0.0.

Raises:

ValueError – If any of the coordinates are not numeric values.

Examples

>>> # Create a point curve at the default coordinates
>>> cad_create_point_curve()
>>> # Create a point curve at a custom location
>>> cad_create_point_curve(x=10.5, y=-5.2, z=2.0)
pyFlightscript.cad.cad_import_cad(cad_filepath)

Import a CAD geometry into the simulation.

This function appends a command to the script state to import a CAD geometry from a specified file path.

Return type:

None

Parameters:

cad_filepath (str) – The absolute path to the CAD file.

Raises:

FileNotFoundError – If cad_filepath does not exist.

Examples

>>> # Import a CAD file
>>> cad_import_cad(cad_filepath='C:/path/to/geometry.igs')
pyFlightscript.cad.convert_cad_to_mesh(model_index)

Transfer a CAD model mesh to the Mesh node of the simulation.

This function appends a command to the script state to transfer the mesh of a specified CAD model to the Mesh node of the simulation.

Return type:

None

Parameters:

model_index (int) – The index of the CAD model to be transferred. Must be a positive integer.

Raises:

ValueError – If model_index is not a positive integer.

Examples

>>> # Convert CAD model with index 1 to a mesh
>>> convert_cad_to_mesh(model_index=1)

pyFlightscript.csys module

pyFlightscript.csys.create_new_coordinate_system()

Create a new coordinate system.

This function appends a command to the script state to create a new local coordinate system.

Return type:

None

Examples

>>> # Create a new local coordinate system
>>> create_new_coordinate_system()
pyFlightscript.csys.delete_coordinate_system(frame)

Delete a coordinate system.

This function appends a command to the script state to delete a specified local coordinate system.

Return type:

None

Parameters:

frame (int) – Index of the local coordinate system to be deleted. Must be > 1.

Raises:

ValueError – If frame is not an integer greater than 1.

Examples

>>> # Delete coordinate system 2
>>> delete_coordinate_system(frame=2)
pyFlightscript.csys.duplicate_coordinate_system(frame)

Duplicate a local coordinate system.

This function appends a command to the script state to duplicate a specified local coordinate system.

Return type:

None

Parameters:

frame (int) – Index of the local coordinate system to be duplicated. Must be > 1.

Raises:

ValueError – If frame is not an integer greater than 1.

Examples

>>> # Duplicate coordinate system 2
>>> duplicate_coordinate_system(frame=2)
pyFlightscript.csys.edit_coordinate_system(frame, name, origin_x, origin_y, origin_z, vector_x_x, vector_x_y, vector_x_z, vector_y_x, vector_y_y, vector_y_z, vector_z_x, vector_z_y, vector_z_z)

Edit a local coordinate system.

This function appends a command to the script state to modify an existing local coordinate system’s properties, including its name, origin, and axis vectors.

Return type:

None

Parameters:
  • frame (int) – Index of the local coordinate system to edit. Must be > 1.

  • name (str) – New name for the coordinate system.

  • origin_x (float) – Coordinates of the new origin.

  • origin_y (float) – Coordinates of the new origin.

  • origin_z (float) – Coordinates of the new origin.

  • vector_x_x (float) – Components of the new X-axis vector.

  • vector_x_y (float) – Components of the new X-axis vector.

  • vector_x_z (float) – Components of the new X-axis vector.

  • vector_y_x (float) – Components of the new Y-axis vector.

  • vector_y_y (float) – Components of the new Y-axis vector.

  • vector_y_z (float) – Components of the new Y-axis vector.

  • vector_z_x (float) – Components of the new Z-axis vector.

  • vector_z_y (float) – Components of the new Z-axis vector.

  • vector_z_z (float) – Components of the new Z-axis vector.

Raises:

ValueError – If frame is not an integer greater than 1, or if any coordinate or vector component is not a numeric value.

Examples

>>> # Edit coordinate system 2
>>> edit_coordinate_system(
...     frame=2, name="Prop-1",
...     origin_x=0, origin_y=1, origin_z=0.5,
...     vector_x_x=1, vector_x_y=0, vector_x_z=0,
...     vector_y_x=0, vector_y_y=-1, vector_y_z=0,
...     vector_z_x=0, vector_z_y=0, vector_z_z=-1.2
... )
pyFlightscript.csys.mirror_coordinate_system(frame, plane='XZ')

Mirror a local coordinate system.

This function appends a command to the script state to duplicate and mirror a local coordinate system across a specified plane of the reference coordinate system.

Return type:

None

Parameters:
  • frame (int) – Index of the local coordinate system to be mirrored. Must be > 1.

  • plane (ValidPlanes, optional) – The plane of the reference coordinate system to be used for mirroring (‘XY’, ‘XZ’, ‘YZ’). Defaults to ‘XZ’.

Raises:

ValueError – If frame is not an integer greater than 1, or if plane is invalid.

Examples

>>> # Mirror coordinate system 2 across the XZ plane
>>> mirror_coordinate_system(frame=2)
>>> # Mirror coordinate system 3 across the YZ plane
>>> mirror_coordinate_system(frame=3, plane='YZ')
pyFlightscript.csys.normalize_coordinate_system(coord_system_index=1)

Normalize a coordinate system.

This function appends a command to the script state to normalize the axes of a specified local coordinate system.

Return type:

None

Parameters:

coord_system_index (int, optional) – The index of the local coordinate system to normalize. Must be a positive integer. Defaults to 1.

Raises:

ValueError – If coord_system_index is not a positive integer.

Examples

>>> # Normalize coordinate system 2
>>> normalize_coordinate_system(coord_system_index=2)
pyFlightscript.csys.rotate_coordinate_system(frame=2, rotation_frame=3, rotation_axis='Y', angle=-45.0)

Rotate a coordinate system.

This function appends a command to the script state to rotate a local coordinate system around a specified axis of another coordinate system.

Return type:

None

Parameters:
  • frame (int, optional) – Index of the local coordinate system to be rotated. Defaults to 2.

  • rotation_frame (int, optional) – Index of the local coordinate system to be used for the rotation. Defaults to 3.

  • rotation_axis (ValidRotationAxis, optional) – The axis of rotation (‘X’, ‘Y’, ‘Z’, ‘1’, ‘2’, or ‘3’). Defaults to ‘Y’.

  • angle (float, optional) – The rotation angle in degrees. Defaults to -45.0.

Raises:

ValueError – If frame or rotation_frame are not integers, if rotation_axis is invalid, or if angle is not a numeric value.

Examples

>>> # Rotate coordinate system 2 around the Y-axis of system 3 by -45 degrees
>>> rotate_coordinate_system()
pyFlightscript.csys.set_coordinate_system_axis(frame, axis, nx, ny, nz, normalize_frame=True)

Set an axis of an existing local coordinate system.

This function appends a command to the script state to set a specified axis of an existing local coordinate system with a new vector.

Return type:

None

Parameters:
  • frame (int) – Index of the local coordinate system. Must be an integer > 1.

  • axis (ValidAxis) – The axis to set (‘X’, ‘Y’, or ‘Z’).

  • nx (float) – Components of the new axis vector.

  • ny (float) – Components of the new axis vector.

  • nz (float) – Components of the new axis vector.

  • normalize_frame (bool, optional) – If True, automatically normalizes all axes of the coordinate system after the update. Defaults to True.

Raises:

ValueError – If frame is not an integer greater than 1, if axis is invalid, if vector components are not numeric, or if normalize_frame is not a boolean.

Examples

>>> # Set the X-axis of coordinate system 2
>>> set_coordinate_system_axis(frame=2, axis='X', nx=-1.0, ny=0.5, nz=0.0)
pyFlightscript.csys.set_coordinate_system_name(frame, name)

Set the name of an existing local coordinate system.

This function appends a command to the script state to change the name of a specified local coordinate system.

Return type:

None

Parameters:
  • frame (int) – Index of the local coordinate system. Must be an integer > 1.

  • name (str) – The new name for the coordinate system.

Raises:

ValueError – If frame is not an integer greater than 1, or if name is not a string.

Examples

>>> # Set the name of coordinate system 2 to "Propeller_Axis"
>>> set_coordinate_system_name(frame=2, name='Propeller_Axis')
pyFlightscript.csys.set_coordinate_system_origin(frame, x, y, z, units='INCH')

Set the origin of an existing local coordinate system.

This function appends a command to the script state to set the origin of a specified local coordinate system relative to the reference coordinate system.

Return type:

None

Parameters:
  • frame (int) – Index of the local coordinate system. Must be an integer > 1.

  • x (float) – The new origin coordinates.

  • y (float) – The new origin coordinates.

  • z (float) – The new origin coordinates.

  • units (ValidUnits, optional) – The units for the position values. Defaults to ‘INCH’.

Raises:

ValueError – If frame is not an integer greater than 1, if coordinates are not numeric, or if units is invalid.

Examples

>>> # Set the origin of coordinate system 2 to (0, 1, 1.4) in inches
>>> set_coordinate_system_origin(frame=2, x=0.0, y=1.0, z=1.4, units='INCH')
pyFlightscript.csys.translate_coordinate_system(frame, x, y, z, units='METER')

Translate a coordinate system.

This function appends a command to the script state to translate a local coordinate system by a specified vector.

Return type:

None

Parameters:
  • frame (int) – Index of the local coordinate system to translate. Must be > 1.

  • x (float) – Components of the translation vector.

  • y (float) – Components of the translation vector.

  • z (float) – Components of the translation vector.

  • units (ValidUnits, optional) – The units for the translation vector. Defaults to ‘METER’.

Raises:

ValueError – If frame is not an integer greater than 1, if translation components are not numeric, or if units is invalid.

Examples

>>> # Translate coordinate system 2 by (0, 1, 1.4) in inches
>>> translate_coordinate_system(frame=2, x=0.0, y=1.0, z=1.4, units='INCH')

pyFlightscript.exec_solver module

pyFlightscript.exec_solver.clear_solution()

Clear the existing solution.

This function appends a command to the script state to clear the current solution data.

Return type:

None

Examples

>>> # Clear the solution
>>> clear_solution()
pyFlightscript.exec_solver.close_flightstream()

Appends lines to script state to close FlightStream and exit.

This function appends a command to the script state to close FlightStream and exit the application.

Return type:

None

Examples

>>> # Close FlightStream and exit
>>> close_flightstream()
pyFlightscript.exec_solver.start_solver()

Start the solver.

This function appends a command to the script state to begin the solver execution.

Return type:

None

Examples

>>> # Start the solver
>>> start_solver()

pyFlightscript.export_data module

pyFlightscript.export_data.export_solver_analysis_csv(file_path, format_value='PRESSURE', units='PASCALS', surfaces=-1, frame=1, boundary_indices=None)

Export FEM CSV data based on solver results.

This function appends a command to the script state to export FEM CSV data with specified formatting and units for selected boundaries.

Return type:

None

Parameters:
  • file_path (str) – The absolute path to the output CSV file.

  • format_value (ValidExportFormat, optional) – The format of the export data. Defaults to ‘PRESSURE’.

  • units (ValidPressureUnits, optional) – The units for the exported pressure data. Defaults to ‘PASCALS’.

  • surfaces (int, optional) – The number of boundaries to export. Use -1 for all boundaries. Defaults to -1.

  • frame (int, optional) – The coordinate system frame index. Defaults to 1.

  • boundary_indices (Optional[List[int]], optional) – A list of boundary indices to export. Required if surfaces is not -1. Defaults to None.

Raises:

ValueError – If format_value or units are invalid, or if surfaces is not -1 and boundary_indices is not provided or its length mismatches.

Examples

>>> # Export the FEM CSV file for the first three boundaries
>>> export_solver_analysis_csv(
...     file_path='C:/path/to/data.csv',
...     surfaces=3,
...     boundary_indices=[1, 2, 3]
... )
pyFlightscript.export_data.export_solver_analysis_force_distributions(output_filepath, surfaces=-1, boundary_indices=None)

Export force distribution vectors based on solver results.

This function appends a command to the script state to export the force distribution vectors for specified boundaries.

Return type:

None

Parameters:
  • output_filepath (str) – The absolute path to the output data file.

  • surfaces (int, optional) – The number of boundaries to export. Use -1 for all boundaries. Defaults to -1.

  • boundary_indices (Optional[List[int]], optional) – A list of boundary indices to export. Required if surfaces is not -1. Defaults to None.

Raises:

ValueError – If surfaces is not an integer, or if surfaces is not -1 and boundary_indices is not provided or its length mismatches.

Examples

>>> # Export force distributions for three specified boundaries
>>> export_solver_analysis_force_distributions(
...     output_filepath='C:/path/to/force_data.txt',
...     surfaces=3,
...     boundary_indices=[1, 2, 3]
... )
pyFlightscript.export_data.export_solver_analysis_pload_bdf(file_path, surfaces=-1, boundary_indices=None)

Export NASTRAN PLOAD BDF data based on solver results.

This function appends a command to the script state to export a NASTRAN PLOAD BDF file for specified boundaries.

Return type:

None

Parameters:
  • file_path (str) – The absolute path to the output BDF file.

  • surfaces (int, optional) – The number of boundaries to export. Use -1 for all boundaries. Defaults to -1.

  • boundary_indices (Optional[List[int]], optional) – A list of boundary indices to export. Required if surfaces is not -1. Defaults to None.

Raises:

ValueError – If surfaces is not an integer, or if surfaces is not -1 and boundary_indices is not provided or its length mismatches.

Examples

>>> # Export the NASTRAN PLOAD BDF file for the first three boundaries
>>> export_solver_analysis_pload_bdf(
...     file_path='C:/path/to/data.bdf',
...     surfaces=3,
...     boundary_indices=[1, 2, 3]
... )
pyFlightscript.export_data.export_solver_analysis_spreadsheet(output_file)

Export aerodynamic results to a spreadsheet file.

This function appends a command to the script state to export the aerodynamic results to a specified output file.

Return type:

None

Parameters:

output_file (str) – The absolute path to the output file where the aerodynamic results will be stored.

Raises:

ValueError – If output_file is not a string representing a valid file path.

Examples

>>> # Export aerodynamic results to a text file
>>> export_solver_analysis_spreadsheet(
...     output_file='C:/path/to/results.txt'
... )
pyFlightscript.export_data.export_solver_analysis_tecplot(output_file)

Export Tecplot data based on solver results.

This function appends a command to the script state to export Tecplot data for all initialized boundaries to a specified file.

Return type:

None

Parameters:

output_file (str) – The absolute path to the output file where the Tecplot data will be stored.

Raises:

ValueError – If output_file is not a string representing a valid file path.

Examples

>>> # Export Tecplot data to a .dat file
>>> export_solver_analysis_tecplot(
...     output_file='C:/path/to/tecplot_data.dat'
... )
pyFlightscript.export_data.export_solver_analysis_vtk(output_filepath, surfaces, boundaries=None)

Export a Visualization Toolkit (VTK) file based on solver results.

This function appends a command to the script state to export a VTK file for specified boundaries based on the solver results.

Return type:

None

Parameters:
  • output_filepath (str) – The absolute path to the output VTK file.

  • surfaces (int) – The number of boundaries to export. Use -1 to export all boundaries.

  • boundaries (Optional[List[int]], optional) – A list of boundary indices to be exported. Required if surfaces is not -1. Defaults to None.

Raises:

ValueError – If surfaces is not -1 and boundaries is not provided, or if the length of boundaries does not match surfaces.

Examples

>>> # Export the first two solver boundaries to a VTK file
>>> export_solver_analysis_vtk(
...     output_filepath='C:/path/to/data.vtk',
...     surfaces=2,
...     boundaries=[1, 2]
... )
>>> # Export all solver boundaries to a VTK file
>>> export_solver_analysis_vtk(
...     output_filepath='C:/path/to/all_data.vtk',
...     surfaces=-1
... )
pyFlightscript.export_data.set_vtk_export_variables(num_variables, export_wake, variables=None)

Set the variables to be exported in the VTK file.

This function appends a command to the script state to configure the variables that will be included in the VTK export.

Return type:

None

Parameters:
  • num_variables (int) – The number of variables to be exported. Use -1 to export all available variables.

  • export_wake (RunOptions) – Option to export wake filaments to the VTK file (‘ENABLE’ or ‘DISABLE’).

  • variables (Optional[List[str]], optional) – A list of specific variable names to be exported. Required if num_variables is not -1. Defaults to None.

Raises:

ValueError – If export_wake is not a valid option, if num_variables is not an integer, or if variables is not provided when required.

Examples

>>> # Set a custom list of export variables for the VTK file
>>> set_vtk_export_variables(
...     num_variables=5,
...     export_wake='DISABLE',
...     variables=['X', 'Y', 'Z', 'CP', 'PSTATIC']
... )
>>> # Set all variables for export in the VTK file
>>> set_vtk_export_variables(num_variables=-1, export_wake='ENABLE')

pyFlightscript.freestream module

pyFlightscript.freestream.air_altitude(altitude=15000.0)

Set fluid (air) properties based on altitude.

This function appends a command to the script state to set the fluid properties corresponding to a specified altitude in feet, based on standard atmospheric models.

Return type:

None

Parameters:

altitude (float, optional) – The altitude in feet. Defaults to 15000.0.

Raises:

ValueError – If altitude is not a numeric value.

Examples

>>> # Set air properties for an altitude of 15,000 feet
>>> air_altitude()
>>> # Set air properties for sea level
>>> air_altitude(altitude=0)
pyFlightscript.freestream.fluid_properties(density=1.225, pressure=101325.0, sonic_velocity=340.0, temperature=288.15, viscosity=1.789e-05)

Set the fluid properties.

This function appends a command to the script state to define the properties of the fluid for the simulation.

Return type:

None

Parameters:
  • density (float, optional) – Density of the fluid in kg/m^3. Defaults to 1.225.

  • pressure (float, optional) – Static pressure of the fluid in Pa. Defaults to 101325.0.

  • sonic_velocity (float, optional) – Sonic velocity in the fluid in m/sec. Defaults to 340.0.

  • temperature (float, optional) – Temperature of the fluid in Kelvin. Defaults to 288.15.

  • viscosity (float, optional) – Viscosity of the fluid in Pa-sec. Defaults to 1.789e-5.

Raises:

ValueError – If any of the properties are not numeric values.

Examples

>>> # Set fluid properties with default values
>>> fluid_properties()
>>> # Set custom fluid properties
>>> fluid_properties(density=1.2, pressure=101000, sonic_velocity=343)
pyFlightscript.freestream.set_freestream(freestream_type, profile_path=None, frame=None, axis=None, angular_velocity=None)

Set the freestream velocity type.

This function appends a command to the script state to configure the freestream velocity, which can be constant, custom from a file, or rotational.

Return type:

None

Parameters:
  • freestream_type (ValidFreestreamType) – The type of freestream (‘CONSTANT’, ‘CUSTOM’, or ‘ROTATION’).

  • profile_path (Optional[str], optional) – The absolute path to a custom velocity profile file. Required if freestream_type is ‘CUSTOM’. Defaults to None.

  • frame (Optional[int], optional) – The index of the coordinate system for defining rotation. Required if freestream_type is ‘ROTATION’. Defaults to None.

  • axis (Optional[ValidAxis], optional) – The axis of rotation (‘X’, ‘Y’, or ‘Z’). Required if freestream_type is ‘ROTATION’. Defaults to None.

  • angular_velocity (Optional[float], optional) – The rotational velocity in rad/sec. Required if freestream_type is ‘ROTATION’. Defaults to None.

Raises:

ValueError – If freestream_type is invalid, or if required parameters for a given type are missing or have incorrect types.

Examples

>>> # Set a constant freestream velocity
>>> set_freestream(freestream_type='CONSTANT')
>>> # Set a custom freestream velocity from a profile file
>>> set_freestream(
...     freestream_type='CUSTOM',
...     profile_path='C:/path/to/profile.txt'
... )
>>> # Set a rotational freestream velocity
>>> set_freestream(
...     freestream_type='ROTATION',
...     frame=1,
...     axis='X',
...     angular_velocity=-0.2
... )

pyFlightscript.fsinit module

pyFlightscript.fsinit.new_simulation()

Create a new simulation.

This function appends a command to the script state to initialize a new, empty simulation.

Return type:

None

Examples

>>> # Start a new simulation
>>> new_simulation()
pyFlightscript.fsinit.open_fsm(fsm_filepath, reset_parallel_cores='DISABLE', load_solver_initialization='ENABLE')

Open a FlightStream file.

This function appends a command to the script state to open a FlightStream (.fsm) file with specified options.

Return type:

None

Parameters:
  • fsm_filepath (str) – The absolute path to the FlightStream file to open.

  • reset_parallel_cores (RunOptions, optional) – ‘ENABLE’ to reset the parallel core count, ‘DISABLE’ to use the existing setting. Defaults to ‘DISABLE’.

  • load_solver_initialization (RunOptions, optional) – ‘ENABLE’ to load solver initialization data from the file, ‘DISABLE’ to skip. Defaults to ‘ENABLE’.

Raises:
  • FileNotFoundError – If fsm_filepath does not exist.

  • ValueError – If reset_parallel_cores or load_solver_initialization are not valid RunOptions.

Examples

>>> # Open a FlightStream file with default settings
>>> open_fsm(fsm_filepath='C:/path/to/simulation.fsm')
>>> # Open a file and reset the parallel core count
>>> open_fsm(
...     fsm_filepath='C:/path/to/simulation.fsm',
...     reset_parallel_cores='ENABLE'
... )
pyFlightscript.fsinit.print_message(message='Hello from FlightStream!')

Print a user-defined message to the log.

This function appends a command to the script state to print a specified message to the FlightStream log file.

Return type:

None

Parameters:

message (str, optional) – The message to be printed in the log. Defaults to “Hello from FlightStream!”.

Examples

>>> # Print a custom message to the log
>>> print_message(message="Starting simulation phase 1.")
pyFlightscript.fsinit.run_script(script_filepath)

Run a script from within another script.

This function appends a command to the script state to execute another script file.

Return type:

None

Parameters:

script_filepath (str) – The absolute path to the script file to be executed.

Raises:

FileNotFoundError – If script_filepath does not exist.

Examples

>>> # Run another script
>>> run_script(script_filepath='C:/path/to/another_script.txt')
pyFlightscript.fsinit.save_as_fsm(fsm_filepath)

Save the current simulation to a FlightStream file.

This function appends a command to the script state to save the current simulation state to a specified .fsm file.

Return type:

None

Parameters:

fsm_filepath (str) – The absolute path where the simulation file will be saved.

Examples

>>> # Save the simulation to a file
>>> save_as_fsm(fsm_filepath='C:/path/to/new_simulation.fsm')
pyFlightscript.fsinit.set_base_region_bending_angle(angle=25.0)

Set the base region bending angle.

This function appends a command to the script state to set the bending angle used for identifying base regions.

Return type:

None

Parameters:

angle (float, optional) – The desired base region bending angle in degrees. Must be between 0 and 90. Defaults to 25.0.

Raises:

ValueError – If the angle is not a numeric value or is outside the valid range [0, 90].

Examples

>>> # Set the base region bending angle to 30 degrees
>>> set_base_region_bending_angle(angle=30.0)
pyFlightscript.fsinit.set_significant_digits(digits=5)

Set the number of significant digits for output.

This function appends a command to the script state to set the number of significant digits used in output files.

Return type:

None

Parameters:

digits (int, optional) – The number of significant digits. Defaults to 5.

Raises:

ValueError – If digits is not a positive integer.

Examples

>>> # Set the significant digits to 7
>>> set_significant_digits(digits=7)
pyFlightscript.fsinit.set_simulation_length_units(units='METER')

Set the simulation length scale units.

This function appends a command to the script state to set the length units for the entire simulation.

Return type:

None

Parameters:

units (ValidUnits, optional) – The desired simulation length unit. Defaults to ‘METER’.

Raises:

ValueError – If the provided units is not a valid unit type.

Examples

>>> # Set simulation length units to inches
>>> set_simulation_length_units(units='INCH')
pyFlightscript.fsinit.set_trailing_edge_bluntness_angle(angle=85.0)

Set the trailing edge bluntness angle.

This function appends a command to the script state to set the angle used for identifying blunt trailing edges.

Return type:

None

Parameters:

angle (float, optional) – The desired trailing edge bluntness angle in degrees. Must be between 45 and 179. Defaults to 85.0.

Raises:

ValueError – If the angle is not a numeric value or is outside the valid range [45, 179].

Examples

>>> # Set the trailing edge bluntness angle to 90 degrees
>>> set_trailing_edge_bluntness_angle(angle=90.0)
pyFlightscript.fsinit.set_trailing_edge_sweep_angle(angle=45.0)

Set the trailing edge sweep angle.

This function appends a command to the script state to set the trailing edge sweep angle used for identifying trailing edges.

Return type:

None

Parameters:

angle (float, optional) – The desired trailing edge sweep angle in degrees. Must be between 0 and 90. Defaults to 45.0.

Raises:

ValueError – If the angle is not a numeric value or is outside the valid range [0, 90].

Examples

>>> # Set the trailing edge sweep angle to 60 degrees
>>> set_trailing_edge_sweep_angle(angle=60.0)
pyFlightscript.fsinit.set_vertex_merge_tolerance(tolerance=1e-05)

Set the vertex merge tolerance.

This function appends a command to the script state to set the tolerance used for merging vertices.

Return type:

None

Parameters:

tolerance (float, optional) – The vertex merge tolerance value. Defaults to 1e-5.

Raises:

ValueError – If tolerance is not a numeric value.

Examples

>>> # Set the vertex merge tolerance to 1e-6
>>> set_vertex_merge_tolerance(tolerance=1e-6)
pyFlightscript.fsinit.stop_script()

Stop the script at the current location.

This function appends a command to the script state that halts the execution of the script at the point where this function is called.

Return type:

None

Examples

>>> # Stop the script execution
>>> stop_script()

pyFlightscript.inlets module

pyFlightscript.inlets.create_new_inlet(surface_id, velocity)

Create a new inlet boundary with specified velocity along the surface normal.

This function appends a command to the script state to create a new inlet boundary with a specified velocity.

Return type:

None

Parameters:
  • surface_id (int) – The index of the boundary surface to be marked as an inlet. Must be > 0.

  • velocity (float) – The velocity magnitude along the surface normal vector of the inlet faces. Positive or negative values control the direction of flow.

Return type:

None

Examples

>>> # Create a new inlet with surface_id 3 and velocity 101.0
>>> create_new_inlet(3, 101.0)
pyFlightscript.inlets.delete_inlet(inlet)

Delete an existing inlet boundary.

This function appends a command to the script state to delete an existing inlet boundary.

Return type:

None

Parameters:

inlet (int) – The index of the inlet boundary to be deleted.

Return type:

None

Examples

>>> # Delete inlet 1
>>> delete_inlet(1)
pyFlightscript.inlets.remesh_inlet(inlet, inner_radius=0.0, elements=10, growth_scheme=2, growth_rate=1.2)

Radially mesh an existing inlet boundary.

This function appends a command to the script state to radially mesh an existing inlet boundary.

Return type:

None

Parameters:
  • inlet (int) – The index of the inlet boundary to be meshed.

  • inner_radius (float, optional) – The inner radius of the inlet boundary, by default 0.0.

  • elements (int, optional) – The number of mesh faces in the radial direction, by default 10.

  • growth_scheme (int, optional) – The growth scheme type (1 or 2), by default 2.

  • growth_rate (float, optional) – The growth rate for the radial distribution of mesh faces, by default 1.2.

Return type:

None

Examples

>>> # Remesh an inlet with default parameters
>>> remesh_inlet(1)
>>> # Remesh an inlet with custom parameters
>>> remesh_inlet(1, inner_radius=0.1, elements=20, growth_scheme=1, growth_rate=1.1)
pyFlightscript.inlets.set_inlet_custom_profile(inlet_id, motion_filepath)

Set a custom inlet profile using an external file.

This function appends a command to the script state to set a custom inlet profile using an external file.

Return type:

None

Parameters:
  • inlet_id (int) – The index of the inlet boundary.

  • motion_filepath (str) – The path to the file containing the motion data.

Return type:

None

Examples

>>> # Set a custom inlet profile for inlet_id 1
>>> set_inlet_custom_profile(1, 'C:/Users/Desktop/Models/custom_inlet_profile.txt')

pyFlightscript.log module

pyFlightscript.log.clear_log()

Clear the log.

This function appends a command to the script state to clear the log.

Return type:

None

Examples

>>> clear_log()
pyFlightscript.log.export_log(log_filepath)

Export log window messages.

This function appends a command to the script state to export log window messages to a specified file.

Return type:

None

Parameters:

log_filepath (str) – Path to the output log file.

Examples

>>> export_log('C:/.../Output_log.txt')
pyFlightscript.log.output_settings_and_status(output_filename)

Output fluid properties and solver status.

This function appends a command to the script state to output fluid properties and solver status to a specified file.

Return type:

None

Parameters:

output_filename (str) – Path to the output file.

Examples

>>> output_settings_and_status('C:/path/to/output.txt')

pyFlightscript.mesh module

pyFlightscript.mesh.ccs_import(ccs_filepath, close_component_ends='ENABLE', update_properties='DISABLE', clear_existing='ENABLE')

Import a Component Cross-Section (CCS) geometry.

This function appends a command to the script state to import a CCS geometry file with options for handling component ends, properties, and existing geometry.

Return type:

None

Parameters:
  • ccs_filepath (str) – Path to the CCS geometry file.

  • close_component_ends (RunOptions, optional) – Enable/disable hole-filling at component ends, by default “ENABLE”.

  • update_properties (RunOptions, optional) – Enable/disable updating simulation properties from the file, by default “DISABLE”.

  • clear_existing (RunOptions, optional) – Enable/disable deleting existing geometry before import, by default “ENABLE”.

Raises:

ValueError – If any option is not ‘ENABLE’ or ‘DISABLE’.

pyFlightscript.mesh.create_new_surface_from_selection()

Create a new geometry surface from the currently selected faces.

This function appends a command to the script state to generate a new surface from the set of currently selected faces.

Return type:

None

pyFlightscript.mesh.delete_selected_faces()

Delete selected mesh faces. This function appends a command to the script state to delete all currently selected mesh faces.

Return type:

None

pyFlightscript.mesh.export_surface_mesh(file_path, file_type, surface=-1)

Export a geometry surface to an external file.

This function appends a command to the script state to export one or all geometry surfaces to a specified file format.

Return type:

None

Parameters:
  • file_path (str) – Path to save the exported file.

  • file_type (ValidExportMeshFileTypes) – File type for the exported geometry (STL, TRI, OBJ).

  • surface (int, optional) – Index of the surface to export (-1 for all surfaces), by default -1.

Raises:

ValueError – If an invalid file type is provided.

pyFlightscript.mesh.import_mesh(geometry_filepath, units='METER', file_type='STL', clear=True)

Import a geometry into the simulation.

This function appends a command to the script state to import a geometry file, specifying units, file type, and whether to clear existing geometry boundaries.

Return type:

None

Parameters:
  • geometry_filepath (str) – Path to the geometry file.

  • units (ValidUnits, optional) – The unit type for the geometry, by default ‘METER’.

  • file_type (ValidImportMeshFileTypes, optional) – Type of the geometry file, by default ‘STL’.

  • clear (bool, optional) – If True, deletes existing geometry boundaries before import, by default True.

Raises:

ValueError – If an invalid file type or unit is provided.

pyFlightscript.mesh.select_geometry_by_id(surface=1)

Select a geometry surface by its index.

This function appends a command to the script state to select a geometry surface.

Return type:

None

Parameters:

surface (int, optional) – Index of the surface to select (-1 for all), by default 1.

Raises:

ValueError – If the surface index is invalid.

pyFlightscript.mesh.surface_auto_hole_fill(surface=1)

Automatically fill holes on a surface.

This function appends a command to the script state to automatically fill all holes on a specified surface.

Return type:

None

Parameters:

surface (int, optional) – Index of the surface to fill, by default 1.

Raises:

ValueError – If the surface index is not a positive integer.

pyFlightscript.mesh.surface_clearall()

Delete all surfaces in the simulation.

This function appends a command to the script state to delete all geometry surfaces currently in the simulation.

Return type:

None

pyFlightscript.mesh.surface_combine(surface_indices)

Combine selected surfaces.

This function appends a command to the script state to combine multiple surfaces into a single surface.

Return type:

None

Parameters:

surface_indices (List[int]) – List of surface indices to be combined.

pyFlightscript.mesh.surface_cut_by_plane(frame=1, plane='XZ', offset=0.0, surface=-1)

Cut surfaces using a cutting plane.

This function appends a command to the script state to cut one or all surfaces with a specified plane.

Return type:

None

Parameters:
  • frame (int, optional) – Index of the coordinate system for the cutting plane, by default 1.

  • plane (ValidPlanes, optional) – Plane of the coordinate system to use as the cutting plane, by default ‘XZ’.

  • offset (float, optional) – Offset distance of the plane along its normal vector, by default 0.0.

  • surface (int, optional) – Index of the surface to cut (-1 for all), by default -1.

pyFlightscript.mesh.surface_delete(surface_index)

Delete an existing surface.

This function appends a command to the script state to delete a specified surface.

Return type:

None

Parameters:

surface_index (int) – Index of the surface to be deleted.

Raises:

ValueError – If the surface index is not a positive integer.

pyFlightscript.mesh.surface_invert(index=1)

Invert the surface normals of a given surface.

This function appends a command to the script state to invert the normals of a specified surface.

Return type:

None

Parameters:

index (int, optional) – Index of the surface to invert (-1 for all), by default 1.

pyFlightscript.mesh.surface_mirror(surface=1, coordinate_system=1, mirror_plane=1, combine_flag=True, delete_source_flag=False)

Mirror an existing surface.

This function appends a command to the script state to mirror a surface across a specified plane.

Return type:

None

Parameters:
  • surface (int, optional) – Index of the surface to mirror, by default 1.

  • coordinate_system (int, optional) – Index of the coordinate system to use, by default 1.

  • mirror_plane (int, optional) – Index of the mirror plane (1=XY, 2=YZ, 3=XZ), by default 1.

  • combine_flag (bool, optional) – Combine the mirrored geometry with the source, by default True.

  • delete_source_flag (bool, optional) – Delete the source geometry after mirroring, by default False.

pyFlightscript.mesh.surface_rename(name, index=1)

Rename the surface geometry.

This function appends a command to the script state to assign a new name to a specified geometry surface.

Return type:

None

Parameters:
  • name (str) – New name for the geometry surface.

  • index (int, optional) – Index of the surface to be renamed, by default 1.

pyFlightscript.mesh.surface_rotate(frame=1, axis='X', angle=0, surfaces=[-1], split_vertices='DISABLE', adaptive_mesh='DISABLE', detach_normal_to_axis='DISABLE')

Rotate an existing surface.

This function appends a command to the script state to rotate specified surfaces around a given axis and frame.

Return type:

None

Parameters:
  • frame (int, optional) – Index of the coordinate system to be used, by default 1.

  • axis (ValidRotationAxis, optional) – Coordinate axis about which to rotate the surface, by default ‘X’.

  • angle (float, optional) – Angle value in degrees, by default 0.

  • surfaces (List[int], optional) – List of surface indices to be rotated (-1 for all), by default [-1].

  • split_vertices (RunOptions, optional) – Enable/disable splitting vertices, by default ‘DISABLE’.

  • adaptive_mesh (RunOptions, optional) – Enable/disable adaptive meshing, by default ‘DISABLE’.

  • detach_normal_to_axis (RunOptions, optional) – Enable/disable detaching normals, by default ‘DISABLE’.

Raises:

ValueError – If an invalid axis or option is provided.

pyFlightscript.mesh.surface_scale(frame=1, scale_x=1.0, scale_y=1.0, scale_z=1.0, surface=-1)

Scale existing surface(s).

This function appends a command to the script state to scale one or all surfaces in a specified coordinate system.

Return type:

None

Parameters:
  • frame (int, optional) – Index of the coordinate system for scaling, by default 1.

  • scale_x (float, optional) – Scaling factors in X, Y, and Z directions, by default 1.0.

  • scale_y (float, optional) – Scaling factors in X, Y, and Z directions, by default 1.0.

  • scale_z (float, optional) – Scaling factors in X, Y, and Z directions, by default 1.0.

  • surface (int, optional) – Index of the surface to scale (-1 for all), by default -1.

pyFlightscript.mesh.surface_select_by_threshold(frame=1, threshold='Y', min_value=0.5, max_value=2.5, range_value='ABOVE_MIN_BELOW_MAX', subset='ALL_FACES')

Select surface faces by threshold.

This function appends a command to the script state to select surface faces based on a specified threshold criterion.

Return type:

None

Parameters:
  • frame (int, optional) – Index of the coordinate system for thresholding, by default 1.

  • threshold (ValidThresholds, optional) – Type of threshold, by default ‘Y’.

  • min_value (float, optional) – Minimum value of the threshold range, by default 0.5.

  • max_value (float, optional) – Maximum value of the threshold range, by default 2.5.

  • range_value (ValidRanges, optional) – Type of range selection, by default ‘ABOVE_MIN_BELOW_MAX’.

  • subset (ValidSubsets, optional) – Subset of faces to consider, by default ‘ALL_FACES’.

Raises:

ValueError – If any parameter is invalid.

pyFlightscript.mesh.transform_selected_nodes(coordinate_system, translation_type, x, y, z)

Transform selected nodes by translation.

This function appends a command to the script state to transform selected nodes by either absolute coordinates or a translation vector.

Return type:

None

Parameters:
  • coordinate_system (int) – Index of the coordinate system to be used.

  • translation_type (ValidTranslationTypes) – Type of translation (‘ABSOLUTE’ or ‘TRANSLATION’).

  • x (float) – Translation values.

  • y (float) – Translation values.

  • z (float) – Translation values.

Raises:

ValueError – If any parameter is invalid.

pyFlightscript.mesh.translate_surface_by_frame(frame1=1, frame2=1, surface=0)

Translate a surface from one frame to another.

This function appends a command to the script state to translate a surface by aligning its coordinate system from an initial frame to a destination frame.

Return type:

None

Parameters:
  • frame1 (int, optional) – Index of the initial frame, by default 1.

  • frame2 (int, optional) – Index of the destination frame, by default 1.

  • surface (int, optional) – Index of the surface to translate (0 for all), by default 0.

pyFlightscript.mesh.translate_surface_in_frame(frame=1, x=0.0, y=0.0, z=0.0, units='INCH', surface=0, split_vertices='DISABLE')

Translate a surface with a vector.

This function appends a command to the script state to translate a surface using a vector in a specified coordinate system.

Return type:

None

Parameters:
  • frame (int, optional) – Index of the coordinate system, by default 1.

  • x (float, optional) – Translation vector components, by default 0.0.

  • y (float, optional) – Translation vector components, by default 0.0.

  • z (float, optional) – Translation vector components, by default 0.0.

  • units (ValidUnits, optional) – Unit type for translation, by default ‘INCH’.

  • surface (int, optional) – Index of the surface to translate (0 for all), by default 0.

  • split_vertices (RunOptions, optional) – Enable/disable splitting vertices, by default ‘DISABLE’.

Raises:

ValueError – If an invalid option is provided.

pyFlightscript.motion module

pyFlightscript.motion.set_motion_controls(reference_frame=1, cg_x=0.0, cg_y=0.0, cg_z=0.0)

Set the motion controls for the simulation.

This function defines the center of gravity (CG) and the reference frame for the motion of the aircraft.

Return type:

None

Parameters:
  • reference_frame (int, optional) – The reference frame number for the motion, by default 1.

  • cg_x (float, optional) – The x-coordinate of the center of gravity, by default 0.0.

  • cg_y (float, optional) – The y-coordinate of the center of gravity, by default 0.0.

  • cg_z (float, optional) – The z-coordinate of the center of gravity, by default 0.0.

Examples

>>> # Set the motion controls with a specific CG
>>> set_motion_controls(reference_frame=1, cg_x=1.5, cg_y=0.0, cg_z=0.2)
pyFlightscript.motion.set_motion_rotation(axis='Y', motion_type='ACCELERATION', amplitude=1.0, frequency=1.0, phase=0.0, initial_displacement=0.0, initial_velocity=0.0)

Define a rotational motion.

This function specifies a rotational motion about a given axis. The motion can be defined by acceleration, velocity, or displacement.

Return type:

None

Parameters:
  • axis ({'X', 'Y', 'Z'}, optional) – The axis of rotation, by default ‘Y’.

  • motion_type ({'ACCELERATION', 'VELOCITY', 'DISPLACEMENT'}, optional) – The type of motion definition, by default ‘ACCELERATION’.

  • amplitude (float, optional) – The amplitude of the motion, by default 1.0.

  • frequency (float, optional) – The frequency of the motion in Hz, by default 1.0.

  • phase (float, optional) – The phase angle of the motion in degrees, by default 0.0.

  • initial_displacement (float, optional) – The initial angular displacement, by default 0.0.

  • initial_velocity (float, optional) – The initial angular velocity, by default 0.0.

Examples

>>> # Define a pitching acceleration motion about the Y-axis
>>> set_motion_rotation(axis='Y', motion_type='ACCELERATION', amplitude=10.0, frequency=1.5)
pyFlightscript.motion.set_motion_solver(solver_type='STEADY', time_step=0.01, total_time=1.0, iterations=10, tolerance=1e-06)

Set the motion solver parameters.

This function configures the solver for motion analysis, including the type of solver, time step, total simulation time, iterations, and tolerance.

Return type:

None

Parameters:
  • solver_type ({'STEADY', 'UNSTEADY'}, optional) – The type of motion solver, by default ‘STEADY’.

  • time_step (float, optional) – The time step for unsteady simulations, by default 0.01.

  • total_time (float, optional) – The total simulation time for unsteady simulations, by default 1.0.

  • iterations (int, optional) – The number of iterations for the motion solver, by default 10.

  • tolerance (float, optional) – The convergence tolerance for the motion solver, by default 1e-6.

Examples

>>> # Set up an unsteady motion solver
>>> set_motion_solver(solver_type='UNSTEADY', time_step=0.005, total_time=2.0)
pyFlightscript.motion.set_motion_translation(axis='Z', motion_type='ACCELERATION', amplitude=1.0, frequency=1.0, phase=0.0, initial_displacement=0.0, initial_velocity=0.0)

Define a translational motion.

This function specifies a translational motion along a given axis. The motion can be defined by acceleration, velocity, or displacement.

Return type:

None

Parameters:
  • axis ({'X', 'Y', 'Z'}, optional) – The axis of translation, by default ‘Z’.

  • motion_type ({'ACCELERATION', 'VELOCITY', 'DISPLACEMENT'}, optional) – The type of motion definition, by default ‘ACCELERATION’.

  • amplitude (float, optional) – The amplitude of the motion, by default 1.0.

  • frequency (float, optional) – The frequency of the motion in Hz, by default 1.0.

  • phase (float, optional) – The phase angle of the motion in degrees, by default 0.0.

  • initial_displacement (float, optional) – The initial displacement, by default 0.0.

  • initial_velocity (float, optional) – The initial velocity, by default 0.0.

Examples

>>> # Define a sinusoidal velocity motion along the X-axis
>>> set_motion_translation(axis='X', motion_type='VELOCITY', amplitude=5.0, frequency=2.0)

pyFlightscript.plots module

pyFlightscript.plots.save_plot_to_file(filename)

Save the current plot to a file.

This function appends a command to the script state to save the plot to an external file. The format is determined by the file extension.

Return type:

None

Parameters:

filename (str) – The full path and name of the file to save the plot.

Examples

>>> # Save the plot to a text file
>>> save_plot_to_file('C:/Users/user/Documents/Test_Plot.txt')
>>> # Save the plot to a different location
>>> save_plot_to_file('D:/Analysis/Results/force_plot.dat')
pyFlightscript.plots.set_plot_type(plot_type)

Set the type of plot to be displayed.

This function appends a command to the script state to change the plot type.

Return type:

None

Parameters:

plot_type (str) – The type of plot to be generated. Must be one of VALID_PLOT_TYPE_LIST.

Examples

>>> # Set the plot type to display lift coefficient vs. angle of attack
>>> set_plot_type('CL_AXIS_X')
>>> # Set the plot type to display unsteady forces
>>> set_plot_type('UNSTEADY')

pyFlightscript.post_points module

pyFlightscript.post_points.delete_probe_points()

Delete all existing probe points.

This function appends a command to the script state to delete all probe points from the current session.

Return type:

None

Examples

>>> # Delete all probe points
>>> delete_probe_points()
pyFlightscript.post_points.export_probe_points(filepath)

Export probe points to a file.

This function appends a command to the script state to export the current probe points to a file.

Return type:

None

Parameters:

filepath (str) – Path to the file where probe points will be exported.

Examples

>>> # Export probe points to a text file
>>> export_probe_points("C:/.../My_Probes_Export.txt")
pyFlightscript.post_points.new_probe_line(num_points=15, x1=0.0, y1=0.0, z1=0.0, x2=1.5, y2=-1.0, z2=0.0)

Create a new probe survey line.

This function appends a command to the script state to create a line of equally spaced probe points.

Return type:

None

Parameters:
  • num_points (int, optional) – Number of probe vertices along the survey line, by default 15.

  • x1 (float, optional) – The x-coordinate of the starting point, by default 0.0.

  • y1 (float, optional) – The y-coordinate of the starting point, by default 0.0.

  • z1 (float, optional) – The z-coordinate of the starting point, by default 0.0.

  • x2 (float, optional) – The x-coordinate of the ending point, by default 1.5.

  • y2 (float, optional) – The y-coordinate of the ending point, by default -1.0.

  • z2 (float, optional) – The z-coordinate of the ending point, by default 0.0.

Examples

>>> # Create a probe line with 20 points
>>> new_probe_line(num_points=20, x1=0, y1=0, z1=0, x2=5, y2=0, z2=0)
pyFlightscript.post_points.new_probe_point(probe_type='VOLUME', x=1.3, y=3.3, z=-0.5)

Create a new probe point.

This function appends a command to the script state to create a single probe point at a specified location.

Return type:

None

Parameters:
  • probe_type ({'VOLUME', 'SURFACE'}, optional) – The type of the probe point, by default ‘VOLUME’.

  • x (float, optional) – The x-coordinate of the probe point, by default 1.3.

  • y (float, optional) – The y-coordinate of the probe point, by default 3.3.

  • z (float, optional) – The z-coordinate of the probe point, by default -0.5.

Examples

>>> # Create a volume probe point at a specific location
>>> new_probe_point('VOLUME', 1.0, 2.0, 3.0)
>>> # Create a surface probe point with default coordinates
>>> new_probe_point('SURFACE')
pyFlightscript.post_points.probe_points_import(filepath, units='INCH', frame=1)

Import probe points from a file.

This function appends a command to the script state to import probe points from an external file.

Return type:

None

Parameters:
  • filepath (str) – Path to the probes file.

  • units (ValidUnits, optional) – Units for the probe points, by default ‘INCH’.

  • frame (int, optional) – Index of the coordinate system, by default 1.

Examples

>>> # Import probe points from a file with metric units
>>> probe_points_import("C:/.../My_Probes.txt", units='METER', frame=2)
pyFlightscript.post_points.update_probe_points()

Update probe point flow properties.

This function appends a command to the script state to update the flow properties at all existing probe points.

Return type:

None

Examples

>>> # Update the flow properties at all probe points
>>> update_probe_points()

pyFlightscript.post_streamlines module

pyFlightscript.post_streamlines.delete_all_off_body_streamlines()

Appends lines to script state to delete all off-body streamlines.

Examples

>>> # Delete all off-body streamlines
>>> delete_all_off_body_streamlines()
pyFlightscript.post_streamlines.delete_all_surface_streamlines()

Appends lines to script state to delete all surface streamlines.

Examples

>>> # Delete all surface streamlines
>>> delete_all_surface_streamlines()
pyFlightscript.post_streamlines.export_all_off_body_streamlines(filename)

Appends lines to script state to export all off-body streamlines.

Parameters:

filename (str) – Filename with path to store the streamlines.

Return type:

None

Examples

>>> # Export all off-body streamlines to a file
>>> export_all_off_body_streamlines('C:/.../Test_streamlines.txt')
pyFlightscript.post_streamlines.export_all_surface_streamlines(output_filepath)

Appends lines to script state to export all on-body (surface) streamlines.

Parameters:

output_filepath (str) – Filename with path for the streamlines output.

Return type:

None

Examples

>>> # Export all surface streamlines to a file
>>> export_all_surface_streamlines('C:/.../Test_streamlines.txt')
pyFlightscript.post_streamlines.generate_all_off_body_streamlines()

Appends lines to script state to generate all off-body streamlines.

Examples

>>> # Generate all off-body streamlines
>>> generate_all_off_body_streamlines()
pyFlightscript.post_streamlines.generate_all_surface_streamlines()

Appends lines to script state to generate all surface streamlines.

Examples

>>> # Generate all surface streamlines
>>> generate_all_surface_streamlines()
pyFlightscript.post_streamlines.new_off_body_streamline(position_x, position_y, position_z, upstream='DISABLE')

Create an off-body streamline.

This function appends a command to the script state to create a single off-body streamline starting at a specified position.

Return type:

None

Parameters:
  • position_x (float) – X-coordinate of the streamline’s starting position.

  • position_y (float) – Y-coordinate of the streamline’s starting position.

  • position_z (float) – Z-coordinate of the streamline’s starting position.

  • upstream (RunOptions, optional) – Whether to generate the streamline upstream from the starting point, by default ‘DISABLE’. Must be one of VALID_RUN_OPTIONS.

Examples

>>> # Create a downstream streamline at a specific point
>>> new_off_body_streamline(-3.0, -0.1, 0.2)
>>> # Create an upstream streamline
>>> new_off_body_streamline(-3.0, -0.1, 0.2, upstream='ENABLE')
pyFlightscript.post_streamlines.new_off_body_streamtube(radius, frame, axis, radial_subdivisions, azimuth_subdivisions)

Create a new off-body streamtube.

This function appends a command to the script state to create a streamtube, which is a bundle of streamlines starting from a circular area.

Return type:

None

Parameters:
  • radius (float) – The radius of the streamtube’s circular base.

  • frame (int) – The index of the coordinate system to be used (> 0).

  • axis (int) – The axis of the streamtube’s disc. Use 1 for X, 2 for Y, and 3 for Z.

  • radial_subdivisions (int) – The number of subdivisions along the radius.

  • azimuth_subdivisions (int) – The number of subdivisions around the azimuth.

Examples

>>> # Create a streamtube with a radius of 0.5 in frame 2 along the X-axis
>>> new_off_body_streamtube(0.5, 2, 1, 3, 10)
pyFlightscript.post_streamlines.new_streamline_distribution(position_1_x, position_1_y, position_1_z, position_2_x, position_2_y, position_2_z, subdivisions)

Create a new off-body streamline distribution.

This function appends a command to the script state to create a line of streamlines between two specified points.

Return type:

None

Parameters:
  • position_1_x (float) – X-coordinate of the starting vertex.

  • position_1_y (float) – Y-coordinate of the starting vertex.

  • position_1_z (float) – Z-coordinate of the starting vertex.

  • position_2_x (float) – X-coordinate of the ending vertex.

  • position_2_y (float) – Y-coordinate of the ending vertex.

  • position_2_z (float) – Z-coordinate of the ending vertex.

  • subdivisions (int) – The number of streamlines to create is subdivisions - 1. Value must be > 1.

Examples

>>> # Create 48 streamlines between two points
>>> new_streamline_distribution(-3.0, -1.2, -0.3, -3.0, 1.2, -0.3, 49)
pyFlightscript.post_streamlines.set_all_off_body_streamlines_downstream()

Appends lines to script state to set all off-body streamlines downstream.

Examples

>>> # Set all off-body streamlines downstream
>>> set_all_off_body_streamlines_downstream()
pyFlightscript.post_streamlines.set_all_off_body_streamlines_upstream()

Appends lines to script state to set all off-body streamlines upstream.

Examples

>>> # Set all off-body streamlines upstream
>>> set_all_off_body_streamlines_upstream()
pyFlightscript.post_streamlines.set_off_body_streamline_length(length=None)

Set the length of new off-body streamlines.

This function appends a command to the script state to define the length of subsequently created off-body streamlines.

Return type:

None

Parameters:

length (float, optional) – The length of the streamline. If not provided or set to None, the length is considered unrestricted.

Examples

>>> # Set a specific streamline length
>>> set_off_body_streamline_length(length=10.5)
>>> # Set streamlines to have unrestricted length
>>> set_off_body_streamline_length()

pyFlightscript.post_surf module

pyFlightscript.post_surf.compute_surface_sectional_loads(units='NEWTONS')

Compute sectional loads on existing surface sections.

This function appends a command to the script state to calculate the aerodynamic loads on all currently defined surface sections.

Return type:

None

Parameters:

units (ValidForceUnits, optional) – The units for the computed loads, by default ‘NEWTONS’. Must be one of VALID_FORCE_UNITS_LIST.

Examples

>>> # Compute sectional loads in Newtons
>>> compute_surface_sectional_loads()
>>> # Compute sectional loads as coefficients
>>> compute_surface_sectional_loads(units='COEFFICIENTS')
pyFlightscript.post_surf.create_new_surface_section(frame=1, plane='XZ', offset=1.0, plot_direction=1, symmetry='DISABLE', surfaces=-1)

Create a new surface section.

This function appends a command to the script state to create a single surface section defined by a plane and offset.

Return type:

None

Parameters:
  • frame (int, optional) – Index of the coordinate system for this section, by default 1.

  • plane (str, optional) – Section plane, by default ‘XZ’. Must be one of VALID_PLANE_LIST.

  • offset (float, optional) – Offset distance of the plane, by default 1.0.

  • plot_direction (int, optional) – Plotting direction of the surface section (1 or 2), by default 1.

  • symmetry (RunOptions, optional) – Symmetry option, by default ‘DISABLE’. Must be one of VALID_RUN_OPTIONS.

  • surfaces (Union[int, List[int]], optional) – List of geometry surfaces for the section, or -1 for all, by default -1.

Examples

>>> # Create a section on all boundaries
>>> create_new_surface_section(plane='YZ', offset=2.5)
>>> # Create a section on specific surfaces
>>> create_new_surface_section(surfaces=[1, 4, 5])
pyFlightscript.post_surf.delete_all_surface_sections()

Appends lines to script state to delete all existing probe points.

Examples

>>> # Delete all surface sections
>>> delete_all_surface_sections()
pyFlightscript.post_surf.delete_surface_section(index)

Appends lines to script state to delete a surface section.

Return type:

None

Parameters:

index (int) – Index of the surface section to be deleted.

Examples

>>> # Delete surface section 2
>>> delete_surface_section(2)
pyFlightscript.post_surf.export_all_surface_sections(filename)

Appends lines to script state to export all surface sections to a file.

Return type:

None

Parameters:

filename (str) – Filename with path for the surface sections.

Examples

>>> # Export all surface sections to a file
>>> export_all_surface_sections('C:/.../Test_surface_sections.txt')
pyFlightscript.post_surf.export_surface_sectional_loads(filename)

Export sectional loads on existing surface sections.

This function appends a command to the script state to export the previously computed sectional loads to a file.

Return type:

None

Parameters:

filename (str) – The absolute path of the file to export the loads to.

Examples

>>> # Export sectional loads to a file
>>> export_surface_sectional_loads('C:/data/sectional_loads.txt')
pyFlightscript.post_surf.new_surface_section_distribution(frame=1, plane='XZ', num_sections=20, plot_direction=1, surfaces=[1, 4, 5])

Create a new surface section distribution.

This function appends a command to the script state to create multiple surface sections distributed along a specified plane.

Return type:

None

Parameters:
  • frame (int, optional) – Index of the coordinate system for the sections, by default 1.

  • plane (str, optional) – Section plane, by default ‘XZ’. Must be one of VALID_PLANE_LIST.

  • num_sections (int, optional) – Number of sections to create, by default 20.

  • plot_direction (int, optional) – Plotting direction (1 or 2), by default 1.

  • surfaces (List[int], optional) – List of geometry surfaces for the sections, by default [1, 4, 5].

Examples

>>> # Create a distribution of 30 sections on specific surfaces
>>> new_surface_section_distribution(num_sections=30, surfaces=[1, 2, 3])
pyFlightscript.post_surf.update_all_surface_sections()

Appends lines to script state to update the surface sections.

Examples

>>> # Update the surface sections
>>> update_all_surface_sections()

pyFlightscript.post_volume module

pyFlightscript.post_volume.create_new_circle_volume_section(frame=1, plane='XZ', offset=0.1, ipts=20, jpts=40, r1=0.0, r2=2.5, prisms_type='PRISMS', thickness=0.3, layers=20, growth_rate=1.2)

Create a new circular volume section.

This function appends a command to the script state to create a volume section with a circular or annular shape.

Return type:

None

Parameters:
  • frame (int, optional) – Index of the coordinate system, by default 1.

  • plane (str, optional) – Section plane, by default ‘XZ’. Must be one of VALID_PLANE_LIST.

  • offset (float, optional) – Offset distance of the plane, by default 0.1.

  • ipts (int, optional) – Number of radial segments, by default 20.

  • jpts (int, optional) – Number of azimuth segments, by default 40.

  • r1 (float, optional) – Inner radius of the circular section, by default 0.0.

  • r2 (float, optional) – Outer radius of the circular section, by default 2.5.

  • prisms_type (str, optional) – Option for near-wall prismatic cells, by default ‘PRISMS’. Must be one of VALID_PRISMS_TYPE_LIST.

  • thickness (float, optional) – Thickness of the prism layer, by default 0.3.

  • layers (int, optional) – Number of layers in the prism layer, by default 20.

  • growth_rate (float, optional) – Growth rate of prism cells, by default 1.2.

Examples

>>> create_new_circle_volume_section(r1=1.0, r2=3.0, ipts=30, jpts=60)
pyFlightscript.post_volume.create_new_rectangle_volume_section(frame=1, plane='XZ', offset=0.0, size=-0.5, x1=-2.5, y1=-1.0, x2=2.5, y2=1.0, prisms_type='PRISMS', thickness=0.3, layers=20, growth_rate=1.2)

Create a new rectangular volume section.

This function appends a command to the script state to create a volume section with a rectangular shape for detailed analysis.

Return type:

None

Parameters:
  • frame (int, optional) – Index of the coordinate system, by default 1.

  • plane (str, optional) – Section plane, by default ‘XZ’. Must be one of VALID_PLANE_LIST.

  • offset (float, optional) – Offset distance of the plane, by default 0.0.

  • size (float, optional) – Refinement size, by default -0.5.

  • x1 (float, optional) – x-coordinate of the first diagonal corner, by default -2.5.

  • y1 (float, optional) – y-coordinate of the first diagonal corner, by default -1.0.

  • x2 (float, optional) – x-coordinate of the second diagonal corner, by default 2.5.

  • y2 (float, optional) – y-coordinate of the second diagonal corner, by default 1.0.

  • prisms_type (str, optional) – Option for near-wall prismatic cells, by default ‘PRISMS’. Must be one of VALID_PRISMS_TYPE_LIST.

  • thickness (float, optional) – Thickness of the prism layer, by default 0.3.

  • layers (int, optional) – Number of layers in the prism layer, by default 20.

  • growth_rate (float, optional) – Growth rate of prism cells, by default 1.2.

Examples

>>> create_new_rectangle_volume_section(plane='XY', offset=5.0, size=-0.2)
pyFlightscript.post_volume.delete_all_volume_sections()

Delete all volume sections.

This function appends a command to the script state to delete all existing volume sections.

Return type:

None

Examples

>>> # Delete all volume sections
>>> delete_all_volume_sections()
pyFlightscript.post_volume.delete_volume_section(index)

Delete a particular volume section.

This function appends a command to the script state to delete a specific volume section by its index.

Return type:

None

Parameters:

index (int) – Index of the volume section to be deleted (> 0).

Examples

>>> # Delete volume section 2
>>> delete_volume_section(2)
pyFlightscript.post_volume.export_volume_section_2d_vtk(index, filename)

Export a volume section as a 2D ParaView (VTK) file.

This function appends a command to the script state to export a specific volume section to a 2D VTK file.

Return type:

None

Parameters:
  • index (int) – Index of the volume section to be exported (> 0).

  • filename (str) – The absolute path to the desired output VTK file.

Examples

>>> # Export volume section 1 as a 2D VTK file
>>> export_volume_section_2d_vtk(1, 'C:/data/volume_section_2d.vtk')
pyFlightscript.post_volume.export_volume_section_tecplot(index, filename)

Export a volume section as a Tecplot (DAT) file.

This function appends a command to the script state to export a specific volume section to a Tecplot DAT file.

Return type:

None

Parameters:
  • index (int) – Index of the volume section to be exported (> 0).

  • filename (str) – The absolute path to the desired output DAT file.

Examples

>>> # Export volume section 4 to a Tecplot file
>>> export_volume_section_tecplot(4, 'C:/data/volume_section_4.dat')
pyFlightscript.post_volume.export_volume_section_vtk(index, filename)

Export a volume section as a ParaView (VTK) file.

This function appends a command to the script state to export a specific volume section to a VTK file for visualization in ParaView.

Return type:

None

Parameters:
  • index (int) – Index of the volume section to be exported (> 0).

  • filename (str) – The absolute path to the desired output VTK file.

Examples

>>> # Export volume section 2 to a VTK file
>>> export_volume_section_vtk(2, 'C:/data/volume_section_2.vtk')
pyFlightscript.post_volume.update_all_volume_sections()

Update all volume sections.

This function appends a command to the script state to regenerate and update all existing volume sections based on the current flow solution.

Return type:

None

Examples

>>> # Update all volume sections
>>> update_all_volume_sections()
pyFlightscript.post_volume.volume_section_boundary_layer(index, setting='DISABLE')

Toggle volume section boundary layer induction.

This function appends a command to the script state to enable or disable boundary layer induction for a specific volume section.

Return type:

None

Parameters:
  • index (int) – Index of the volume section to modify (> 0).

  • setting (RunOptions, optional) – The setting to apply, by default ‘DISABLE’. Must be one of VALID_RUN_OPTIONS.

Examples

>>> # Enable boundary layer induction for volume section 2
>>> volume_section_boundary_layer(2, 'ENABLE')
pyFlightscript.post_volume.volume_section_wireframe(index, setting='ENABLE')

Toggle volume section wireframe visibility.

This function appends a command to the script state to show or hide the wireframe for a specific volume section.

Return type:

None

Parameters:
  • index (int) – Index of the volume section to modify (> 0).

  • setting (RunOptions, optional) – The setting to apply, by default ‘ENABLE’. Must be one of VALID_RUN_OPTIONS.

Examples

>>> # Disable wireframe for volume section 3
>>> volume_section_wireframe(3, 'DISABLE')

pyFlightscript.scene module

pyFlightscript.scene.change_scene_to(scene)

Change the active scene.

This function appends a command to the script state to switch the main view to a different scene.

Return type:

None

Parameters:

scene (str) – The scene to change to. Must be one of VALID_SCENE_LIST.

Examples

>>> # Change the scene to the solver view
>>> change_scene_to('SOLVER')
pyFlightscript.scene.save_scene_as_image(filename)

Save the current scene as an image file.

This function appends a command to the script to save the current view to an image file. The supported formats are .bmp, .png, .jpg, .jpeg, .tiff, and .gif.

Return type:

None

Parameters:

filename (str) – The absolute path and filename for the saved image.

Examples

>>> # Save the scene as a PNG image
>>> save_scene_as_image('C:/data/my_scene.png')
pyFlightscript.scene.set_scene_colormap_custom_mode(colormap='PRIMARY', custom_range='ENABLE')

Set the colormap custom range mode.

This function appends a command to the script state to enable or disable the custom range mode for the specified colormap.

Return type:

None

Parameters:
  • colormap (str, optional) – The colormap to modify, by default ‘PRIMARY’. Must be one of VALID_COLORMAP_LIST.

  • custom_range (RunOptions, optional) – Enable or disable custom range, by default ‘ENABLE’. Must be one of VALID_RUN_OPTIONS.

Examples

>>> # Disable custom range for the primary colormap
>>> set_scene_colormap_custom_mode('PRIMARY', 'DISABLE')
pyFlightscript.scene.set_scene_colormap_custom_range(colormap='PRIMARY', cut_off_mode='OFF', maximum=1.0, minimum=-1.5)

Set the colormap custom range.

This function appends a command to the script state to define a custom range for the specified colormap, including min/max values and cut-off mode.

Return type:

None

Parameters:
  • colormap (str, optional) – The colormap to modify, by default ‘PRIMARY’. Must be one of VALID_COLORMAP_LIST.

  • cut_off_mode (str, optional) – The cut-off mode for the custom range, by default ‘OFF’. Must be one of VALID_CUT_OFF_MODE_LIST.

  • maximum (float, optional) – The maximum value of the custom range, by default 1.0.

  • minimum (float, optional) – The minimum value of the custom range, by default -1.5.

Examples

>>> # Set a custom range for the primary colormap
>>> set_scene_colormap_custom_range('PRIMARY', 'ABOVE_AND_BELOW', 2.0, -1.0)
pyFlightscript.scene.set_scene_colormap_position(colormap='PRIMARY', x=450, y=75)

Set the solver colormap position.

This function appends a command to the script state to place the specified colormap legend at a given pixel coordinate.

Return type:

None

Parameters:
  • colormap (str, optional) – The colormap to modify, by default ‘PRIMARY’. Must be one of VALID_COLORMAP_LIST.

  • x (int, optional) – The x-coordinate in pixels, by default 450.

  • y (int, optional) – The y-coordinate in pixels, by default 75.

Examples

>>> # Reposition the primary colormap
>>> set_scene_colormap_position('PRIMARY', 100, 50)
pyFlightscript.scene.set_scene_colormap_shading(colormap='PRIMARY', reverse='DISABLE', smooth='ENABLE')

Set the solver colormap shading options.

This function appends a command to the script state to configure the shading properties of the specified colormap.

Return type:

None

Parameters:
  • colormap (str, optional) – The colormap to modify, by default ‘PRIMARY’. Must be one of VALID_COLORMAP_LIST.

  • reverse (RunOptions, optional) – Reverse the colormap direction, by default ‘DISABLE’. Must be one of VALID_RUN_OPTIONS.

  • smooth (RunOptions, optional) – Enable or disable smooth shading, by default ‘ENABLE’. Must be one of VALID_RUN_OPTIONS.

Examples

>>> # Reverse the secondary colormap and disable smooth shading
>>> set_scene_colormap_shading('SECONDARY', 'ENABLE', 'DISABLE')
pyFlightscript.scene.set_scene_colormap_size(colormap='PRIMARY', thickness=300, height=15)

Set the solver colormap size.

This function appends a command to the script state to adjust the size of the specified colormap legend in pixels.

Return type:

None

Parameters:
  • colormap (str, optional) – The colormap to modify, by default ‘PRIMARY’. Must be one of VALID_COLORMAP_LIST.

  • thickness (int, optional) – The thickness of the colormap legend in pixels, by default 300.

  • height (int, optional) – The height of the colormap legend in pixels, by default 15.

Examples

>>> # Set the size of the secondary colormap
>>> set_scene_colormap_size('SECONDARY', 400, 20)
pyFlightscript.scene.set_scene_colormap_type(colormap='PRIMARY', type_value='BLACKBODY_STANDARD')

Set the solver colormap type.

This function appends a command to the script state to define the color scheme for either the primary or secondary colormap.

Return type:

None

Parameters:
  • colormap (str, optional) – The colormap to modify, by default ‘PRIMARY’. Must be one of VALID_COLORMAP_LIST.

  • type_value (str, optional) – The type of colormap to apply, by default ‘BLACKBODY_STANDARD’. Must be one of VALID_COLORMAP_TYPE_LIST.

Examples

>>> # Set the primary colormap to rainbow
>>> set_scene_colormap_type('PRIMARY', 'RAINBOW_STANDARD')
pyFlightscript.scene.set_scene_view(view_option='DEFAULTVIEW')

Set the scene view to a predefined orientation.

This function appends a command to the script state to change the camera’s viewpoint to a standard orientation.

Return type:

None

Parameters:

view_option (str, optional) – The view to set, by default ‘DEFAULTVIEW’. Must be one of VALID_SCENE_VIEW_LIST.

Examples

>>> # Set the scene to the default view
>>> set_scene_view()
>>> # Set the scene to a negative YZ view
>>> set_scene_view('YZ_NEGATIVE')
pyFlightscript.scene.view_resize()

Resize the view in the scene.

This function appends a command to the script state to resize the view, which may be useful after changing the window size or layout.

Return type:

None

Examples

>>> # Resize the scene view
>>> view_resize()

pyFlightscript.script module

class pyFlightscript.script.State

Bases: object

Manages the state of the FlightStream script being generated.

append_lines(lines)

Append lines to the existing script.

Return type:

None

Parameters:

lines (Union[str, List[str]]) – A single line or a list of lines to be appended to the script.

clear_lines()

Clear all lines from the current script state.

Return type:

None

display_lines()

Print each line stored in the script to the console.

Return type:

None

write_to_file(filename='script_out.txt')

Write the script content to a file for use in FlightStream.

Return type:

None

Parameters:

filename (str, optional) – The name of the file to write to, by default “script_out.txt”.

pyFlightscript.script.clear_lines()

Clear all lines from the global script state.

Return type:

None

pyFlightscript.script.display_lines()

Print each line stored in the global script state to the console.

Return type:

None

pyFlightscript.script.hard_reset(filename='script_out.txt')

Reset the script and delete the specified output file.

This function clears all lines from the script and removes the output file from the filesystem if it exists.

Return type:

None

Parameters:

filename (str, optional) – The name of the output file to delete, by default “script_out.txt”.

pyFlightscript.script.run_script(fsexe_path, script_path='.\\\\script_out.txt', hidden=False)

Run a script using the FlightStream executable.

Return type:

CompletedProcess

Parameters:
  • fsexe_path (str) – The path to the FlightStream executable.

  • script_path (str, optional) – The path to the script file to run, by default r’.script_out.txt’.

  • hidden (bool, optional) – If True, runs FlightStream in hidden mode, by default False.

Returns:

The result of the subprocess run command.

Return type:

subprocess.CompletedProcess

pyFlightscript.script.write_to_file(filename='script_out.txt')

Write the global script content to a file.

Return type:

None

Parameters:

filename (str, optional) – The name of the file to write to, by default “script_out.txt”.

pyFlightscript.set_solver module

pyFlightscript.set_solver.adverse_gradient_boundary_layer(mode='ENABLE')

Set the adverse pressure gradient boundary layer mode.

This function appends a command to the script state to configure the adverse pressure gradient boundary layer mode.

Return type:

None

Parameters:

mode (RunOptions, optional) – The mode for the adverse pressure gradient boundary layer, by default ‘ENABLE’. Must be one of VALID_RUN_OPTIONS.

Examples

>>> # Disable the adverse gradient boundary layer model
>>> adverse_gradient_boundary_layer('DISABLE')
pyFlightscript.set_solver.aoa(angle)

Set the solver angle of attack (AOA).

This function appends a command to the script state to set the angle of attack for the simulation.

Return type:

None

Parameters:

angle (float) – The angle of attack in degrees. The absolute value must be less than 90.

Examples

>>> # Set the angle of attack to 5 degrees
>>> aoa(5.0)
>>> # Set a negative angle of attack
>>> aoa(-2.5)
pyFlightscript.set_solver.boundary_layer_type(type_value='TRANSITIONAL')

Set the surface boundary layer type.

This function appends a command to the script state to define the type of boundary layer model to be used in the simulation.

Return type:

None

Parameters:

type_value (str, optional) – The type of boundary layer, by default ‘TRANSITIONAL’. Must be one of VALID_BOUNDARY_LAYER_TYPE_LIST.

Examples

>>> # Set the boundary layer to turbulent
>>> boundary_layer_type('TURBULENT')
pyFlightscript.set_solver.convergence_iterations(value=500)

Set the solver convergence iterations.

This function appends a command to the script state to define the number of iterations the solver must run after crossing the convergence threshold.

Return type:

None

Parameters:

value (int, optional) – The number of convergence iterations, by default 500.

Examples

>>> # Set the convergence iterations to 100
>>> convergence_iterations(100)
pyFlightscript.set_solver.convergence_threshold(threshold=1e-05)

Set the solver convergence threshold.

This function appends a command to the script state to define the convergence criterion for the solver.

Return type:

None

Parameters:

threshold (float, optional) – The convergence threshold value, by default 1e-5.

Examples

>>> # Set a tighter convergence threshold
>>> convergence_threshold(1e-6)
pyFlightscript.set_solver.delete_axial_separation_boundaries()

Delete all axial flow separation boundaries.

This function appends a command to the script state to clear the list of axial flow separation boundaries.

Return type:

None

Examples

>>> # Clear all axial separation boundaries
>>> delete_axial_separation_boundaries()
pyFlightscript.set_solver.delete_crossflow_separation_boundaries()

Delete all cross-flow separation boundaries.

This function appends a command to the script state to clear the list of cross-flow separation boundaries.

Return type:

None

Examples

>>> # Clear all cross-flow separation boundaries
>>> delete_crossflow_separation_boundaries()
pyFlightscript.set_solver.delete_viscous_excluded_boundaries()

Delete the viscous exclusion boundary list.

This function appends a command to the script state to clear the list of boundaries that are excluded from viscous calculations.

Return type:

None

Examples

>>> # Clear the viscous exclusion list
>>> delete_viscous_excluded_boundaries()
pyFlightscript.set_solver.farfield_layers(value=3)

Set the solver far-field agglomeration layers.

This function appends a command to the script state to define the number of far-field agglomeration layers for the solver.

Return type:

None

Parameters:

value (int, optional) – The number of far-field layers (between 1 and 5), by default 3.

Examples

>>> # Set the number of far-field layers to 4
>>> farfield_layers(4)
pyFlightscript.set_solver.forced_iterations(mode='ENABLE')

Enable or disable solver forced iterations mode.

This function appends a command to the script state to force the solver to run for the full number of specified iterations, regardless of convergence.

Return type:

None

Parameters:

mode (RunOptions, optional) – The mode for forced iterations, by default ‘ENABLE’. Must be one of VALID_RUN_OPTIONS.

Examples

>>> # Disable forced iterations
>>> forced_iterations('DISABLE')
pyFlightscript.set_solver.mesh_induced_wake_velocity(enable=True)

Set the solver mesh induced wake velocity.

This function appends a command to the script state to enable or disable the mesh-induced wake velocity feature.

Return type:

None

Parameters:

enable (bool, optional) – Enable or disable the feature, by default True.

Examples

>>> # Disable mesh-induced wake velocity
>>> mesh_induced_wake_velocity(False)
pyFlightscript.set_solver.ref_area(value=1.0)

Set the solver reference area.

This function appends a command to the script state to define the reference area used for calculating aerodynamic coefficients.

Return type:

None

Parameters:

value (float, optional) – The reference area, by default 1.0.

Examples

>>> # Set the reference area to 2.5
>>> ref_area(2.5)
pyFlightscript.set_solver.ref_length(length=1.0)

Set the solver reference length.

This function appends a command to the script state to define the reference length used for calculating aerodynamic coefficients.

Return type:

None

Parameters:

length (float, optional) – The reference length, by default 1.0.

Examples

>>> # Set the reference length to 3.0
>>> ref_length(3.0)
pyFlightscript.set_solver.ref_mach_number(mach=3.0)

Set the solver reference Mach number.

This function appends a command to the script state to define the reference Mach number for the simulation.

Return type:

None

Parameters:

mach (float, optional) – The reference Mach number, by default 3.0.

Examples

>>> # Set the reference Mach number to 0.9
>>> ref_mach_number(0.9)
pyFlightscript.set_solver.ref_velocity(value=100.0)

Set the solver reference velocity.

This function appends a command to the script state to define the reference velocity used for calculating aerodynamic coefficients.

Return type:

None

Parameters:

value (float, optional) – The reference velocity, by default 100.0.

Examples

>>> # Set the reference velocity to 150.0
>>> ref_velocity(150.0)
pyFlightscript.set_solver.set_axial_separation_boundaries(boundary_indices)

Set axial separation boundaries.

This function appends a command to the script state to define which boundaries are subject to axial flow separation.

Return type:

None

Parameters:

boundary_indices (Union[int, List[int]]) – A single boundary index or a list of boundary indices.

Examples

>>> # Set a single axial separation boundary
>>> set_axial_separation_boundaries(3)
>>> # Set multiple axial separation boundaries
>>> set_axial_separation_boundaries([1, 2, 5])
pyFlightscript.set_solver.set_crossflow_separation_boundaries(boundary_indices)

Set cross-flow separation boundaries.

This function appends a command to the script state to define which boundaries are subject to cross-flow separation.

Return type:

None

Parameters:

boundary_indices (List[int]) – A list of boundary indices to be added to the cross-flow separation boundaries list.

Examples

>>> # Set boundaries 3, 4, and 5 for cross-flow separation
>>> set_crossflow_separation_boundaries([3, 4, 5])
pyFlightscript.set_solver.set_crossflow_separation_cp(mean_diameter)

Set the cross-flow separation pressure coefficient.

This function appends a command to the script state to set the pressure coefficient for cross-flow separation based on a mean diameter.

Return type:

None

Parameters:

mean_diameter (float) – The mean diameter of the geometric body for calculating the cross-flow separation pressure coefficient (> 0).

Examples

>>> # Set the cross-flow separation Cp for a body with a mean diameter of 2.5
>>> set_crossflow_separation_cp(2.5)
pyFlightscript.set_solver.set_max_parallel_threads(num_cores=16)

Set the number of solver parallel cores.

This function appends a command to the script state to specify the number of parallel threads to be used by the solver.

Return type:

None

Parameters:

num_cores (int, optional) – The number of parallel cores, by default 16.

Examples

>>> # Set the solver to use 8 cores
>>> set_max_parallel_threads(8)
pyFlightscript.set_solver.sideslip(angle)

Set the solver sideslip angle.

This function appends a command to the script state to set the sideslip angle for the simulation.

Return type:

None

Parameters:

angle (float) – The sideslip angle in degrees. The absolute value must be less than 90.

Examples

>>> # Set the sideslip angle to 3 degrees
>>> sideslip(3.0)
>>> # Set a negative sideslip angle
>>> sideslip(-1.5)
pyFlightscript.set_solver.solver_iterations(num_iterations=500)

Set the solver iterations.

This function appends a command to the script state to define the number of iterations for the solver to perform.

Return type:

None

Parameters:

num_iterations (int, optional) – The number of solver iterations, by default 500.

Examples

>>> # Set the solver to run for 1000 iterations
>>> solver_iterations(1000)
pyFlightscript.set_solver.solver_mach_number(mach=3.0)

Set the solver Mach number.

This function appends a command to the script state to define the Mach number for the simulation.

Return type:

None

Parameters:

mach (float, optional) – The Mach number, by default 3.0.

Examples

>>> # Set the Mach number to 0.8
>>> solver_mach_number(0.8)
pyFlightscript.set_solver.solver_minimum_cp(cp_min=-100.0)

Set the solver minimum coefficient of pressure.

This function appends a command to the script state to define the minimum allowed coefficient of pressure in the solver.

Return type:

None

Parameters:

cp_min (float, optional) – The minimum coefficient of pressure, by default -100.0.

Examples

>>> # Set a custom minimum Cp
>>> solver_minimum_cp(-50.0)
pyFlightscript.set_solver.solver_unsteady_pressure_and_kutta(status='ENABLE')

Enable or disable solver unsteady Bernoulli and Kutta terms.

This function appends a command to the script state to control the unsteady Bernoulli and Kutta terms in the solver.

Return type:

None

Parameters:

status (RunOptions, optional) – The status of the unsteady pressure and Kutta terms, by default ‘ENABLE’. Must be one of VALID_RUN_OPTIONS.

Examples

>>> # Disable unsteady Bernoulli and Kutta terms
>>> solver_unsteady_pressure_and_kutta('DISABLE')
pyFlightscript.set_solver.solver_velocity(velocity=30.0)

Set the solver free-stream velocity.

This function appends a command to the script state to define the free-stream velocity for the simulation.

Return type:

None

Parameters:

velocity (float, optional) – The free-stream velocity value, by default 30.0.

Examples

>>> # Set the freestream velocity to 50.0
>>> solver_velocity(50.0)
pyFlightscript.set_solver.solver_vortex_ring_normalization(status='ENABLE')

Enable or disable solver vortex ring normalization.

This function appends a command to the script state to control the vortex ring normalization feature in the solver.

Return type:

None

Parameters:

status (RunOptions, optional) – The status of the vortex ring normalization, by default ‘ENABLE’. Must be one of VALID_RUN_OPTIONS.

Examples

>>> # Disable vortex ring normalization
>>> solver_vortex_ring_normalization('DISABLE')
pyFlightscript.set_solver.steady()

Set the solver to steady mode.

This function appends a command to the script state to configure the solver for a steady-state analysis.

Return type:

None

Examples

>>> # Set the solver to steady mode
>>> steady()
pyFlightscript.set_solver.surface_roughness(roughness_height=23.5)

Set the surface roughness height.

This function appends a command to the script state to specify the surface roughness height in nanometers.

Return type:

None

Parameters:

roughness_height (float, optional) – The height of the surface roughness in nanometers, by default 23.5.

Examples

>>> # Set a custom surface roughness
>>> surface_roughness(50.0)
pyFlightscript.set_solver.unsteady(time_iterations=100, delta_time=0.1)

Set the solver to unsteady mode.

This function appends a command to the script state to configure the solver for a time-dependent, unsteady analysis.

Return type:

None

Parameters:
  • time_iterations (int, optional) – Number of time-stepping iterations, by default 100.

  • delta_time (float, optional) – Physical time step for the unsteady solver, by default 0.1.

Examples

>>> # Set up an unsteady simulation with 200 time steps
>>> unsteady(time_iterations=200, delta_time=0.05)
pyFlightscript.set_solver.unsteady_solver_animation(enable_disable, folder, filetype, frequency, volume_sections)

Configure the unsteady solver animation.

This function appends a command to the script state to set up animation output for an unsteady simulation.

Return type:

None

Parameters:
  • enable_disable (RunOptions) – Enable or disable the animation. Must be one of VALID_RUN_OPTIONS.

  • folder (str) – The folder location for the output animation files.

  • filetype (str) – The type of output file. Must be one of VALID_ANIMATION_FILETYPE_LIST.

  • frequency (int) – The frequency of output in terms of solver time steps.

  • volume_sections (RunOptions) – Enable or disable the export of volume section output files. Must be one of VALID_RUN_OPTIONS.

Examples

>>> # Enable animation output to a specific folder
>>> unsteady_solver_animation(
...     'ENABLE', 'C:/animation', 'PARAVIEW_VTK', 10, 'ENABLE'
... )
pyFlightscript.set_solver.unsteady_solver_delete_all_plots()

Delete all unsteady solver plots.

This function appends a command to the script state to remove all currently defined unsteady solver plots.

Return type:

None

Examples

>>> # Delete all unsteady plots
>>> unsteady_solver_delete_all_plots()
pyFlightscript.set_solver.unsteady_solver_export_plots(export_filepath)

Export all unsteady solver plots.

This function appends a command to the script state to export all data from unsteady solver plots to a specified file.

Return type:

None

Parameters:

export_filepath (str) – The absolute path where the plot data should be exported.

Examples

>>> # Export unsteady plot data
>>> unsteady_solver_export_plots('C:/data/unsteady_plots.txt')
pyFlightscript.set_solver.unsteady_solver_new_fluid_plot(frame=1, parameter='VELOCITY', name='Plot_Name', vertex=(-1.0, 1.0, 0.0))

Create a new unsteady solver fluid properties plot.

This function appends a command to the script state to generate a plot of a fluid property over time at a specific point.

Return type:

None

Parameters:
  • frame (int, optional) – Index of the coordinate system, by default 1.

  • parameter (str, optional) – The fluid property to plot, by default ‘VELOCITY’. Must be one of VALID_UNSTEADY_FLUID_PLOT_PARAMETER_LIST.

  • name (str, optional) – Name of the plot, by default ‘Plot_Name’.

  • vertex (Tuple[float, float, float], optional) – Coordinates (x, y, z) for the measurement location, by default (-1.0, 1.0, 0.0).

Examples

>>> # Plot velocity at a specific point in the slipstream
>>> unsteady_solver_new_fluid_plot(
...     name='Propeller_slipstream',
...     vertex=(-2.0, 1.4, 0.0)
... )
pyFlightscript.set_solver.unsteady_solver_new_force_plot(frame=1, units='NEWTONS', parameter='FORCE_X', name='Plot_Name', boundaries=-1, boundary_indices=None)

Create a new unsteady solver force and moments plot.

This function appends a command to the script state to generate a plot of force or moment data over time for specified boundaries.

Return type:

None

Parameters:
  • frame (int, optional) – Index of the coordinate system, by default 1.

  • units (ValidForceUnits, optional) – Units for the plot, by default ‘NEWTONS’. Must be one of VALID_FORCE_UNITS_LIST.

  • parameter (str, optional) – The force or moment parameter to plot, by default ‘FORCE_X’. Must be one of VALID_UNSTEADY_FORCE_PLOT_PARAMETER_LIST.

  • name (str, optional) – Name of the plot, by default ‘Plot_Name’.

  • boundaries (int, optional) – Number of geometry boundaries to link, or -1 for all, by default -1.

  • boundary_indices (Optional[List[int]], optional) – A list of boundary indices if not plotting all, by default None.

Examples

>>> # Plot thrust on specific boundaries
>>> unsteady_solver_new_force_plot(
...     name='Propeller_thrust',
...     boundaries=3,
...     boundary_indices=[1, 2, 4]
... )
pyFlightscript.set_solver.unsteady_viscous_coupling_iteration(num_iteration)

Set the unsteady solver viscous-coupling iteration.

This function appends a command to the script state to specify the time-stepping iteration at which viscous coupling is enabled.

Return type:

None

Parameters:

num_iteration (int) – The iteration number to enable viscous coupling.

Examples

>>> # Enable viscous coupling at iteration 100
>>> unsteady_viscous_coupling_iteration(100)
pyFlightscript.set_solver.viscous_coupling(mode='ENABLE')

Set the solver viscous coupling.

This function appends a command to the script state to enable or disable the viscous coupling in the solver.

Return type:

None

Parameters:

mode (RunOptions, optional) – The mode for viscous coupling, by default ‘ENABLE’. Must be one of VALID_RUN_OPTIONS.

Examples

>>> # Disable viscous coupling
>>> viscous_coupling('DISABLE')
pyFlightscript.set_solver.viscous_excluded_boundaries(num_boundaries, boundaries)

Set the viscous exclusion boundary list.

This function appends a command to the script state to exclude specified boundaries from the viscous calculation.

Return type:

None

Parameters:
  • num_boundaries (int) – The number of boundaries being excluded.

  • boundaries (List[int]) – A list of indices of the boundaries to be excluded.

Examples

>>> # Exclude boundaries 1, 2, and 4 from viscous calculations
>>> viscous_excluded_boundaries(3, [1, 2, 4])
pyFlightscript.set_solver.wake_relaxation(enable)

Enable or disable the wake-relaxation feature.

This function appends a command to the script state to control the wake-relaxation feature.

Return type:

None

Parameters:

enable (bool) – Enable or disable the wake-relaxation feature.

Examples

>>> # Disable wake relaxation
>>> wake_relaxation(False)
pyFlightscript.set_solver.wake_streamwise_agglomeration(enable=True)

Enable or disable the wake streamwise agglomeration feature.

This function appends a command to the script state to control the wake streamwise agglomeration feature.

Return type:

None

Parameters:

enable (bool, optional) – Enable or disable the feature, by default True.

Examples

>>> # Disable wake streamwise agglomeration
>>> wake_streamwise_agglomeration(False)
pyFlightscript.set_solver.wake_termination_time_steps(value)

Set the wake termination time-steps value.

This function appends a command to the script state to define the number of time steps after which a wake vortex filament edge is removed.

Return type:

None

Parameters:

value (int) – The number of time steps for wake termination.

Examples

>>> # Set wake termination to 50 time steps
>>> wake_termination_time_steps(50)

pyFlightscript.solver module

pyFlightscript.solver.initialize_solver(solver_model, surfaces, wake_termination_x='DEFAULT', symmetry='NONE', symmetry_periodicity=1, wall_collision_avoidance='ENABLE', stabilization='ENABLE', stabilization_strength=1.0)

Initialize the solver with specified parameters.

This function appends a command to the script state to set up the solver with a chosen model and configuration.

Return type:

None

Parameters:
  • solver_model (str) – The solver model to use. Must be one of VALID_SOLVER_MODEL_LIST.

  • surfaces (Union[int, List[Union[int, Tuple[int, RunOptions]]]]) –

    Specifies the surfaces to be included in the simulation. - Use -1 to include all boundaries. - Provide a list of integers to specify surface indices (quad mesher enabled by default). - Provide a list of tuples, where each tuple contains the surface index

    and the quad mesher status (‘ENABLE’ or ‘DISABLE’).

  • wake_termination_x (Union[str, float], optional) – The wake termination plane location downstream. Use ‘DEFAULT’ for auto-computation, by default ‘DEFAULT’.

  • symmetry (str, optional) – The symmetry condition, by default ‘NONE’. Must be one of VALID_SYMMETRY_LIST.

  • symmetry_periodicity (int, optional) – The number of periodic symmetry transforms, required if symmetry is ‘PERIODIC’, by default 1.

  • wall_collision_avoidance (RunOptions, optional) – Enable or disable wall collision avoidance for wake strands, by default ‘ENABLE’. Must be one of VALID_RUN_OPTIONS.

  • stabilization (RunOptions, optional) – Enable or disable solver stabilization, by default ‘ENABLE’. Must be one of VALID_RUN_OPTIONS.

  • stabilization_strength (float, optional) – The stabilization strength (0.0 < value < 5.0), by default 1.0.

Examples

>>> # Initialize an incompressible solver with specific surfaces
>>> initialize_solver(
...     'INCOMPRESSIBLE', [(1, 'ENABLE'), (2, 'ENABLE')],
...     wake_termination_x=3.5, symmetry='MIRROR'
... )
>>> # Initialize a tangent cone solver with all surfaces
>>> initialize_solver('TANGENT_CONE', -1)
pyFlightscript.solver.solver_proximal_boundaries(*boundaries)

Enable solver proximity checking for specified boundaries.

This function appends a command to the script state to enable proximity checking for the given boundary indices. This is used to prevent wake strands from penetrating certain boundaries.

Return type:

None

Parameters:

*boundaries (int) – Variable length argument list of geometry boundary indices for which proximity checking is to be enabled.

Examples

>>> # Enable proximity checking for boundaries 1, 4, and 5
>>> solver_proximal_boundaries(1, 4, 5)
>>> # Enable proximity checking for a single boundary
>>> solver_proximal_boundaries(2)
pyFlightscript.solver.solver_remove_initialization()

Remove the solver initialization.

This function appends a command to the script state to clear the current solver initialization.

Return type:

None

Examples

>>> # Remove the solver initialization
>>> solver_remove_initialization()

pyFlightscript.tools module

pyFlightscript.tools.compute_stability_coefficients()

Compute the stability coefficients.

This function appends a command to the script state to trigger the computation of all defined stability and control coefficients.

Return type:

None

pyFlightscript.tools.execute_solver_sweeper(results_filename, surface_results_path='', angle_of_attack='ENABLE', side_slip_angle='DISABLE', velocity='DISABLE', angle_of_attack_start=0.0, angle_of_attack_stop=0.0, angle_of_attack_delta=1.0, side_slip_angle_start=0.0, side_slip_angle_stop=0.0, side_slip_angle_delta=1.0, velocity_start=0.0, velocity_stop=0.0, velocity_delta=1.0, export_surface_data_per_step='ENABLE', clear_solution_after_each_run='ENABLE', reference_velocity_equals_freestream='ENABLE', append_to_existing_sweep='DISABLE')

Execute the solver sweeper.

This function appends a command to the script state to perform a parameter sweep with the solver.

Return type:

None

Parameters:
  • results_filename (str) – The full file path for the sweep results file.

  • surface_results_path (str, optional) – The path to export surface data at each step, by default ‘’.

  • angle_of_attack (RunOptions, optional) – Enable or disable angle of attack sweep, by default ‘ENABLE’.

  • side_slip_angle (RunOptions, optional) – Enable or disable side slip angle sweep, by default ‘DISABLE’.

  • velocity (RunOptions, optional) – Enable or disable velocity sweep, by default ‘DISABLE’.

  • angle_of_attack_start (float, optional) – Start value for angle of attack sweep, by default 0.0.

  • angle_of_attack_stop (float, optional) – Stop value for angle of attack sweep, by default 0.0.

  • angle_of_attack_delta (float, optional) – Increment for angle of attack sweep, by default 1.0.

  • side_slip_angle_start (float, optional) – Start value for side slip angle sweep, by default 0.0.

  • side_slip_angle_stop (float, optional) – Stop value for side slip angle sweep, by default 0.0.

  • side_slip_angle_delta (float, optional) – Increment for side slip angle sweep, by default 1.0.

  • velocity_start (float, optional) – Start value for velocity sweep, by default 0.0.

  • velocity_stop (float, optional) – Stop value for velocity sweep, by default 0.0.

  • velocity_delta (float, optional) – Increment for velocity sweep, by default 1.0.

  • export_surface_data_per_step (RunOptions, optional) – Enable or disable exporting surface data at each step, by default ‘ENABLE’.

  • clear_solution_after_each_run (RunOptions, optional) – Enable or disable clearing the solution after each run, by default ‘ENABLE’.

  • reference_velocity_equals_freestream (RunOptions, optional) – Set reference velocity equal to freestream velocity, by default ‘ENABLE’.

  • append_to_existing_sweep (RunOptions, optional) – Enable or disable appending to an existing sweep file, by default ‘DISABLE’.

pyFlightscript.tools.stability_toolbox_delete_all()

Delete all S&C toolbox coefficients.

This function appends a command to the script state to remove all user-defined stability and control coefficients.

Return type:

None

pyFlightscript.tools.stability_toolbox_export(filename)

Export the S&C toolbox results to an external file.

This function appends a command to the script state to save the results of the stability and control analysis to a file.

Return type:

None

Parameters:

filename (str) – The absolute path of the file to export the results to.

pyFlightscript.tools.stability_toolbox_new_coefficient(frame, units, numerator, denominator, constant, name, boundaries)

Define a new Stability & Control (S&C) coefficient.

This function appends a command to the script state to create a new user-defined stability and control coefficient.

Return type:

None

Parameters:
  • frame (int) – Index of the coordinate system for the numerator variable.

  • units (str) – Units of the coefficient. Must be one of VALID_FORCE_UNITS_LIST.

  • numerator (str) – The numerator of the coefficient derivative. Must be one of VALID_STABILITY_NUMERATOR_LIST.

  • denominator (str) – The denominator of the coefficient derivative. Must be one of VALID_STABILITY_DENOMINATOR_LIST.

  • constant (float) – A constant multiplier for the derivative term.

  • name (str) – The name of the user-defined coefficient.

  • boundaries (Union[int, List[int]]) – The geometry boundaries linked to the numerator. Use -1 for all.

pyFlightscript.tools.stability_toolbox_settings(rotation_frame=1, units='PER_RADIAN', clear_solver_per_run='DISABLE', angular_rate_increment=0.1)

Set the Stability & Control (S&C) toolbox parameters.

This function appends a command to the script state to configure the stability and control toolbox.

Return type:

None

Parameters:
  • rotation_frame (int, optional) – Index of the coordinate system for rotation rates, by default 1.

  • units (str, optional) – Units for dynamic stability coefficients, by default ‘PER_RADIAN’. Must be one of VALID_STABILITY_UNITS_LIST.

  • clear_solver_per_run (RunOptions, optional) – Enable or disable clearing the solution before each run, by default ‘DISABLE’. Must be one of VALID_RUN_OPTIONS.

  • angular_rate_increment (float, optional) – Incremental angular rate in rad/sec for dynamic coefficients, by default 0.1.

pyFlightscript.types module

pyFlightscript.types.BaseRegionType

Base region types.

alias of Literal[‘EMPIRICAL’, ‘USER’, ‘CUSTOM’]

pyFlightscript.types.RunOptions

Enable/disable options used across most API functions.

alias of Literal[‘ENABLE’, ‘DISABLE’]

pyFlightscript.types.VALID_FORCE_UNITS_LIST = ['COEFFICIENTS', 'NEWTONS', 'KILO-NEWTONS', 'POUND-FORCE', 'KILOGRAM-FORCE']

Runtime validation list matching ValidForceUnits.

pyFlightscript.types.VALID_RUN_OPTIONS = ['ENABLE', 'DISABLE']

Runtime validation list matching RunOptions.

pyFlightscript.types.VALID_SOLVER_MODEL_LIST = ['INCOMPRESSIBLE', 'SUBSONIC_PRANDTL_GLAUERT', 'TRANSONIC_FIELD_PANEL', 'SUPERSONIC_LINEAR_DOUBLET', 'TANGENT_CONE', 'MODIFIED_NEWTONIAN']

Valid solver models for FlightStream analysis.

pyFlightscript.types.VALID_STABILITY_DENOMINATOR_LIST = ['AOA', 'BETA', 'ROTX', 'ROTY', 'ROTZ']

Valid denominator variables for stability coefficients.

pyFlightscript.types.VALID_STABILITY_NUMERATOR_LIST = ['CL', 'CDI', 'CDO', 'CD', 'FORCE_X', 'FORCE_Y', 'FORCE_Z', 'MOMENT_X', 'MOMENT_Y', 'MOMENT_Z']

Valid numerator variables for stability coefficients.

pyFlightscript.types.VALID_STABILITY_UNITS_LIST = ['PER_RADIAN', 'PER_DEGREE']

Valid units for stability coefficient calculations.

pyFlightscript.types.VALID_SYMMETRY_LIST = ['XY', 'XZ', 'YZ', 'NONE']

Runtime validation list matching ValidSymmetry.

pyFlightscript.types.VALID_UNITS_LIST = ['INCH', 'MILLIMETER', 'OTHER', 'FEET', 'MILE', 'METER', 'KILOMETER', 'MILS', 'MICRON', 'CENTIMETER', 'MICROINCH']

Runtime validation list matching ValidUnits.

pyFlightscript.types.ValidAxis

Valid coordinate axes.

alias of Literal[‘X’, ‘Y’, ‘Z’]

pyFlightscript.types.ValidCadMesh

Valid CAD/mesh selection options.

alias of Literal[‘CAD’, ‘MESH’]

pyFlightscript.types.ValidDimensions

Valid dimensions for geometry operations.

alias of Literal[‘2D’, ‘3D’]

pyFlightscript.types.ValidExportFormat

Valid export formats for surface data.

alias of Literal[‘CP-FREESTREAM’, ‘CP-REFERENCE’, ‘PRESSURE’]

pyFlightscript.types.ValidExportMeshFileTypes

Valid file types for mesh export.

alias of Literal[‘STL’, ‘TRI’, ‘OBJ’]

pyFlightscript.types.ValidForceUnits

Valid units for force and moment measurements.

alias of Literal[‘COEFFICIENTS’, ‘NEWTONS’, ‘KILO-NEWTONS’, ‘POUND-FORCE’, ‘KILOGRAM-FORCE’]

pyFlightscript.types.ValidFreestreamType

Valid freestream types.

alias of Literal[‘CONSTANT’, ‘CUSTOM’, ‘ROTATION’]

pyFlightscript.types.ValidGrowthScheme

Valid growth schemes for meshing.

alias of Literal[1, 2, 3, 4]

pyFlightscript.types.ValidImportMeshFileTypes

Valid file types for mesh import.

alias of Literal[‘STL’, ‘TRI’, ‘P3D’, ‘CSV’, ‘INP’, ‘STRUCTURED_QUAD’, ‘UNSTRUCTURED_QUAD’, ‘LAWGS’, ‘VTK’, ‘AC’, ‘FAC’, ‘OBJ’]

pyFlightscript.types.ValidPlanes

Valid coordinate planes.

alias of Literal[‘XY’, ‘XZ’, ‘YZ’, ‘ZX’]

pyFlightscript.types.ValidPressureUnits

Valid pressure units.

alias of Literal[‘PASCALS’, ‘MEGAPASCALS’, ‘BAR’, ‘ATMOSPHERES’, ‘PSI’]

pyFlightscript.types.ValidQuadrant

Valid quadrant numbers.

alias of Literal[1, 2, 3, 4]

pyFlightscript.types.ValidRanges

Valid range specifications.

alias of Literal[‘ABOVE_MIN’, ‘BELOW_MAX’, ‘ABOVE_MIN_BELOW_MAX’]

pyFlightscript.types.ValidRotationAxis

Valid rotation axes (numeric or named).

alias of Literal[‘X’, ‘Y’, ‘Z’, ‘1’, ‘2’, ‘3’]

pyFlightscript.types.ValidSubsets

Valid subset selections.

alias of Literal[‘ALL_FACES’, ‘VISIBLE_FACES’, ‘SELECTED_FACES’]

pyFlightscript.types.ValidSymmetry

Valid symmetry planes.

alias of Literal[‘XY’, ‘XZ’, ‘YZ’, ‘NONE’]

pyFlightscript.types.ValidThresholds

Valid threshold types for mesh operations.

alias of Literal[‘AREA’, ‘QUALITY’, ‘X’, ‘Y’, ‘Z’, ‘VELOCITY’, ‘VX’, ‘VY’, ‘VZ’, ‘CP’, ‘MACH’, ‘SOLVER_QUALITY’]

pyFlightscript.types.ValidTranslationTypes

Valid translation types.

alias of Literal[‘ABSOLUTE’, ‘TRANSLATION’]

pyFlightscript.types.ValidUnits

Valid units for length measurements.

alias of Literal[‘INCH’, ‘MILLIMETER’, ‘OTHER’, ‘FEET’, ‘MILE’, ‘METER’, ‘KILOMETER’, ‘MILS’, ‘MICRON’, ‘CENTIMETER’, ‘MICROINCH’]

pyFlightscript.unite module

pyFlightscript.unite.boolean_unite_geometry(bodies, openvsp_path, bodies_values=None)

Boolean unite a selection of geometry bodies.

This function appends a command to the script state to perform a Boolean unite operation on a selection of geometry bodies. It requires specifying the number of bodies, their volume types, and the path to the OpenVSP executable.

Return type:

None

Parameters:
  • bodies (int) – The number of geometry bodies to be Boolean-united. Use -1 to specify all.

  • openvsp_path (str) – The path to the OpenVSP executable used for the CompGeom unite function.

  • bodies_values (List[Tuple[int, VolumeType]], optional) – A list of tuples, each containing the index of a geometry surface and its volume type (‘POSITIVE’ or ‘NEGATIVE’). Required if bodies is not -1.

Examples

>>> # Unite all geometry bodies
>>> boolean_unite_geometry(-1, "C:/path/to/openvsp.exe")
>>> # Unite a specific selection of geometry bodies
>>> body_values = [(1, 'POSITIVE'), (2, 'NEGATIVE'), (3, 'POSITIVE')]
>>> boolean_unite_geometry(3, "C:/path/to/openvsp.exe", body_values)
pyFlightscript.unite.boolean_unite_mesh(num_bodies, bodies_info=None)

Unite mesh bodies, either selectively or all bodies with positive volume.

This function appends a command to the script state to unite mesh bodies. It can unite a specified number of bodies with given volume types or unite all bodies that have a positive volume.

Return type:

None

Parameters:
  • num_bodies (int) – The number of mesh bodies to unite. If -1, all bodies with a positive unite volume are targeted.

  • bodies_info (List[Tuple[int, VolumeType]], optional) – A list of tuples, where each tuple contains the body’s index and its volume type (‘POSITIVE’ or ‘NEGATIVE’). This is required if num_bodies is not -1.

Examples

>>> # Unite all mesh bodies with a positive volume
>>> boolean_unite_mesh(-1)
>>> # Unite specific mesh bodies with defined volume types
>>> bodies_to_unite = [(1, 'POSITIVE'), (2, 'NEGATIVE')]
>>> boolean_unite_mesh(2, bodies_to_unite)
pyFlightscript.unite.boolean_unite_path(openvsp_path)

Set the path to the OpenVSP executable for the CompGeom unite function.

This function appends a command to the script state to specify the file path for the OpenVSP executable, which is used in the unite operations.

Return type:

None

Parameters:

openvsp_path (str) – The file path to the OpenVSP executable.

Examples

>>> # Set the OpenVSP path for the unite function
>>> boolean_unite_path("C:/path/to/openvsp.exe")

pyFlightscript.utils module

pyFlightscript.utils.check_file_existence(file)
pyFlightscript.utils.check_valid_force_units(units)

Check if the provided input units are valid.

pyFlightscript.utils.check_valid_length_units(units)

Check if the provided input units are valid.

pyFlightscript.wake module

pyFlightscript.wake.detect_trailing_edges_by_surface(surfaces)

Detect trailing edges for a given list of surfaces.

This function appends a command to the script state to initiate trailing edge detection on the specified surfaces.

Return type:

None

Parameters:

surfaces (List[int]) – A list of surface indices for which trailing edges are to be detected.

Examples

>>> # Detect trailing edges on surfaces 1, 2, and 5
>>> detect_trailing_edges_by_surface([1, 2, 5])
>>> # Detect trailing edges on a single surface
>>> detect_trailing_edges_by_surface([3])
pyFlightscript.wake.detect_wake_termination_nodes_by_surface(surface_id)

Detect wake termination nodes on a specified surface.

This function appends a command to the script state to detect wake termination nodes on a given surface index.

Return type:

None

Parameters:

surface_id (int) – The index of the surface for wake termination node detection.

Examples

>>> # Detect wake termination nodes on surface 3
>>> detect_wake_termination_nodes_by_surface(3)
pyFlightscript.wake.physics(auto_trail_edges=False, auto_wake_nodes=False, end=True)

Set the physics conditions for the simulation.

This function appends a command to the script state to define the physics conditions, with options to enable auto-detection for trailing edges and wake termination nodes.

Return type:

None

Parameters:
  • auto_trail_edges (bool, optional) – If True, launches the trailing-edge auto-detection tool, by default False.

  • auto_wake_nodes (bool, optional) – If True, launches the wake termination node auto-detection tool, by default False.

  • end (bool, optional) – If True, adds an “END” line to conclude the physics definition, by default True.

Examples

>>> # Enable auto-detection for trailing edges and wake nodes
>>> physics(auto_trail_edges=True, auto_wake_nodes=True)
>>> # Set physics conditions without auto-detection
>>> physics()
pyFlightscript.wake.trailing_edges_import(file_path)

Import trailing edges from a specified file.

This function appends a command to the script state to import trailing edges from a text file. The file should contain the vertices where trailing edges are to be marked.

Return type:

None

Parameters:

file_path (str) – The path to the .txt file containing the trailing edge vertices.

Examples

>>> # Import trailing edges from a custom file
>>> trailing_edges_import('C:/data/custom_trailing_edges.txt')

Notes

The file format should be as follows: <number_of_vertices> <UNIT_TYPE> 1,X1,Y1,Z1 2,X2,Y2,Z2 …

UNIT_TYPE can be one of: INCH, MILLIMETER, FEET, MILE, METER, KILOMETER, MILS, MICRON, CENTIMETER, MICROINCH.

pyFlightscript.wrapper module

pyFlightscript.wrapper.wrapper_create_local_control()

Create a new wrapping local control.

This function appends a command to the script state to create a new local control for the wrapping process. This allows for defining specific meshing parameters on different parts of the geometry.

Return type:

None

Examples

>>> # Create a new local control for wrapping
>>> wrapper_create_local_control()
pyFlightscript.wrapper.wrapper_delete_all_local_controls()

Delete all wrapper surface controls.

This function appends a command to the script state to remove all existing local controls defined for the wrapping process.

Return type:

None

Examples

>>> # Delete all local wrapping controls
>>> wrapper_delete_all_local_controls()
pyFlightscript.wrapper.wrapper_delete_all_volume_controls()

Delete all wrapper volume controls.

This function appends a command to the script state to remove all existing volume controls defined for the wrapping process.

Return type:

None

Examples

>>> # Delete all volume wrapping controls
>>> wrapper_delete_all_volume_controls()
pyFlightscript.wrapper.wrapper_edit_local_control(control_id, surfaces, target_size)

Edit a wrapping local control.

This function appends a command to the script state to modify an existing local control by specifying the surfaces it applies to and the target triangle edge length.

Return type:

None

Parameters:
  • control_id (int) – The ID of the local control to be edited.

  • surfaces (List[int]) – A list of surface indices to be added to the local control.

  • target_size (float) – The target triangle edge length for this local control.

Examples

>>> # Edit local control 1 to apply to surfaces 3 and 4 with a target size of 0.1
>>> wrapper_edit_local_control(1, [3, 4], 0.1)
pyFlightscript.wrapper.wrapper_execute()

Execute the geometry wrapping operation.

This function appends a command to the script state to initiate the geometry wrapping process based on the previously defined settings.

Return type:

None

Examples

>>> # Execute the wrapping operation
>>> wrapper_execute()
pyFlightscript.wrapper.wrapper_new_volume_control(frame=1, vertex_1=(0.5, 0.3, 1.0), vertex_2=(1.5, 0.6, 2.3), target_size=0.25, name='Airplane_nose')

Create a new wrapping volume control.

This function appends a command to the script state to create a new volume control box for the wrapping process. This allows for refining the mesh size within a specified volume.

Return type:

None

Parameters:
  • frame (int, optional) – The coordinate system ID for the volume control box, by default 1.

  • vertex_1 (Tuple[float, float, float], optional) – The (X, Y, Z) coordinates of the first corner of the volume box, by default (0.5, 0.3, 1.0).

  • vertex_2 (Tuple[float, float, float], optional) – The (X, Y, Z) coordinates of the second corner of the volume box, by default (1.5, 0.6, 2.3).

  • target_size (float, optional) – The target triangle edge length for this volume control, by default 0.25.

  • name (str, optional) – The name of the volume control, by default “Airplane_nose”.

Examples

>>> # Create a new volume control with custom parameters
>>> wrapper_new_volume_control(
...     frame=2,
...     vertex_1=(0.0, 0.0, 0.0),
...     vertex_2=(1.0, 1.0, 1.0),
...     target_size=0.1,
...     name="wing_box"
... )
pyFlightscript.wrapper.wrapper_set_anisotropy(x=2.0, y=1.0, z=1.0)

Set the wrapping anisotropy.

This function appends a command to the script state to define the anisotropy for the wrapping process in the X, Y, and Z directions.

Return type:

None

Parameters:
  • x (float, optional) – The wrapper anisotropy in the X direction, by default 2.0.

  • y (float, optional) – The wrapper anisotropy in the Y direction, by default 1.0.

  • z (float, optional) – The wrapper anisotropy in the Z direction, by default 1.0.

Examples

>>> # Set custom wrapping anisotropy
>>> wrapper_set_anisotropy(x=3.0, y=1.5, z=1.5)
>>> # Use default wrapping anisotropy
>>> wrapper_set_anisotropy()
pyFlightscript.wrapper.wrapper_set_global_size(target_size=0.15)

Set the global target size for the wrapping operation.

This function appends a command to the script state to define the global target edge length for the triangles in the wrapped geometry.

Return type:

None

Parameters:

target_size (float, optional) – The target triangle edge length for the wrapping process, by default 0.15.

Examples

>>> # Set the global target size for wrapping to 0.2
>>> wrapper_set_global_size(0.2)
>>> # Use the default global target size
>>> wrapper_set_global_size()
pyFlightscript.wrapper.wrapper_set_input(num_surfaces, surface_indices)

Set the input surfaces for the wrapping operation.

This function appends a command to the script state to define which geometry surfaces will be used for the wrapping process.

Return type:

None

Parameters:
  • num_surfaces (int) – The number of geometry surfaces to be used for wrapping.

  • surface_indices (List[int]) – A list of the index values for the geometry surfaces.

Examples

>>> # Set three surfaces (indices 1, 2, 5) as input for wrapping
>>> wrapper_set_input(3, [1, 2, 5])
pyFlightscript.wrapper.wrapper_set_vertex_projection(state='ENABLE')

Enable or disable wrapping vertex projection.

This function appends a command to the script state to control whether vertex projection is enabled or disabled during the wrapping process.

Return type:

None

Parameters:

state (RunOptions, optional) – The state of the vertex projection, either ‘ENABLE’ or ‘DISABLE’, by default ‘ENABLE’.

Examples

>>> # Disable wrapping vertex projection
>>> wrapper_set_vertex_projection('DISABLE')
>>> # Enable wrapping vertex projection
>>> wrapper_set_vertex_projection('ENABLE')
pyFlightscript.wrapper.wrapper_transfer(source_treatment='REPLACE')

Transfer the wrapped geometry output.

This function appends a command to the script state to handle the output of the wrapping operation, with an option to either replace the original source geometries or retain them.

Return type:

None

Parameters:

source_treatment (Literal['REPLACE', 'RETAIN'], optional) – Defines how to treat the original source geometries after wrapping. ‘REPLACE’ deletes the original, while ‘RETAIN’ keeps it. By default ‘REPLACE’.

Examples

>>> # Transfer wrapped geometry and retain the original source
>>> wrapper_transfer(source_treatment='RETAIN')
>>> # Transfer wrapped geometry and replace the original source
>>> wrapper_transfer('REPLACE')

Module contents

pyFlightscript.execute_fsm_script(script_path='.\\script_out.txt', fsexe_path=None, hidden=False)

Execute a fligthscript script using the specified script path and FSM executable path.

Parameters:
  • (str) (script_path) – The path to the FSM script file.

  • optional) (fsexe_path (str,) – The path to the FSM executable. If not provided, the function will attempt to retrieve the path from the FS_EXE environment variable. Defaults to None.

Returns:

The result of running the FSM script.

Return type:

subprocess.CompletedProcess

Raises:
  • ValueError – If neither fsexe_path argument nor FS_EXE environment variable is set.

  • FileNotFoundError – If the specified FSM executable file is not found.