Engineering Data Favorite Library
The container used by Engineering Data to allow working with a library.
Adds a new material to the container.
Return
The material data reference of the new material.
Required Arguments
Exports engineering data to the specified file.
The following type of file format is supported for export:
| MatML 3.1 schema for Material(s) |
Required Arguments
Optional Arguments
template = GetTemplate(TemplateName="EngData") system = template.CreateSystem(Position="Default") container = system.GetContainer(ComponentName="Engineering Data") materials = container.GetMaterials() EngData.WriteMaterials(MaterialList=materials, FilePath=r"d:\data\OutputMaterials.xml", Format="MatML31", UnitSystem="MKS_STANDARD", ReplaceMaterial=true)
Reads material from ExternalModel
Return
A DataReference for the material that was read.
Required Arguments
Required example does not exist.
Returns a material of a given name from a container.
The name matching is case insensitive. If a material is not found an exception is thrown.
Return The material that matches the specified name. Required Arguments
The following example creates a new Engineering Data system and queries the default material, Structural Steel.
template = GetTemplate(TemplateName="EngData")
system = template.CreateSystem(Position="Default")
container = system.GetContainer(ComponentName="Engineering Data")
structuralSteel = container.GetMaterial(Name="Structural Steel")
Returns the list of materials in a container. If no materials are in the container, the list is empty.
Return
A DataReferenceSet of the materials in the container. Imports engineering data into an existing source from a specified source.
The following types of files are supported for import:
| Engineering Data libraries exported from Workbench 9.0 to 11.0 SP1 |
| Material(s) file following the MatML 3.1 schema |
| Material(s) file generated by AUTODYN |
Required Arguments
Reads the data for a single material into the requested container.
Return
A DataReference for the material that was read.
Required Arguments
This code shows how to read the Copper Alloy material from the provided samples, into Engineering Data to use in an analysis.
installDir = r"C:\Program Files\ANSYS Inc\v121"
matl1 = engineeringData1.ReadMaterial(
Name="Copper Alloy",
Source=installDir+r"\Addins\EngineeringData\Samples\General_Materials.xml")
Saves an Engineering Data library.
Optional Arguments
Entity to store the necessary information for importing delimited data.
List of columns to read in. Leave this unset to import all columns.
Columns=[3,5]
The general property that defines the user-visible name of an entity. This property is defined for all data entities but is used only in those entities that present a label in the user interface.
Name of file to import. File can have one of two formats:
# Format 1 - File contains variable names and units # This information is the experimental data collected from a uniaxial test on a elastomer sample # and was lifted from Hyperelastic Materials sample Elastomer Sample (Mooney-Rivlin) # # Set "Start Import at Line" to 6 Strain, Stress # Variable Names (these correspond to the names shown in the UI) m m^-1, Pa # Unit (these correspond to the unit strings shown in the UI) 0.1338, 494.1474492 # Data point 1 0.2675, 912.7972764 # Data point 2 0.3567, 1172.453938 # Data point 3
# Format 2 - File does not contain variable names and units, these are passed in by using the # VariableNames and VariableUnits parameters # This information is the experimental data collected from a uniaxial test on a elastomer sample # and was lifted from Hyperelastic Materials sample Elastomer Sample (Mooney-Rivlin) # # Set "Start Import at Line" to 7 0.1338, 494.1474492 # Data point 1 0.2675, 912.7972764 # Data point 2 0.3567, 1172.453938 # Data point 3
Line to start importing. Use this if your file has a header you wish to ignore. The line number you set here must correspond to the row in your file with the variable names.
BeginAtLine = 1 -- if the variable names first line of your file.
List of variable names, the list must have the same number of names as columns in the data. If the list is null, it is assumed that the variable names are located in the file at line "BeginAtLine"
The entity to store material information.
The general property that defines the user-visible name of an entity. This property is defined for all data entities but is used only in those entities that present a label in the user interface.
The reference for the material's source file ("*.engd" or "*.xml").
Includes a physical quantity or the constitutive relation for the physical response of a material. A property can be visualized as one or more tables of data made up of one or more dependent and independent variables.
The material property is created based on the specified optional parameters "Definition" and "Behavior".
Return Created material properly. Required Arguments
Optional Arguments
The following example creates a new Engineering Data system and adds Coefficient of Thermal Expansion and Elasticity material properties to the default material Structural Steel.
Coefficient of Thermal Expansion is created using Secant definition and Orthotropic behavior. Elasticity is created using Orthotropic behavior.
ENGDTemplate = GetTemplate(TemplateName="EngData")
ENGDSystem = ENGDTemplate.CreateSystem(Position="Default")
ENGDContainer = ENGDSystem.GetContainer(ComponentName="Engineering Data")
StructSteel = ENGDContainer.GetMaterial(Name="Structural Steel")
# Create material properties
CTEProperty = StructSteel.CreateProperty(
Name="Coefficient of Thermal Expansion",
Definition="Secant",
Behavior="Orthotropic")
OrthoElasProperty = StructSteel.CreateProperty(
Name="Elasticity",
Behavior="Orthotropic")
Duplicates the data in this material and returns a new material. The name of the new material will be appended with a numerical value to make it unique.
Return
The material data reference of the duplicated material.
Required Arguments
Creates a FieldVariableDataObject with the corresponding scope. The scope determines which field variables are tied to the data object
material1 = engineeringData1.GetMaterial(Name="Structural Steel")
// Create FieldVariableDataObject to get/set the field data for all
// "Temperature" field variables in "Structural Steel"
fieldVariableData1 = material1.CreateFieldVariableDataObject(Name="Temperature")
// Set upper and lower limits for all "temperature field variables in "Structural Steel"
fieldVariableData1.LowerLimit = 100
fieldVariableData1.UpperLimit = 300
Return No details are provided for this entry.Required Arguments
Returns a material property of a given name from the specified material.
Return
The material property that matches the specified name. Required Arguments
The following example creates new Engineering Data system and queries Coefficient of Thermal Expansion property of the default material Structural Steel.
ENGDTemplate = GetTemplate(TemplateName="EngData")
ENGDSystem = ENGDTemplate.CreateSystem(Position="Default")
ENGDContainer = ENGDSystem.GetContainer(ComponentName="Engineering Data")
StructSteel = ENGDContainer.GetMaterial(Name="Structural Steel")
# Get material property
CTEProperty = StructSteel.GetProperty(Name="Coefficient of Thermal Expansion")
Checks if an entity is suppressed.
Valid entities are:
| Material |
| Material Property |
| Material Property Data |
Return Returns true if the entity is suppressed, false otherwise. Validates a material data and provides a message in case of invalid data.
Return
The flag that indicates if the material is valid. This will repopulate the contents of a material with data from a given source. The NameInSource property of a Material will be used to find a match in the source to pull data from. In the event that NameInSource is not set, the DisplayName property will be used instead.
Note: This operation will cause destruction of any data currently in the material.
template = GetTemplate(TemplateName="EngData")
system = template.CreateSystem(Position="Default")
container = system.GetContainer(ComponentName="Engineering Data")
structSteel = container.GetMaterial(Name="Structural Steel")
density = structSteel.GetProperty(Name="Density")
density.Delete()
structSteel.UpdateMaterial(Source="General_Materials.xml")
restoredDensity = structSteel.GetProperty(Name="Density")
restoredDensity.SetData(SheetName="", Index=0, Variables=["Density"], Values=[["8000 [kg m^-3]"]])
Required Arguments
Removes an item from the Favorite items list.
Optional Arguments
The following example gets the list of favorites from Engineering Data. It then selects and deletes the "Gray Cast Iron" material from the list.
favorites = EngData.LoadFavoriteItems()
matl = favorites.GetMaterial(Name="Gray Cast Iron")
EngData.DeleteFromFavorites(
Material=matl,
Type="Material")
This will specify the material to use (or not use) for parts in the model which are marked as a fluid.
If the material is in the Engineering Data component it will set or unset the material to be used in the model component of the system(s) that contain this Engineering Data component.
If the material is contained in Favorites it will set or unset the material to use as the default on fluids in the Engineering Data component when a new system is added to the project.
The material is set as the default in Favorites. It will automatically be added to the list of project defaults.
Optional Arguments
This will specify the material to use (or not use) for parts in the model which are marked as a solid.
If the material is in the Engineering Data component it will set or unset the material to be used in the model component of the system(s) that contain this Engineering Data component.
If the material is contained in Favorites it will set or unset the material to use as the default on solids in the Engineering Data component when a new system is added to the project.
The material is set as the default in Favorites. It will automatically be added to the list of project defaults.
Optional Arguments
No details are provided for this entry.
Required Arguments
Required example does not exist.
Suppresses or Unsuppresses item.
Item can be suppressed to prevent it from being sent to a downstream cell in the system.
Following items can be suppressed:
Material
Material property
Material property data
Required Arguments
The entity to store material property information.
A material property is the identifier for the singular information (for example, Density) that together with other properties defines or models the behavior of the material. A property is always defined by at least one table (tabular data), which could be singular. Some properties can contain a collection of tabular data (for example, Isotropic Elasticity).
The string that defines the way in which the material property behaves, e.g., Elasticity has Isotropic, Orthotropic or Anisotropic behavior.
The definition of the material property. Some material properties are defined in different ways, e.g., Thermal Expansion can be defined as Secant Coefficient of Thermal Expansion and Instantaneous Coefficient of Thermal Expansion.
The general property that defines the user-visible name of an entity. This property is defined for all data entities but is used only in those entities that present a label in the user interface.
The collection of tabular data that defines the material property.
Includes experimental test data for response function calculations.
Required Arguments
Marks the start of a series of data modifications to a table of data, to improve performance.
Include an additional property data for a material property. Some properties may have more than one property data to describe the material property.
The preferred method of adding a material property data is to use CreateMaterialProperty.
Return The new material properly data that was created. Required Arguments
Optional Arguments
The following example creates the material property data Orthotropic Secant Coefficient of Thermal Expansion on the material property Coefficient of Thermal Expansion. This example assumes the material Structural Steel has been obtained from the General Materials library.
Get the material property we are going to create a new material property data on.
thermExpansionMatProp = structuralSteel.GetMaterialProperty(Name="Coefficient of Thermal Expansion")
Create the new material property data.
orthoSecantThermExpansionMatPropData = thermExpansionMatProp.CreatePropertyData(
Name="Coefficient of Thermal Expansion",
Definition="Secant",
Behavior="Orthotropic")
Deletes the material property.
Optional Arguments
Delete a row from a tabular data sheet.
Required Arguments
Optional Arguments
The following example illustrates the deletion of a row from a tabular data sheet.
#
# Create a new Engineering Data System and access Structural Steel
#
template1 = GetTemplate(TemplateName="EngData")
system1 = template1.CreateSystem()
engineeringData1 = system1.GetContainer(ComponentName="Engineering Data")
matl1 = engineeringData1.GetMaterial(Name="Structural Steel")
#
# Delete the first row in the Density property
#
matlProp1 = matl1.GetProperty(Name="Density")
matlProp1.DeleteTabularDataRow(Index = 0)
#
# Delete the first row in the Coefficient of Thermal Expansion property with optional SheeetNamea nd SheetQualifiers
#
matlProp2 = matl1.GetProperty(Name="Coefficient of Thermal Expansion")
matlProp2.DeleteTabularDataRow(
SheetName="Coefficient of Thermal Expansion",
SheetQualifiers={"Definition Method": "Secant", "Behavior": "Isotropic"},
Index = 0)
Returns a generated graph data for the specified source data.
Valid source data are:
| Material Property |
| Material Property Data |
Return The graph data for the specified source data. Returns the tabular data associated with the data entity.
Return The returned data in scalar, list, or dictionary format.
Optional Arguments
In this example, all data is requested for the given tabular data entity.
tabData1.GetData()
In this example, all data is requested in row-major order.
tabData1.GetData(ColumnMajor=False)
In this example, all data is requested in dictionary format.
tabData1.GetData(AsDictionary=True)
In this example, data for variables Density and Temperature is requested in dictionary format.
tabData1.GetData(Variables=["Density", "Temperature"], AsDictionary=True)
Returns a property data of the specified material property.
The property data returned is based on specified optional parameters "Definition" and "Behavior".
Return The material property data that matches specified type name, definition and behavior. Required Arguments
Optional Arguments
The following example creates new Engineering Data system and queries Coefficient of Thermal Expansion property data of the default material Structural Steel.
ENGDTemplate = GetTemplate(TemplateName="EngData")
ENGDSystem = ENGDTemplate.CreateSystem(Position="Default")
ENGDContainer = ENGDSystem.GetContainer(ComponentName="Engineering Data")
StructSteel = ENGDContainer.GetMaterial(Name="Structural Steel")
#Get material property
CTEProperty = StructSteel.GetProperty(Name="Coefficient of Thermal Expansion")
# Get material property data
CTEPropData = CTEProperty.GetPropertyData(
Name="Coefficient of Thermal Expansion",
Definition="Secant",
Behavior="Isotropic")
RefTempPropData = CTEProperty.GetPropertyData(
Name="Reference Temperature",
Definition="Secant",
Behavior="Isotropic")
Checks if an entity is suppressed.
Valid entities are:
| Material |
| Material Property |
| Material Property Data |
Return Returns true if the entity is suppressed, false otherwise. Validates a material property and provides a message in case of invalid data.
Return The flag that indicates if the material property is valid. Required Arguments
Excludes experimental test data for response function calculations.
Required Arguments
Set tabular data associated with the data entity.
Optional Arguments
#
# Create a new Engineering Data System and access Structural Steel
#
template1 = GetTemplate(TemplateName="EngData")
system1 = template1.CreateSystem()
engineeringData1 = system1.GetContainer(ComponentName="Engineering Data")
matl1 = engineeringData1.GetMaterial(Name="Structural Steel")
#
# Change the value of a simple single-valued property
#
matlProp1 = matl1.GetProperty(Name="Density")
matlProp1.SetData(
Variables="Density",
Values="8500 [kg m^-3]")
#
# Set Temperature-dependent data for Elasticity based
# on lists of variables and values.
matlProp2 = matl1.GetProperty(Name="Elasticity")
temperature = ["400 [K]", "600 [K]", "800 [K]"]
E = ["2e5 [MPa]", "1.9e5 [MPa]", "1.6e5 [MPa]"]
matlProp2.SetData(
Variables = ["Temperature","Young's Modulus"],
Values = [temperature, E])
#
# Change the Temperature for the second table entry.
#
matlProp2.SetData(
Index = 1,
Variables = "Temperature",
Values = "625 [K]")
#
# Set a list for Poisson's Ratio starting at the second table entry.
#
matlProp2.SetData(
Index = 1,
Variables = "Poisson's Ratio",
Values = [0.3, 0.3])
#
# Set Temperature-dependent property data for the Coefficient of Thermal Expansion
# using a dictionary. The dictionary key is the Variable name,
# followed by the list of values for the variable.
#
matlProp3 = matl1.GetProperty(Name="Coefficient of Thermal Expansion")
newData = {"Temperature": ["200 [F]","400 [F]","600 [F]","800 [F]","1000 [F]"],
"Coefficient of Thermal Expansion" : ["6.3e-6 [F^-1]", "7.0e-6 [F^-1]",
"7.46e-6 [F^-1]", "7.8e-6 [F^-1]",
"8.04e-6 [F^-1]"]}
matlProp3.SetData(
SheetName="Coefficient of Thermal Expansion",
SheetQualifiers={"Definition Method": "Secant", "Behavior": "Isotropic"},
Data = newData)
Changes the values of a specifiec qualifier in a data table.
Optional Arguments
The following example changes the 'Derive From' setting within an Isotropic Elasticity material property to be "Bulk Modulus and Poisson's Ratio".
matl1 = engineeringData1.GetMaterial(Name="Structural Steel")
matlProp1 = matl1.GetProperty(Name="Elasticity")
matlProp1.SetQualifier(
SheetName="Elasticity",
Qualifier="Derive from",
Value="Bulk Modulus and Poisson's Ratio")
Suppresses or Unsuppresses item.
Item can be suppressed to prevent it from being sent to a downstream cell in the system.
Following items can be suppressed:
Material
Material property
Material property data
Required Arguments
The entity to store material property (tabular) data information. The material property data is a collection of material variable data.
The behavior of the material variable tabular data. Some material properties can have different behavior, e.g., Elasticity has Isotropic, Orthotropic or Anisotropic behavior.
The definition of the material variable tabular data. Some material properties are defined in different ways, e.g., Thermal Expansion can be defined as Secant Coefficient of Thermal Expansion and Instantaneous Coefficient of Thermal Expansion.
The collection of dependent variables in the material variable tabular data, e.g., Density.
The general property that defines the user-visible name of an entity. This property is defined for all data entities but is used only in those entities that present a label in the user interface.
The collection of independent variables in the material variable tabular data, e.g., Temperature.
The primary independent variable in the material variable tabular data, e.g., Temperature.
The number of data values for a variable in the material variable tabular data.
The collection of variables in the material variable tabular data.
Marks the start of a series of data modifications to a table of data, to improve performance.
Creates a curve fitting for a given property data.
Return
The curve fitting.
Required Arguments
The following example loads a material with experimental test data and a Neo-Hookean hyperelastic property.
template = GetTemplate(TemplateName="EngData")
system = template.CreateSystem()
engineeringData = system.GetContainer(ComponentName="Engineering Data")
neopreneRubber = engineeringData.ReadMaterial(
Name="Neoprene Rubber",
Source="Hyperelastic_Materials.xml")
neoHookeanProperty = neopreneRubber.GetProperty(Name="Neo-Hookean")
neoHookeanPropertyData = neoHookeanProperty.GetPropertyData(Name="Neo-Hookean")
curveFit = neoHookeanPropertyData.CreateCurveFitting(
Type="Neo-Hookean",
Definition="")
uniaxialProperty = neopreneRubber.GetProperty(Name="Uniaxial Test Data")
curveFit.AddTestData(TestData=uniaxialProperty)
biaxialProperty = neopreneRubber.GetProperty(Name="Biaxial Test Data")
curveFit.AddTestData(TestData=biaxialProperty)
shearProperty = neopreneRubber.GetProperty(Name="Shear Test Data")
curveFit.AddTestData(TestData=shearProperty)
volumetricProperty = neopreneRubber.GetProperty(Name="Volumetric Test Data")
curveFit.AddTestData(TestData=volumetricProperty)
curveFit.RemoveTestData(TestData=uniaxialProperty)
curveFit.AddTestData(TestData=uniaxialProperty)
curveFit.Solve()
curveFit.CopyCoefficients(Destination=neoHookeanPropertyData)
curveFit.Delete()
Create a data provider for a give format. The only data provider currently supported is for Delimited Text (used to import tabular data from a delimited data file).
Return
No details are provided for this entry.Required Arguments
Include an additional variable in the property data for a material property.
Return
The new variable data that was created. Required Arguments
Optional Arguments
Required example does not exist.
Returns a generated graph data for the specified source data.
Valid source data are:
| Material Property |
| Material Property Data |
Return The graph data for the specified source data. Query to return the DataReference to the CurveFit used by some PropertyData.
Return
CurveFit DataReference
Creates a FieldVariableDataObject with the corresponding scope. The scope determines which field variables are tied to the data object
material1 = engineeringData1.GetMaterial(Name="Structural Steel")
// Create FieldVariableDataObject to get/set the field data for all
// "Temperature" field variables in "Structural Steel"
fieldVariableData1 = material1.CreateFieldVariableDataObject(Name="Temperature")
// Set upper and lower limits for all "temperature field variables in "Structural Steel"
fieldVariableData1.LowerLimit = 100
fieldVariableData1.UpperLimit = 300
Return No details are provided for this entry.Required Arguments
Returns a material variable of a given name from a material property data.
Return
The requested variable. Required Arguments
The following example creates new Engineering Data system and queries Coefficient of Thermal Expansion property data of the default material Structural Steel.
ENGDTemplate = GetTemplate(TemplateName="EngData")
ENGDSystem = ENGDTemplate.CreateSystem(Position="Default")
ENGDContainer = ENGDSystem.GetContainer(ComponentName="Engineering Data")
StructSteel = ENGDContainer.GetMaterial(Name="Structural Steel")
# Get material
CTEProperty = StructSteel.GetProperty(Name="Coefficient of Thermal Expansion")
# Get material property data
CTEPropData = CTEProperty.GetPropertyData(
Name="Coefficient of Thermal Expansion",
Definition="Secant",
Behavior="Isotropic")
# Get material variable
CTEVariable = CTEPropData.GetVariable(
Name="Coefficient of Thermal Expansion")
Checks if an entity is suppressed.
Valid entities are:
| Material |
| Material Property |
| Material Property Data |
Return Returns true if the entity is suppressed, false otherwise. Validates a material property data and provides a message in case of invalid data.
Return
The flag that indicates if the material property data is valid. Required Arguments
Suppresses or Unsuppresses item.
Item can be suppressed to prevent it from being sent to a downstream cell in the system.
Following items can be suppressed:
Material
Material property
Material property data
Required Arguments
The entity to store material variable information.
The flag that indicates if the material variable is dependent, e.g., Density is temperature dependent.
The unit of the lower bound data value in the material variable data.
The collection of unique data values in the material variable data.
The unit of the upper bound data value in the material variable data.
Validates a material variable data and provides a message in case of invalid data.
Return
The flag that indicates if the material variable is valid. Required Arguments
template = GetTemplate(TemplateName="EngData") system = template.CreateSystem(Position="Default") container = system.GetContainer(ComponentName="Engineering Data") structSteel = container.GetMaterial(Name="Structural Steel") CTEProp = structSteel.GetProperty(Name="Coefficient of Thermal Expansion") CTEPropData = CTEProperty.GetPropertyData( Name="Coefficient of Thermal Expansion", Definition="Secant", Behavior="Isotropic") CTEVariable = CTEPropData.GetVariable( Name="Coefficient of Thermal Expansion") valid = EngData.ValidateMaterialVariable(MaterialVariable=CTEVariable, Material=structSteel, MaterialPropertyData=CTEPropdata)