setting a texture in Inventor 2013 programmatically

setting a texture in Inventor 2013 programmatically

Anonymous
Not applicable
726 Views
2 Replies
Message 1 of 3

setting a texture in Inventor 2013 programmatically

Anonymous
Not applicable

Hello,

I have got troubles with textures in the new Inventor 2013. When I try to programmatically change a texture in a render style of a part (no matter, whether I use an existing render style or create a new one), when I set the texture file name, Inventor throws an exception "Bad argument". In Inventor 2012, it worked. Does anybody know, how textures should be set in the new Inventor? Thanks for any idea.

 

Sample code:

PartDocument partDoc = ... some initialization

 

RenderStyle newRenderStyle = partDoc.RenderStyles.Add("newRenderStyle");

newRenderStyle.TextureFilename = newTexFilename;   //this throws an exception bad format, even if the texture is in the Inventor textures directory 
partDoc.ActiveRenderStyle = newRenderStyle;

 

Michal

0 Likes
Accepted solutions (2)
727 Views
2 Replies
Replies (2)
Message 2 of 3

xiaodong_liang
Autodesk Support
Autodesk Support
Accepted solution

Hi,

 

The image should be from the specific folder: C:\Program Files\Autodesk\Inventor 2013\Textures\surfaces when you apply an image to a renderstyle by code.

0 Likes
Message 3 of 3

Anonymous
Not applicable
Accepted solution

Hi,

 

thanks for your answer. On my computer, textures must be in the magic directory C:\Users\Public\Documents\Autodesk\Inventor 2013\Textures\surfaces.

But you were close enough.

 

Michal

0 Likes