Engineering Data
Engineering Data
The container used by an Engineering Data component to maintain project data.
Methods
AddToProjectDefaults
Adds an item, to the list of items, that will be added to new projects by default.
The item must be a favorite before it can be added to project defaults.
Required Arguments
- Source The source of material to be added to the project defaults.
- Type string
Optional Arguments
- ItemType The EngineeringDataType of the item. This can be Material, Load, or BeamSection.
- Type string
- Default Value Material
- Example
The following example shows how to add a material named Concrete to the project defaults.
installDir = r"C:\Program Files\ANSYS Inc\v121" EngData.AddToProjectDefaults(Name="Concrete", Source=installDir+r"\Addins\EngineeringData\Samples\General_Materials.xml" ItemType="Material")
CreateMaterial
Adds a new material to the container.
-
Return
The material data reference of the new material. - Type DataReference
Required Arguments
- Name The name to be used for this material.
- Type string
Export
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
- ApplyScaleOffset The flag to specify if the scale factor and offset value will be applied during export.
- Type bool
- Default Value False
- IgnoreSuppressed The flag to specify if suppressed engineering data will be ignored during export.
- Type bool
- Default Value False
- OverwriteTarget The flag to specify if the target file will be overwritten.
- Type bool
- Default Value False
- ReplaceMaterial The flag to specify if the earlier material data will be replaced in case of similar material names.
- Type bool
- Default Value False
- Example
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)
GetMaterial
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.- Type DataReference
Required Arguments
- Name The name of the material. This argument is case insensitive.
- Type string
- Example
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")
GetMaterials
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. - Type DataReferenceSet
Import
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
- Source The source which contains the materials.
- Type string
ImportMaterial
Reads the data for a single material into the requested container.
-
Return
A DataReference for the material that was read. - Type DataReference
Required Arguments
- Example
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")
RemoveFromProjectDefaults
Removes an item, from the list of items, that are added to new projects by default.
Required Arguments
- Source The path to the file containing the item to remove.
- Type string
Optional Arguments
- ItemType The EngineeringDataType of the item. This can be Material, Load, or BeamSection.
- Type string
- Default Value Material
- Example
The following example shows how to remove Concrete from project defaults.
installDir = r"C:\Program Files\ANSYS Inc\v121" EngData.RemoveFromProjectDefaults(Name="Concrete", Source=installDir+r"\Addins\EngineeringData\Samples\General_Materials.xml" ItemType="Material")
Data Entities
CurveFit
The entity to store curve fitting information.
Properties
CurveFitData
The coefficients of material model that approximates the experimental test data.
- Type DataReference
- Read Only No
DependentPropertyColl
The collection of experimental test data, e.g., Uniaxial Test data (Engineering Strain Vs Engineering Stress).
- Type DataReferenceSet
- Read Only No
DisplayText
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.
- Type string
- Read Only No
Methods
AddTestData
Adds test data from a given curve fitting.
Required Arguments
- TestData The test data property to add.
- Type DataReference
- Example
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()
CopyCoefficients
Copies the fitted coefficients from the curve fitting to the property data provided.
Required Arguments
- Destination The property data that will receive the coefficients.
- Type DataReference
- Example
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()
Delete
Deletes a curve fitting.
- Example
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()
GetChartData
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.- Type Dictionary<string, Object>
RemoveTestData
Removes test data from a given curve fitting.
Required Arguments
- TestData The test data property to add.
- Type DataReference
- Example
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()
CurveFitData
The entity which contains data relevant to the curve fitting solution. It is possible to call GetData on this
entity after the curve fitting solution to determine coefficients. Also for nonlinear fits the seed values
can be set via this entity.
Properties
DisplayText
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.
- Type string
- Read Only No
Methods
DeleteData
Delete a row from a tabular data sheet.
Required Arguments
- Index Index of the row to delete.
- Type int
Optional Arguments
- SheetName Name of the sheet to access.
- Type string
- SheetQualifiers SheetQualifiers is used to pass in the qualifiers to select between multiple sheets witht the same name. This is a dictionary of the Qualifier and its Value.
- Type Dictionary<string, string>
- Example
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") DeleteTabularDataRow(matlProp1, Index = 0) # # Delete the first row in the Coefficient of Thermal Expansion property with # optional SheeetName and SheetQualifiers # matlProp2 = matl1.GetProperty(Name="Coefficient of Thermal Expansion") DeleteTabularDataRow(matlProp2, SheetName="Coefficient of Thermal Expansion", SheetQualifiers={"Definition Method": "Secant", "Behavior": "Isotropic"}, Index = 0)
GetData
Returns the tabular data associated with the data entity.
Return
The returned data in scalar, list, or dictionary format.- Type Object
Optional Arguments
- AsDictionary If set to true, the data will be returned as a dictionary where the keys are variable names and the values are the data for each variable. If set to false, the data will be returned in scalar or list format without the variable names.
- Type bool
- Default Value False
- ColumnMajor If set to true, the data will be returned in column-major order. If set to false, the data will be returned in row-major order.
- Type bool
- Default Value True
- EndIndex The end index for requesting a subset of the data (zero-based).
- Type int
- Default Value -2147483647
- SheetName Specifies the sheet name when the data contains multiple sheets.
- Type string
- SheetQualifiers Used to pass in the qualifiers to select between multiple sheets with the same name. This is a dictionary of qualifiers and values.
- Type Dictionary<string, string>
- StartIndex The start index for requesting a subset of the data (zero-based).
- Type int
- Default Value 0
- Variables Names of the variables for which data is requested (string or list of strings).
- Type Object
- Example
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)
SetData
Set tabular data associated with the data entity.
Optional Arguments
- Data Sets the data using a dictionary form. The keys are the variable names and the values are the data. The use of this argument is mutually exclusive with "Values" and "Variables".
- Type Dictionary<string, List<Object>>
- Index Specifies the starting location used to set the data (zero-based). A value of -1 indicates that the data should be appended to the existing data.
- Type int
- Default Value 0
- SheetName Specifies the sheet name when the data contains multiple sheets.
- Type string
- SheetQualifiers Used to pass in the qualifiers to select between multiple sheets with the same name. This is a dictionary of qualifiers and values.
- Type Dictionary<string, string>
- Values List of data values set in conjunction with the "Variables" parameter. This parameter and the "Data" parameter are mutually exclusive.
- Variables Names of the variables for which data is being set. This parameter and and the "Data" parameter are mutually exclusive.
- Example
# # 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") SetTabularData(matlProp1, 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]"] SetTabularData(matlProp2, Variables = ["Temperature","Young's Modulus"], Values = [temperature, E]) # # Change the Temperature for the second table entry. # SetTabularData(matlProp2, Index = 1, Variables = "Temperature", Values = "625 [K]") # # Set a list for Poisson's Ratio starting at the second table entry. # SetTabularData(matlProp2, 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]"]} SetTabularData(matlProp3, SheetName="Coefficient of Thermal Expansion", SheetQualifiers={"Definition Method": "Secant", "Behavior": "Isotropic"}, Data = newData)
SetQualifier
Changes the values of a specifiec qualifier in a data table.
Optional Arguments
- SheetName The name of the tabular data sheet that contains the qualifier.
- Type string
- SheetQualifiers SheetQualifiers can be used to pass in the qualifiers to select between multiple sheets witht the same name. This is a dictionary of the Qualifier and its Value.
- Type Dictionary<string, string>
- VariableName The name of the Variable that contains the qualifier to be changed.
- Type string
- VariableQualifiers VariableQualifiers can used to pass in the qualifiers to select between multiple variables witht the same name. This is a dictionary of the Qualifier and its Value.
- Type Dictionary<string, string>
- Example
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") SetTabularDataQualifier(matlProp1, SheetName="Elasticity", Qualifier="Derive from", Value="Bulk Modulus and Poisson's Ratio")
DelimitedDataObject
Entity to store the necessary information for importing delimited data.
Properties
Columns
List of columns to read in. Leave this unset to import all columns.
Columns=[3,5]
DisplayText
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.
- Type string
- Read Only No
FileName
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
- Type string
- Read Only No
ReadLine
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.
- Type int
- Read Only No
VariableNames
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"
Methods
FieldVariableDataObject
The FieldVariableDataObject is used to get/set the properties of one field variable, or a group of field variables (all with the same name and quantity type).
Properties
DataString
Get or set the default data to be used in the interpolation algorithm if this field variable isn't defined.
- Type string
- Read Only No
DisplayText
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.
- Type string
- Read Only No
LowerLimitString
Get or set the lower limits of the field variable, and is used to validate the field variable data. This value is also used by the interpolation algorithm during normalization.
- Type string
- Read Only No
UpperLimitString
Get or set the upper limits of the field variable, and is used to validate the field variable data. This value is also used by the interpolation algorithm during normalization.
- Type string
- Read Only No
Material
The entity to store material information.
Properties
DisplayText
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.
- Type string
- Read Only No
SourceFileReference
The reference for the material's source file ("*.engd" or "*.xml").
- Type DataReference
- Read Only Yes
Methods
CreateProperty
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.- Type DataReference
Required Arguments
- Name The new material property name.
- Type string
Optional Arguments
- Behavior The optional string to identify the way in which a new material property will behave.
- Behavior of some material properties can be specified in different ways, e.g., Elasticity can be specified as Isotropic, Orthotropic or Anisotropic.
- Type string
- CustomData The optional dictionary of custom data. A non-null dictionary designates the material property as custom and not located in the Engineering Data Metadata.
- Type Dictionary<string, string>
- Definition The optional string to identify the way in which new material property will be defined.
- 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.
- Type string
- Qualifiers The optional dictionary of a qualifier name and it's corresponding value.
- Type Dictionary<string, string>
- Example
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")
Duplicate
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. - Type DataReference
Required Arguments
- TargetContainer The duplicated material will be added to this container.
GetFieldVariableDataObject
Gets a FieldVariableDataObject from the specified parent. The parent determines which field variables are tied to the data object
-
Return
DataReference of the field variable. - Type DataReference
Required Arguments
- Name Name of the field variable.
- Type string
- Example
template1 = GetTemplate(TemplateName="EngData") system1 = template1.CreateSystem() engineeringData1 = system1.GetContainer(ComponentName="Engineering Data") structuralSteel = engineeringData1.GetMaterial(Name="Structural Steel") temperature = structuralSteel.GetFieldVariableDataObject(Name="Temperature")
GetProperty
Returns a material property of a given name from the specified material.
-
Return
The material property that matches the specified name. - Type DataReference
Required Arguments
- Name The name of the material property.
- Type string
- Example
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")
IsSuppressed
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.- Type bool
IsValid
Validates a material data and provides a message in case of invalid data.
-
Return
The flag that indicates if the material is valid. - Type bool
Refresh
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
- Source The path of the source file.
- Type string
RemoveFromFavorites
Removes an item from the Favorite items list.
Optional Arguments
- Format The format of the file that contains the item.
- Type string
- Material A DataReference to the Material to delete.
- Type DataReference
- Name The name of the item to delete.
- Type string
- Source The location of the file that contains the item on disk.
- Type string
- Type The type of the object to delete. This is either a Material or a Mixture.
- Type EngineeringDataType
- Example
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")
SetAsDefaultFluidForModel
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
- Default This Boolean is used to set or unset the material as the default.
- Type bool
- Default Value True
SetAsDefaultSolidForModel
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
- Default This Boolean is used to set or unset the material as the default.
- Type bool
- Default Value True
SetColor
Add a new 'Color' property in a material.
Required Arguments
- Example
template1 = GetTemplate(TemplateName="EngData") system1 = template1.CreateSystem() engineeringData1 = system1.GetContainer(ComponentName="Engineering Data") structuralSteel = engineeringData1.GetMaterial(Name="Structural Steel") structuralSteel.SetColor(Material="strucutralSteel", Red="255", Green="0", Blue="0")
SetSuppression
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
- Suppressed The flag to specify if the item should be suppressed or unsuppressed.
- Type bool
MaterialProperty
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).
Properties
Behavior
The string that defines the way in which the material property behaves, e.g., Elasticity has Isotropic, Orthotropic or Anisotropic behavior.
- Type string
- Read Only No
Definition
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.
- Type string
- Read Only No
DisplayText
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.
- Type string
- Read Only No
PropertyDataColl
The collection of tabular data that defines the material property.
- Type DataReferenceSet
- Read Only Yes
Methods
AddTestData
Includes experimental test data for response function calculations.
Required Arguments
- TestData The test data property to add.
- Type DataReference
BeginBatchUpdate
Marks the start of a series of data modifications to a table of data, to improve performance.
CreatePropertyData
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.- Type DataReference
Required Arguments
- Name The new material property data name.
- Type string
Optional Arguments
- Behavior A string to identify how the new material property data will behave.
- The behavior of some material properties can be specified in different ways, e.g., Elasticity can be specified as Isotropic, Orthotropic or Anisotropic.
- Type string
- CustomData The optional dictionary of custom data. A non-null dictionary designates the material property as custom and not located in the Engineering Data Metadata.
- Type Dictionary<string, string>
- Definition A string to identify how the new material property data will be defined.
- 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.
- Type string
- Qualifiers The optional dictionary of a qualifier name and it's corresponding value.
- Type Dictionary<string, string>
- Example
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")
Delete
Deletes the material property.
Optional Arguments
- Behavior The optional string to specify the material property behavior.
- Behavior of some material properties can be specified in different ways e.g. Elasticity can be specified as Isotropic, Orthotropic or Anisotropic.
- Type string
- Definition The optional string to specify the material property definition.
- 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.
- Type string
DeleteData
Delete a row from a tabular data sheet.
Required Arguments
- Index Index of the row to delete.
- Type int
Optional Arguments
- SheetName Name of the sheet to access.
- Type string
- SheetQualifiers SheetQualifiers is used to pass in the qualifiers to select between multiple sheets witht the same name. This is a dictionary of the Qualifier and its Value.
- Type Dictionary<string, string>
- Example
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") DeleteTabularDataRow(matlProp1, Index = 0) # # Delete the first row in the Coefficient of Thermal Expansion property with # optional SheeetName and SheetQualifiers # matlProp2 = matl1.GetProperty(Name="Coefficient of Thermal Expansion") DeleteTabularDataRow(matlProp2, SheetName="Coefficient of Thermal Expansion", SheetQualifiers={"Definition Method": "Secant", "Behavior": "Isotropic"}, Index = 0)
GetChartData
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.- Type Dictionary<string, Object>
GetData
Returns the tabular data associated with the data entity.
Return
The returned data in scalar, list, or dictionary format.- Type Object
Optional Arguments
- AsDictionary If set to true, the data will be returned as a dictionary where the keys are variable names and the values are the data for each variable. If set to false, the data will be returned in scalar or list format without the variable names.
- Type bool
- Default Value False
- ColumnMajor If set to true, the data will be returned in column-major order. If set to false, the data will be returned in row-major order.
- Type bool
- Default Value True
- EndIndex The end index for requesting a subset of the data (zero-based).
- Type int
- Default Value -2147483647
- SheetName Specifies the sheet name when the data contains multiple sheets.
- Type string
- SheetQualifiers Used to pass in the qualifiers to select between multiple sheets with the same name. This is a dictionary of qualifiers and values.
- Type Dictionary<string, string>
- StartIndex The start index for requesting a subset of the data (zero-based).
- Type int
- Default Value 0
- Variables Names of the variables for which data is requested (string or list of strings).
- Type Object
- Example
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)
GetPropertyData
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.- Type DataReference
Required Arguments
- Name The material property data type name.
- Type string
Optional Arguments
- Behavior The optional string to specify the material property data behavior.
- Behavior of some material properties can be specified in different ways, e.g., Elasticity can be specified as Isotropic, Orthotropic or Anisotropic.
- Type string
- Definition The optional string to specify the material property data definition.
- 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.
- Type string
- Qualifiers The optional dictionary of a qualifier name and it's corresponding value.
- Type Dictionary<string, string>
- Example
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")
IsSuppressed
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.- Type bool
IsValid
Validates a material property and provides a message in case of invalid data.
Return
The flag that indicates if the material property is valid.- Type bool
Required Arguments
- Material The parent material of the property.
- Type DataReference
RemoveTestData
Excludes experimental test data for response function calculations.
Required Arguments
- TestData The test data property to add.
- Type DataReference
SetData
Set tabular data associated with the data entity.
Optional Arguments
- Data Sets the data using a dictionary form. The keys are the variable names and the values are the data. The use of this argument is mutually exclusive with "Values" and "Variables".
- Type Dictionary<string, List<Object>>
- Index Specifies the starting location used to set the data (zero-based). A value of -1 indicates that the data should be appended to the existing data.
- Type int
- Default Value 0
- SheetName Specifies the sheet name when the data contains multiple sheets.
- Type string
- SheetQualifiers Used to pass in the qualifiers to select between multiple sheets with the same name. This is a dictionary of qualifiers and values.
- Type Dictionary<string, string>
- Values List of data values set in conjunction with the "Variables" parameter. This parameter and the "Data" parameter are mutually exclusive.
- Variables Names of the variables for which data is being set. This parameter and and the "Data" parameter are mutually exclusive.
- Example
# # 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") SetTabularData(matlProp1, 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]"] SetTabularData(matlProp2, Variables = ["Temperature","Young's Modulus"], Values = [temperature, E]) # # Change the Temperature for the second table entry. # SetTabularData(matlProp2, Index = 1, Variables = "Temperature", Values = "625 [K]") # # Set a list for Poisson's Ratio starting at the second table entry. # SetTabularData(matlProp2, 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]"]} SetTabularData(matlProp3, SheetName="Coefficient of Thermal Expansion", SheetQualifiers={"Definition Method": "Secant", "Behavior": "Isotropic"}, Data = newData)
SetQualifier
Changes the values of a specifiec qualifier in a data table.
Optional Arguments
- SheetName The name of the tabular data sheet that contains the qualifier.
- Type string
- SheetQualifiers SheetQualifiers can be used to pass in the qualifiers to select between multiple sheets witht the same name. This is a dictionary of the Qualifier and its Value.
- Type Dictionary<string, string>
- VariableName The name of the Variable that contains the qualifier to be changed.
- Type string
- VariableQualifiers VariableQualifiers can used to pass in the qualifiers to select between multiple variables witht the same name. This is a dictionary of the Qualifier and its Value.
- Type Dictionary<string, string>
- Example
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") SetTabularDataQualifier(matlProp1, SheetName="Elasticity", Qualifier="Derive from", Value="Bulk Modulus and Poisson's Ratio")
SetSuppression
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
- Suppressed The flag to specify if the item should be suppressed or unsuppressed.
- Type bool
MaterialPropertyData
The entity to store material property (tabular) data information. The material property data is a collection of material variable data.
Properties
Behavior
The behavior of the material variable tabular data. Some material properties can have different behavior, e.g., Elasticity has Isotropic, Orthotropic or Anisotropic behavior.
- Type string
- Read Only No
Definition
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.
- Type string
- Read Only No
DependentColl
The collection of dependent variables in the material variable tabular data, e.g., Density.
- Type DataReferenceSet
- Read Only Yes
DisplayText
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.
- Type string
- Read Only No
IndependentColl
The collection of independent variables in the material variable tabular data, e.g., Temperature.
- Type DataReferenceSet
- Read Only Yes
PrimaryIndependent
The primary independent variable in the material variable tabular data, e.g., Temperature.
- Type DataReference
- Read Only Yes
RowsCount
The number of data values for a variable in the material variable tabular data.
- Type int
- Read Only Yes
VariableColl
The collection of variables in the material variable tabular data.
- Type DataReferenceSet
- Read Only Yes
Methods
BeginBatchUpdate
Marks the start of a series of data modifications to a table of data, to improve performance.
CreateCurveFitting
Creates a curve fitting for a given property data.
-
Return
The curve fitting. - Type DataReference
Required Arguments
- Definition The definition of curve fitting to create. This must be a definition that is supported by an engineering data curve fitting.
- i.e. 1 Parameter, 2 Parameter, 1st Order, 2nd Order
- Type string
- Type The type of curve fitting to create. This must be a type that is supported by an engineering data curve fitting.
- i.e. Neo-Hookean, Mooney-Rivlin, Ogden, Yeoh, Polynomial
- Type string
- Example
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()
CreateDataProvider
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
DataReference of the DelimitedDataObject - Type DataReference
Required Arguments
- Format Format of provider (only supported option is "Delimited Text")
- Type string
- Example
material1 = engineeringData1.GetMaterial(Name="Structural Steel") matlProp1 = material1.GetProperty(Name="Coefficient of Thermal Expansion") materialPropertyData1 = matlProp1.GetPropertyData( Name="Coefficient of Thermal Expansion", Qualifiers={"Definition": "Secant", "Behavior": "Isotropic"}) dataProvider1 = materialPropertyData1.CreateDataProvider(Format="Delimited Text") dataProvider1.FileName = r"C:\Coefficient_of_thermal_expansion.csv" dataProvider1.ReadLine = 2 dataProvider1.Columns = [1, 2] dataProvider1.Delimiter = "," dataProvider1.VariableNames = ["Temperature", "Coefficient of Thermal Expansion"] dataProvider1.VariableUnits = ["C", "C^-1"] dataProvider1.Import()
CreateVariable
Include an additional variable in the property data for a material property.
-
Return
The new variable data that was created. - Type DataReference
Required Arguments
- Name The new variable data name.
- Type string
Optional Arguments
- CustomData The optional dictionary of custom data. A non-null dictionary designates the material property as custom and not located in the Engineering Data Metadata.
- Type Dictionary<string, string>
- Qualifiers The optional dictionary of a qualifier name and it's corresponding value.
- Type Dictionary<string, string>
- Example
material1 = engineeringData1.GetMaterial(Name="Structural Steel") matlProp1 = material1.CreateProperty( Name="Custom Model", Qualifiers={"UserMat": "USER"}, CustomData={}) matlPropData1 = matlProp2.CreatePropertyData( Name="Model State Variables", Qualifiers={"UserMat": "STATE"}, CustomData={}) PropertyDataVariable1 = matlPropData1.CreateVariable( Name="User Variable", Qualifiers={"Display": "True", "UserMat Constant": "1"}, CustomData={"Quantity Type": "Dimensionless", "Data": "0", "Independent": "False"})
GetChartData
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.- Type Dictionary<string, Object>
GetCurveFitting
Query to return the DataReference to the CurveFit used by some PropertyData.
-
Return
CurveFit DataReference - Type DataReference
GetFieldVariableDataObject
Gets a FieldVariableDataObject from the specified parent. The parent determines which field variables are tied to the data object
-
Return
DataReference of the field variable. - Type DataReference
Required Arguments
- Name Name of the field variable.
- Type string
- Example
template1 = GetTemplate(TemplateName="EngData") system1 = template1.CreateSystem() engineeringData1 = system1.GetContainer(ComponentName="Engineering Data") structuralSteel = engineeringData1.GetMaterial(Name="Structural Steel") temperature = structuralSteel.GetFieldVariableDataObject(Name="Temperature")
GetVariable
Returns a material variable of a given name from a material property data.
-
Return
The requested variable. - Type DataReference
Required Arguments
- Name The name of the variable.
- Type string
- Example
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")
IsSuppressed
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.- Type bool
IsValid
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. - Type bool
Required Arguments
- Material The parent material of the material property data.
- Type DataReference
SetSuppression
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
- Suppressed The flag to specify if the item should be suppressed or unsuppressed.
- Type bool
MaterialVariable
The entity to store material variable information.
Properties
IsDependent
The flag that indicates if the material variable is dependent, e.g., Density is temperature dependent.
- Type bool
- Read Only No
LowerBoundUnit
The unit of the lower bound data value in the material variable data.
- Type string
- Read Only No
UniqueData
The collection of unique data values in the material variable data.
- Type DataReferenceSet
- Read Only No
UpperBoundUnit
The unit of the upper bound data value in the material variable data.
- Type string
- Read Only No
Methods
IsValid
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. - Type bool
Required Arguments
- Material The parent material of the variable.
- Type DataReference
- MaterialPropertyData The parent material property data of the variable.
- Type DataReference
- Example
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)