Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X
I have once excel sheet exported from other system and which have all material information with their properties. Now my next task is to create the material files in Creo (*.mtl) using same information.
Is there any automated way /script available to read the material properties from excel and create the material files in Creo?
I will appreciate your help or any suggestion, as it will help me to save manual effort and time.
Thanks in Advance.
If you look at a ".mtl" file, they don't seem to be that complicated. Though, I only really looked at a standard metal one, I don't know if you are working with exotic materials. If it was my task to get the Excel stuff into a usable format for Creo, I would probably use one of the following approaches:
Option 1:
Set up a worksheet within Excel that has the same layout as the ".mtl" file, with the curly braces, etc. on lines as needed. Make a single column of rows, each containing a line of the ".mtl" file. Then, using the "CONCATENATE" function of Excel, build the specific lines that contain the actual data values for the material. Once you have a nice column of all the stuff Creo wants, you can output a text file with just that column and it should done. If you need a bunch, you might want the top bit of the worksheet to contain the "raw" data values that are then used to "populate" the cells that will be written out. Copy in each set of data as you need it, etc.
Option 2:
Just write your raw data values to a file as text. Make sure the format of each number and text string is the same. Then, use a text editor with macro capabilities to build a macro that reads each set of data values and reformats it to the correct input for Creo. It'll be a pretty long macro, but with something like Emacs, you can record a macro as you do the operations, then repeat it ad infinitum.
For me, I'd probably go with Option 1 first, using Option 2 only if I absolutely need to.
I have done this for our company. As Kenneth mentioned, the .mtl files are just text files so all you need to do is write a macro that re-formats your data to the .mtl format. If you open up a any .mtl file you can view the format that is needed. Not all of the data in the .mtl file is needed for a .mtl file to be read in correctly. The fields I populate are below. Some of these are not needed though. I don't remember which ones, but you can do guess and check by deleting them from the file. If you don't have the information available for them, you could always just set them to 0 as long as that meets your business needs.
TEST_MATERIAL
PTC_MATERIAL_DESCRIPTION
TEMPERATURE
PTC_INITIAL_BEND_Y_FACTOR
PTC_BEND_TABLE
PTC_MATERIAL_TYPE
PTC_FAILURE_CRITERION_TYPE
PTC_FATIGUE_TYPE
PTC_MASS_DENSITY
PTC_SPECIFIC_HEAT
PTC_POISSON_RATIO
PTC_YOUNG_MODULUS
PTC_THERMAL_EXPANSION_COEF
PTC_THERMAL_CONDUCTIVITY
PTC_TENSILE_YIELD_STRESS
PRO_UNIT_SYS
Hi,
seems you have solved it, but i haven´t a clue how to get it. Unfortunately excel isn´t my favorite tool. So it would be fine if I could get some more help.