9 Replies Latest reply on Jun 3, 2014 12:57 PM by Jason Kerns

    Anyone know how to turn off reflectivity?

    Jason Kerns

      I have the following which appears to work but the setting changes back.

       

      I am trying to turn off reflectivity for photoview renderings.

       

       

      Option Explicit

       

       

      Dim swApp As SldWorks.SldWorks

      Dim swModel As SldWorks.ModelDoc2

      Dim swModelDocExt As SldWorks.ModelDocExtension

      Dim swSelMgr As SldWorks.SelectionMgr

      Dim swRenderMaterial As SldWorks.RenderMaterial

      Dim varRenderMaterial As Variant

      Dim vRenderMaterial As Variant

      Dim nCount As Long, nId As Long

      Dim VConFIGnames As Variant

       

       

       

       

       

       

      Sub main()

      Set swApp = Application.SldWorks

       

       

              Set swModel = swApp.ActiveDoc

              Set swSelMgr = swModel.SelectionManager

              Set swModelDocExt = swModel.Extension

              VConFIGnames = swModel.GetConfigurationNames

       

       

              nCount = swModelDocExt.GetRenderMaterialsCount

              'Debug.Print nCount

              varRenderMaterial = swModelDocExt.GetRenderMaterials

       

       

      For Each vRenderMaterial In varRenderMaterial

       

       

          Set swRenderMaterial = vRenderMaterial

          Debug.Print "before  " & swRenderMaterial.Reflectivity

          swRenderMaterial.Reflectivity = 0#

          swModelDocExt.UpdateRenderMaterialsInSceneGraph True

          Debug.Print "after " & swRenderMaterial.Reflectivity

         

         

      Next

      swModel.ForceRebuild3 True

       

       

       

       

      End Sub