IV2010 ActiveRenderStyle not updating

IV2010 ActiveRenderStyle not updating

Anonymous
Not applicable
453 Views
1 Reply
Message 1 of 2

IV2010 ActiveRenderStyle not updating

Anonymous
Not applicable

Through VBA, I have a userform to modify some of our iProperties, one of which is the Color of the part.  I've added several of our powder coat finishes to the Styles library, and have them populating into a combobox in the userform.  After filling out all of the required fields, it successfully passes all of the intormation back to the Module1 main code, and everything (including the selected Material type) can be correctly applied and updated.  However, I've been scouring these forums, Sean Dotson's sites, Kent Keller's sites, Brian Ekin's sites, etc., and cannot find the code references I need to be able to pass my user entered color style to the active color override.

 

Module1 Public Variable declaration:

 

     Public strCOLOR As String

 

The userform combox populates using the following:

 

    Dim oRenderStyles As RenderStyles
    Set oRenderStyles = oDoc.RenderStyles
    Dim oRenderStyle As RenderStyle

 

    For Each oRenderStyle In oRenderStyles
        COLOR.AddItem oRenderStyle.Name
    Next oRenderStyle

When the OK button is clicked:

 

     strCOLOR = UCase(COLOR.Text)

 

As I said earlier,

 

From this point, what code do I put in the Module1 routine to pass the value from strCOLOR to the active render style override so the new color actually shows on the model?

 

For clarification, this is for .ipt files, not assemblies.

 

-Chris

Windows XP Pro x64 SP2, IV2010 x64 Simulation SP3

0 Likes
454 Views
1 Reply
Reply (1)
Message 2 of 2

YuhanZhang
Autodesk
Autodesk

You can set the PartDocument.ActiveRenderStyle with the color you specified as below:

 

 

strCOLOR = UCase(COLOR.Text)
oDoc.ActiveRenderStyle = oDoc.RenderStyles(strCOLOR)

 

 



If this solves the problem please click ACCEPT SOLUTION so other people can find it easily.



Rocky Zhang
Inventor API PD
Manufacturing Solutions
Autodesk, Inc.

0 Likes