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:
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.
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.
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.