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

Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X

Linking Windchill Material Name to Creo Material Description

Bob_Johnson
7-Bedrock

Linking Windchill Material Name to Creo Material Description

My company has its own raw materials folder in Windchill. In our part drawings, we use the parameter PTC_MATERIAL_DESCRIPTION.  

 

When we need to change a material description, we have to do it in Windchill and in the material file itself (see attached picture), because PTC_MATERIAL_DESCRIPTION is driven by the material file description, not the windchill common name. 

 

I have two questions: 

1. Is there a way to link the Windchill material common name and the material file description so we only have to update the name in Windchill?

or

2. Is there a way to pull the material common name from Windchill into a parts parameters?

 

Thanks,

 

Bob

1 REPLY 1

Bob,

 

Very interesting questions.

1. Is there a way to link the Windchill material common name and the material file description so we only have to update the name in Windchill?

 

I wrote the code for question 1.  Works as follows.

Edit the material object's name; the PTC_MATERIAL_DESCRIPTION in the content file in the Windchill vault is automatically updated to match the material object's new name.

 

If what you want is to edit the material object's name in Windchill and have the content material file's value of Default for PTC_MATERIAL_DESCRIPTION, as shown below, automatically be edited to equal the material object's Windchill new name this is doable.

{
Name = PTC_MATERIAL_DESCRIPTION
Type = String
Default = 'Aluminium_6061_Alloy'
Access = Full
},

 

A CHANGE_IDENTITY listener can detect when a Windchill object is renamed or renumbered. If the object is a material object the new name can used to automatically edit the material file in the Vault folder.

 

In short, code can be written for find which file in the vault is the material file.
This file can be written to a temporary file.
During the written to the temp file once you get to a line that equals Name = PTC_MATERIAL_DESCRIPTION you continue to stream that line and the next line, Type = String but the following line you replace with the material object's new name.
Then you keep writing the exiting material file to the temp file.
Once done you copy/replace the material file with the temp file.
The temp file of course has the same hexadecimal file name as the material file name in the vault.

It's easier than you might think.

 

As for question 2
2. Is there a way to pull the material common name from Windchill into a parts parameters?
This too is doable but not to the OOTB PTC_MATERIAL_DESCRIPTION. Only PTC_MATERIAL_NAME can be "Designated" and shared with Windchill but even that is "Restricted" and thus cannot be driven from Windchill.
A user-defined parameter that is Designated and shared with Windchill could be driven by the material object's name and updated automatically when the material object is renamed.
As described above a CHANGE_IDENTITY listener could be written to automatically synchronize the user-defined parameter with the material object's name when the material object is renamed.

If you're not familiar with listeners the big picture is you write Java code to listen for the event type you're interested in.
Is this case most likely the POST_CHANGE_IDENTITY event.
When a POST_CHANGE_IDENTITY event occurs the custom listener detects it and then runs whatever code you want.
In this case check if the object is a material object. If it is do what needs to be done.

Again, this is easier than it might sound but does require writing some Java code.

 

Not sure if this is enough help but it is doable.

If you need more feel free to reach out.

 

David

 

Announcements

Top Tags