Skip to main content
Export the values of Ultimate tensile strength, Modulus, Baseline fiber volume, and Poisson’s ratio for a set of records from the MI Training database. This example demonstrates:
  • Retrieving a list of databases from a Granta MI server
  • Browsing the tables of a Granta MI database
  • Searching a Granta MI database using the CriteriaSearch operation
  • Retrieving values for attributes of a record

Create a Granta MI Session

Import the GRANTA_MIScriptingToolkit package, and create a connection to a Granta MI server.

Get the Databases

Access the browse service from the session and execute the GetDatabases method.
Previous cell output:
Use pandas to display the available databases.
DBKey DBName
0 MI_Training MI Training

Get the tables in a database

Use the GetTables method from the browse service to see what tables are available in the MI Training database.
Previous cell output:

Searching a database

Search MI Training for all records in the Tensile Test Data table which have a defined Young’s modulus (11-axis) (normalized)
Print the shortName and longName of the first 5 records returned by the search.
ShortName LongName
0 LBJ8311A S-Glass Unitape S2/SP381, 3M, 0° tension, Spec…
1 LBJ6213A S-Glass Unitape S2/SP381, 3M, 0° tension, Spec…
2 LBJ4211A S-Glass Unitape S2/SP381, 3M, 0° tension, Spec…
3 LBJ4213A S-Glass Unitape S2/SP381, 3M, 0° tension, Spec…
4 LBJ6214A S-Glass Unitape S2/SP381, 3M, 0° tension, Spec…

Export data from records

Create attribute references for the attributes you want to export and export data from all records.
Print the values of the attributes from the first 5 exported records. Note that some records may not have values for all attributes.
ShortName LongName Young’s Modulus (11-axis) (normalized) Ultimate tensile strength (normalized) Baseline fiber volume Elastic Poisson’s Ratio (12-plane)
0 LBJ8311A S-Glass Unitape S2/SP381, 3M, 0° tension, Spec… 48.428779 1556.643278 53.473 0.272
1 LBJ6213A S-Glass Unitape S2/SP381, 3M, 0° tension, Spec… 47.911673 1392.975515 53.473 0.266
2 LBJ4211A S-Glass Unitape S2/SP381, 3M, 0° tension, Spec… 48.028883 1535.152318 53.473 0.242
3 LBJ4213A S-Glass Unitape S2/SP381, 3M, 0° tension, Spec… 48.042673 1601.486784 53.473 0.259
4 LBJ6214A S-Glass Unitape S2/SP381, 3M, 0° tension, Spec… 46.387931 1322.511090 53.473 0.264
Create a plot of the exported values
Previous cell output:
png