PlotManager#

Usage:

PlotManager Class API Wrapper

class PlotManager[source]#

Bases: object

Wrapper for PlotManager class of Moldflow Synergy.

add_default_plots()[source]#

Add all default plots in the study

Returns:

True if successful, False otherwise.

Return type:

bool

apply_anchor_plane(anchor_index, plot)[source]#

Apply an anchor plane to a plot

Parameters:
  • anchor_index (int) – The index of the anchor plane.

  • plot (Plot) – The plot to apply the anchor plane to.

Returns:

True if successful, False otherwise.

Return type:

bool

create_anchor_plane(node_id1, node_id2, node_id3, plane_name)[source]#

Create an anchor plane

Parameters:
  • node_id1 (int) – The first node ID.

  • node_id2 (int) – The second node ID.

  • node_id3 (int) – The third node ID.

  • plane_name (str) – The name of the plane.

Returns:

The total number of anchor plane, -1 if failed

Return type:

int

create_material_plot(mat_database, material_index, property_id)[source]#

Create a material plot

Parameters:
  • mat_database (MaterialDatabase | int) – The material database.

  • material_index (MaterialIndex | int) – The material index.

  • property_id (int) – The property ID.

Returns:

The created material plot.

Return type:

MaterialPlot

create_plot_by_ds_id(ds_id, plot_type)[source]#

Create a plot by dataset ID

Parameters:
  • ds_id (int) – The dataset ID.

  • plot_type (PlotType | int) – The type of the plot.

Returns:

The created plot.

Return type:

Plot

create_plot_by_name(plot_name, is_xy_plot)[source]#

Create a plot by name

