It is possible to change a document style color with a VBA macro or why not with iLogic ?.
I regularly imports STEP and the parts have defined colors. Unfortunately for change must clear all colors of surfaces. By cons, if you edit the styles we see that for each color there is a style with the color name.
So basically if I change a color style, all parts using this style will change.
Hence my question.
Thanks for your help
Please search this forum and http://adndevblog.typepad.com on "RenderStyle".
There are many code samples there.
Thank's for the link.
I have make the VBA Macro and it work fine.
But I can not modify all properties.
For the color I have :
Call oStyle.SetAmbientColor(Red, Green, Blue)
Call oStyle.SetDiffuseColor(Red, Green, Blue)
Call oStyle.SetSpecularColor(Red, Green, Blue)
oStyle.Name = Red & "," & Green & "," & Blue
oStyle.Reflectivity = 31
But I don't find how to modify reflectivity, transparency, ....
Maybe it is not possible to modify with vba macro all the parameters in the appareance editor ?
Don't worry, you may control mentioned above RenderStyle properties.
RenderStyle.Opacity = 0 .. 1
Property that gets and sets the opacity of the render style.
The opacity is defined using a value between 0 and 1.
A value of 0 results in a completely translucent style while a value of 1 is completely opaque.
RenderStyle.Reflectivity = 0 .. 1
Property that gets and sets the reflectivity of the render style.
The reflectivity is defined using a value between 0 and 1.
A value of 0 results in a non-reflective rendering style while a value of 1 is very reflective.
Look into Inventor API Help for more detailed description of RenderStyle properties and methods.
Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register
Start with some of our most frequented solutions to get help installing your software.