cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X

Material Files - Generating a Library in support of Creo implementation/transition from SW

KeirPritchard
7-Bedrock

Material Files - Generating a Library in support of Creo implementation/transition from SW

I am using Creo Parametric Release 8.0 and Datecode8.0.2.0

Material Files - Are there any formatting or other requirements (such as required parameters or parameter groups) that must be satisfied in order to ensure that the files are valid for use?
Background-as part of the company transitioning from Solidworks to Creo, the existing Solidworks custom/customer materials database is to be replicated as a company Materials Library. The sldmat file is an xml file and a java utility (outside of Creo API's) was written to parse the file and write a .mtl file for each "material" element in the sldmat DOM.

visually the resulting mtl files appear as though they should work. Initial testing result is that the newly created mtl files are visible to Creo but when attempting to assign to the model an error indicating that the [MATERIAL] is not Valid. s

Here are the errors that I faced
Selecting a generated material file results in a message stating that the file is not valid
1 ACCEPTED SOLUTION

Accepted Solutions

I had some typos in the files that caused the issue.  A second set of eyes and a methodical set of checks would have caught them.

View solution in original post

4 REPLIES 4


@KeirPritchard wrote:
I am using Creo Parametric Release 8.0 and Datecode8.0.2.0

Material Files - Are there any formatting or other requirements (such as required parameters or parameter groups) that must be satisfied in order to ensure that the files are valid for use?
Background-as part of the company transitioning from Solidworks to Creo, the existing Solidworks custom/customer materials database is to be replicated as a company Materials Library. The sldmat file is an xml file and a java utility (outside of Creo API's) was written to parse the file and write a .mtl file for each "material" element in the sldmat DOM.

visually the resulting mtl files appear as though they should work. Initial testing result is that the newly created mtl files are visible to Creo but when attempting to assign to the model an error indicating that the [MATERIAL] is not Valid. s

Here are the errors that I faced
Selecting a generated material file results in a message stating that the file is not valid

Hi,

my suggestion ... compare the structure of generated .mtl file with Creo original file (for example ...\Creo 8.0.2.0\Common Files\creo_standards\material_database\metal_steel_low_carbon.mtl).

Note: You can also pack .mtl file into .zip file and upload .zip file. This enables other users to help you.


Martin Hanák

When displacing Solidworks your customer required to have the material database converted to Creo's and this is essential that this is iso functional.

The Solidworks material database has been converted to Creo's thanks to a Java Tooling and the resulting files are not considered valid by Creo. 

 

First and foremost Creo material files, like all Creo files, are recommended to be created with official PTC solutions. As a former developer and PLM migration specialist, I get that the xml can be edited and general parsing is tempting in that instance. 

 

So I'll disclose to you the official way to go: if you or the provider of the parsing tool is comfortable with Java, then use Java Object Toolkit for the writing part of the mtl files. And more specifically run the method  Materials::Create(). If any issue in the creation with that method, then the Creo JOTK Support team will be accountable. 

 

Because the parsing tool relies on general Java programming, PTC cannot be held accountable for looking into. 

And because I was a PLM migration developer in a past life, here's one of the things i'd verify: what's the encoding of the mtl file? Is it the same as the ones shipped with Creo?

Hello,

Creo can retrieve material information if they are originally assigned in Solidworks.

Inside Creo, File > Open > sldprt

File > Prepare > Model properties > Material Change

File > Save mtl file.

I had some typos in the files that caused the issue.  A second set of eyes and a methodical set of checks would have caught them.

Top Tags