Skip to main content
1-Visitor
August 8, 2017
Question

Pro/TOOLKIT: how to assign a texture with ProMdlVisibleTexturepropsSet()

  • August 8, 2017
  • 2 replies
  • 3611 views

Hi to everyone,

 

did anyone manage to assign a texture to a surface using Pro/TOOLKIT???

I managed to use the "new" (starting with Creo2 M140) Toolkit function ProMdlVisibleAppearancepropsGet() and ProMdlVisibleAppearancepropsSet() to assign a color to a comp/surface etc.

 

ProMdlVisibleTexturepropsSet() works as expected. But it seems that this isn't enough to display a texture on a surface. I think I must use ProMdlVisibleTextureplacementpropsSet() to define how the texture is placed/projected and so on. This function always returns -2 (INVALID INPUT)....

 

Before I paste some code here - WAS ANYONE HERE ABLE TO DO THIS?

Any tricks on how to define the ProSurfaceTexturePlacementProps object/pointer???

 

THANKS.

 

Andreas

 

 

 

Andreas

This topic has been closed for replies.

2 replies

24-Ruby III
August 9, 2017

Hi,

 

I hope that you asked PTC Support the same question 🙂

15-Moonstone
August 9, 2017

I have done that in pro develop in the past. But there are some stuff that didn't work at the moment, also inside the Coloring / Appearance section (remove color has some bugs). We have written Marc Fischer to that, but he is on vocation atm.

 

Br,

Eike

1-Visitor
August 12, 2017

Thanks for the replies also when they do not help to solve the problem.

 

My problem here in Germany is that I have only one Creo license and one toolkit license. And I am no longer allowed to open a case for PTC's customer support although I am paying 1.000 Euro "maintainance" PER MONTH.................

I have to ask a reseller and that's usually a complete waste of time; I could also ask my neighbor's dog.

 

Andreas

August 16, 2017
Hi all, Andreas, The first step is to verify that config.pro 'texture' option is 'yes'. The tricky part of the function is ProAsmitem - the usual initialization: ProAsmitem item; memset( &item, '\0', sizeof(item)); Setting the ProAsmitem, assuming that the part's ProMdl is mdl and it was initialized somehow (ProMdlCurrentGet or ProAsmcomppathMdlGet or ProMdlInit) ... ProMdlToModelitem( mdl, &item.item); item.name[0] = '\0';//redundant ProAsmcomppathInit( mdl, NULL, 0, &item.path); //for part or //ProSelectionAsmcomppathGet( sel, &item.path); //for a selected component in case of an assembly... The rest is straightforward - for testing - you should assign an existing texture to a model via UI, retrieve the texture with ProMdlVisibleTexturepropsGet(&item, &props); modify props.texture_map member with another bitmap - try to use one from the default library: strcpy( props.texture_map, "limestone-bump.jpg"); // for example and assign the modified texture to the model with : ProMdlVisibleTexturepropsSet(&item, &props); repaint window. HIH. Feliks.
1-Visitor
September 25, 2018

hi all,

 

I get same problem in ProSurfaceTextureplacementpropsSet(),

the function always return PRO_TK_BAD_INPUTS.

 

I can use the ProSurfaceTexturepropsSet() set the surface texture image,

the part view also show the image,but actually the UI dialog ->color texture option is "off"

this problem make the part view blurred,

so i want to use the ProSurfaceTextureplacementpropsSet() improve the view,

but it's always return PRO_TK_BAD_INPUTS.

 

anyone know how to change the color texture option to image?

or

 know how to use ProSurfaceTextureplacementpropsSet()?

 

thanks!!!