Parameters:
  • plot_name (str) – The name of the plot.

  • is_xy_plot (bool) – Whether an XY plot needs to be created

  • plots) ((only if this dataset supports XY)

Returns:

The created plot.

Return type:

Plot

create_user_plot()[source]#

Create a user plot

Returns:

The created user plot.

Return type:

UserPlot

create_xy_plot_by_name(plot_name)[source]#

Create an XY plot by name

Parameters:

plot_name (str) – The name of the plot.

Returns:

The created XY plot.

Return type:

Plot

data_has_xy_plot_by_ds_id(ds_id)[source]#

Check if the data has an XY plot by dataset ID

Parameters:

ds_id (int) – The dataset ID of the plot.

Returns:

True if the data has an XY plot, False otherwise.

Return type:

bool

data_has_xy_plot_by_name(name)[source]#

Check if the data has an XY plot by name

Parameters:

name (str) – The name of the dataset.

Returns:

True if the data has an XY plot, False otherwise.

Return type:

bool

delete_anchor_plane_by_index(anchor_index)[source]#

Delete an anchor plane by index

Parameters:

anchor_index (int) – The index of the anchor plane.

Returns:

True if successful, False otherwise.

Return type:

bool

delete_anchor_plane_by_name(anchor_name)[source]#

Delete an anchor plane by name

Parameters:

anchor_name (str) – The name of the anchor plane.

Returns:

True if successful, False otherwise.

Return type:

bool

delete_plot(plot)[source]#

Delete a plot [You cannot use the plot object after it has been deleted, e.g., as a parameter in the GetNextPlot function]

Parameters:

plot (Plot) – The plot to delete.

Return type:

None

delete_plot_by_ds_id(ds_id)[source]#

Delete a plot by dataset ID

Parameters:

ds_id (int) – The dataset ID of the plot to delete.

Return type:

None

delete_plot_by_name(plot_name)[source]#

Delete a plot by name

Parameters:

plot_name (str) – The name of the plot to delete.

Return type:

None

export_to_sdz(file_name)[source]#

Export the results to a SDZ file

Parameters:

file_name (str) – The name of the SDZ file.

Returns:

True if successful, False otherwise.

Return type:

bool

fbx_export(file_name, geo_list, mesh_list, export_type, wp_scale_factor, sm_scale_factor, unit_sys='')[source]#

Export selected geometry entities with sink mark and/or warp results mapped on them

Parameters:
  • file_name (str) – The name of the FBX file.

  • geo_list (EntList) – The geometry list.

  • mesh_list (EntList) – The mesh list.

  • export_type (int) – The export type.

  • wp_scale_factor (float) – The warp scale factor.

  • sm_scale_factor (float) – The scale factor for the SM.

  • unit_sys (SystemUnits | str) – The unit system to use.

Returns:

True if successful, False otherwise.

Return type:

bool

find_dataset_by_id(ds_id)[source]#

Check whether the result data with the given id exists in the results files

Parameters:

ds_id (int) – The dataset ID.

Returns:

True if the dataset exists, False otherwise.

Return type:

bool

find_dataset_id_by_name(name)[source]#

Find a dataset ID by name

Parameters:

name (str) – The name of the dataset.

Returns:

The dataset ID.

Return type:

int

find_dataset_ids_by_name(name, ds_ids)[source]#

Find all dataset IDs by name

Parameters:
  • name (str) – The name of the dataset.

  • ds_ids (IntegerArray) – The dataset IDs.

Returns:

The number of dataset IDs found.

Return type:

int

find_plot_by_name(plot_name, dataset_name=None)[source]#

Find a plot by name

Parameters:
  • plot_name (str) – The name of the plot.

  • dataset_name (str | None) – The name of the data source.

Returns:

The found plot.

Return type:

Plot

get_anchor_plane_index(anchor_name)[source]#

Get the index of an anchor plane by name

Parameters:

anchor_name (str) – The name of the anchor plane.

Returns:

The index of the anchor, otherwise -1.

Return type:

int

get_anchor_plane_node(anchor_index, node_index)[source]#

Get the anchor plane node ID at given index

Parameters:
  • anchor_index (int) – The index of the anchor plane.

  • node_index (int) – The index of the node.

Returns:

The node ID.

Return type:

int

get_data_display_format(ds_id)[source]#

Get the display data type for a given dataset ID

Parameters:

ds_id (int) – The dataset ID.

Returns:

The display data type string.

Return type:

str

get_data_nb_components(ds_id)[source]#

Get the number of components for a given dataset ID

Parameters:

ds_id (int) – The dataset ID.

Returns:

The number of components. [which could be 1, 3 or 6]

Return type:

int

get_data_type(ds_id)[source]#

Get the data type for a given dataset ID

Parameters:

ds_id (int) – The dataset ID.

Returns:

The data type string, which can be one of the following - LBDT - LYDT - NDDT - ELDT - NMDT - TXDT - HLDT

Return type:

str

get_first_plot()[source]#

Get the first plot

Returns:

The first plot.

Return type:

Plot

get_highlight_data(ds_id, indp_values, highlight_data)[source]#

Get highlight data for a given dataset ID

Parameters:
  • ds_id (int) – The dataset ID.

  • indp_values (DoubleArray) – The independent variable values.

  • highlight_data (DoubleArray) – The highlight data.

Returns:

True if successful, False otherwise.

Return type:

bool

get_indp_values(ds_id, values)[source]#

Get the independent variable values for a given dataset ID

Parameters:
  • ds_id (int) – The dataset ID.

  • values (DoubleArray) – The independent variable values.

Returns:

True if successful, False otherwise.

Return type:

bool

get_indp_var_count(ds_id)[source]#

Get the independent variable count for a given dataset ID

Parameters:

ds_id (int) – The dataset ID.

Returns:

The independent variable count.

Return type:

int

get_next_plot(plot)[source]#

Get the next plot

Parameters:

plot (Plot) – The current plot.

Returns:

The next plot.

Return type:

Plot

get_non_mesh_data(ds_id, indp_values, non_mesh_data)[source]#

Get non-mesh data for a given dataset ID

Parameters:
  • ds_id (int) – The dataset ID.

  • indp_values (DoubleArray) – The independent variable values.

  • non_mesh_data (DoubleArray) – The non-mesh data.

Returns:

True if successful, False otherwise.

Return type:

bool

get_number_of_anchor_planes()[source]#

Get the number of anchor planes

Returns:

The number of anchor planes.

Return type:

int

get_number_of_results_files()[source]#

Get the number of results files

Returns:

The number of results files.

Return type:

int

get_results_file_name(index)[source]#

Get the name of a results file by index

Parameters:

index (int) – The index of the results file.

Returns:

The name of the results file.

Return type:

str

get_scalar_data(ds_id, indp_values, ent_ids, scalar_data)[source]#

Get scalar data for a given dataset ID

Parameters:
  • ds_id (int) – The dataset ID.

  • indp_values (DoubleArray) – The independent variable values.

  • ent_ids (IntegerArray) – The entity IDs.

  • scalar_data (DoubleArray) – The scalar data.

Returns:

True if successful, False otherwise.

Return type:

bool

get_tensor_data(ds_id, indp_values, ent_ids, t11, t22, t33, t12, t13, t23)[source]#

Get tensor data for a given dataset ID

Parameters:
  • ds_id (int) – The dataset ID.

  • indp_values (DoubleArray) – The independent variable values.

  • ent_ids (IntegerArray) – The entity IDs.

  • t11 (DoubleArray) – The 11 component of the tensor data.

  • t22 (DoubleArray) – The 22 component of the tensor data.

  • t33 (DoubleArray) – The 33 component of the tensor data.

  • t12 (DoubleArray) – The 12 component of the tensor data.

  • t13 (DoubleArray) – The 13 component of the tensor data.

  • t23 (DoubleArray) – The 23 component of the tensor data.

Returns:

True if successful, False otherwise.

Return type:

bool

get_vector_data(ds_id, indp_values, ent_ids, va, vb, vc)[source]#

Get vector data for a given dataset ID

Parameters:
  • ds_id (int) – The dataset ID.

  • indp_values (DoubleArray) – The independent variable values.

  • ent_ids (IntegerArray) – The entity IDs.

  • va (DoubleArray) – The X component of the vector data.

  • vb (DoubleArray) – The Y component of the vector data.

  • vc (DoubleArray) – The Z component of the vector data.

Returns:

True if successful, False otherwise.

Return type:

bool

mark_all_results_for_export(export)[source]#

Mark all results for export

Parameters:
  • export (True to) – Whether to export the results.

  • export

  • export. (False to not)

Returns:

True if successful, False otherwise.

Return type:

bool

mark_result_for_export(result_name, export)[source]#

Mark a result for export

Parameters:
  • result_name (str) – The name of the result.

  • export (True to) – Whether to export the result.

  • export

  • export. (False to not)

Returns:

True if successful, False otherwise.

Return type:

bool

mark_result_for_export_by_id(ds_id, export)[source]#

Mark a result for export by dataset ID

Parameters:
  • ds_id (int) – The dataset ID.

  • export (True to) – Whether to export the result.

  • export

  • export. (False to not)

Returns:

True if successful, False otherwise.

Return type:

bool

save_result_data_in_patran(data_id, file_name, unit_sys='')[source]#

Save the result in Patran format.

Parameters:
  • data_id (int) – The result data ID.

  • file_name (str) – The file name to save the result.

  • unit_sys (SystemUnits | str) – The unit system to use.

  • string. (None is treated as empty)

Returns:

True if successful, False otherwise.

Return type:

bool

save_result_data_in_xml(data_id, file_name, unit_sys='')[source]#

Save the result in XML format.

Parameters:
  • data_id (int) – The result data ID.

  • file_name (str) – The file name to save the result.

  • unit_sys (SystemUnits | str) – The unit system to use.

Returns:

True if successful, False otherwise.

Return type:

bool

set_anchor_plane_name(anchor_index, name)[source]#

Set the name of an anchor plane

Parameters:
  • anchor_index (int) – The index of the anchor plane.

  • name (str) – The name of the anchor plane.

Returns:

True if successful, False otherwise.

Return type:

bool

set_anchor_plane_nodes(anchor_index, node_id1, node_id2, node_id3)[source]#

Set the nodes of an anchor plane

Parameters:
  • anchor_index (int) – The index of the anchor plane.

  • node_id1 (int) – The first node ID.

  • node_id2 (int) – The second node ID.

  • node_id3 (int) – The third node ID.

Returns:

True if successful, False otherwise.

Return type:

bool

set_data_display_format(ds_id, format_str)[source]#

Set the display data type for a given dataset ID

Parameters:
  • ds_id (int) – The dataset ID.

  • format_str (str) – The the format string(C-style format string).

Returns:

True if successful, False otherwise.

Return type:

bool

warp_query_begin(ds_id, indp_values)[source]#

Begin the warp query

Parameters:
  • ds_id (int) – The dataset ID.

  • indp_values (DoubleArray) – The independent variable values.

Returns:

True if successful, False otherwise.

Return type:

bool

warp_query_end()[source]#

End the warp query

Returns:

True if successful, False otherwise.

Return type:

bool

warp_query_node(node_id, anchor_index, ret_values)[source]#

Warp query for a node

Parameters:
  • node_id (int) – The node ID.

  • anchor_index (int) – The index of the anchor plane.

  • ret_values (DoubleArray) – The return values.

  • Note

  • specified (If anchor plane is)

  • contains (the return array)

  • values (the return array contains 9 values which are the following)

  • 0 (-- Index) – X, Y, Z coordinates in global coordinate system before deflection

  • 1 – X, Y, Z coordinates in global coordinate system before deflection

  • 2 – X, Y, Z coordinates in global coordinate system before deflection

  • 3 (-- Index) – X, Y, Z coordinates in global coordinate system after deflection

  • 4 – X, Y, Z coordinates in global coordinate system after deflection

  • 5 – X, Y, Z coordinates in global coordinate system after deflection

  • 6 (-- Index) – X, Y, Z coordinates in local coordinate system before deflection

  • 7 – X, Y, Z coordinates in local coordinate system before deflection

  • 8 – X, Y, Z coordinates in local coordinate system before deflection

  • 9 (-- Index) – X, Y, Z coordinates in local coordinate system after deflection

  • 10 – X, Y, Z coordinates in local coordinate system after deflection

  • 11 – X, Y, Z coordinates in local coordinate system after deflection

  • 12 (-- Index) – X, Y, Z displacement components in global coordinate system

  • 13 – X, Y, Z displacement components in global coordinate system

  • 14 – X, Y, Z displacement components in global coordinate system

  • 15 (-- Index) – X, Y, Z displacement components in local coordinate system

  • 16 – X, Y, Z displacement components in local coordinate system

  • 17 – X, Y, Z displacement components in local coordinate system

  • otherwise (-)

  • values

  • 0 – X, Y, Z coordinates in global coordinate system before deflection

  • 1 – X, Y, Z coordinates in global coordinate system before deflection

  • 2 – X, Y, Z coordinates in global coordinate system before deflection

  • 3 – X, Y, Z coordinates in global coordinate system after deflection

  • 4 – X, Y, Z coordinates in global coordinate system after deflection

  • 5 – X, Y, Z coordinates in global coordinate system after deflection

  • 6 – X, Y, Z displacement components in global coordinate system

  • 7 – X, Y, Z displacement components in global coordinate system

  • 8 – X, Y, Z displacement components in global coordinate system

Returns:

True if successful, False otherwise.

Return type:

bool