MaterialSelector#

Usage:

MaterialSelector Class API Wrapper

class MaterialSelector[source]#

Bases: object

Wrapper for MaterialSelector class of Moldflow Synergy.

get_material_file(material)[source]#

Allows the user to query the current material file name of the current study

Parameters:

material (MaterialIndex | int) – 0 to select the material as the first molding material and 1 to select it as the second molding material

Return type:

str

Returns:

Material File Name if successful; “” otherwise

get_material_file_type(material)[source]#

Allows the user to query the current material file type of the current study

Parameters:

material (MaterialIndex | int) – 0 to select the material as the first molding material and 1 to select it as the second molding material

Return type:

str

Returns:

Material File Type if successful; “” otherwise

get_material_index(material)[source]#

Allows the user to query the current material index of the current study

Parameters:

material (MaterialIndex | int) – 0 to select the material as the first molding material and 1 to select it as the second molding material

Return type:

int

Returns:

Material Index if successful; -1 otherwise

select(filename, filetype, index, material)[source]#

Selects a material from a database file

Parameters:
  • filename (str) – material database file name

  • filetype (MaterialDatabaseType | str) – file type, which can be one of the following: “System”: for databases that reside in the “system” database directory, “User”: for databases that reside in the “user” directory, and “”: for databases that reside in neither of the above locations; the last option should be used with caution since scripts written with ‘absolute’ file path names are typically not usable across different versions of the software

  • index (int) – material index in the database that uniquely identifies this material; the easiest way to ascertain the material index is to record a macro that selects the material from the database

  • material (MaterialIndex | int) – 0 to select the material as the first molding material and 1 to select it as the second molding material

Return type:

bool

Returns:

True if successful; False otherwise

select_via_dialog(material, process_id)[source]#

Allows the user to selects a material from a dialog for the current study

Parameters:
  • material (MaterialIndex | int) – 0 to select the material as the first molding material and 1 to select it as the second molding material

  • process_id (int) – process ID of the client application that is requesting the dialog; this is the process ID of the application that is running the script

Return type:

bool

Returns:

True if successful; False otherwise