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

Community Tip - Need help navigating or using the PTC Community? Contact the community team. X

How to change material name in a model using Weblink?

YaroslavSin
17-Peridot

How to change material name in a model using Weblink?

The property Name of the class pfcMaterial is read only.

It is possible to change material name in weblink or JLink?

3 REPLIES 3
sjuraj
13-Aquamarine
(To:YaroslavSin)

You can use session.RunMacro()

 

~ Command `ProCmdMmEditMaterial@PopupMenuTree` ;
~ Update `material_definition` `MtrlNameInput` `<your_new_name>`;
~ Activate `material_definition` `MtrlOKPush`;

 

just make sure your material is selected (in selection buffer) - this can be done by user or programically

Yes, now I'm using macro for this. But it is not elegant way. My macro was created long time ago and in Creo 8 it not working. Yes, I can create new macro for new version, but

 

Looking the way to rename programmatically

sjuraj
13-Aquamarine
(To:YaroslavSin)

I have not found any GetName or similar method for Material interface nor for WMaterial so I suppose macro is the only option, but you can still ask ptc supoort 

Top Tags