3 Replies Latest reply on Nov 8, 2016 4:19 PM by Nilesh Patel

    Change component color in SolidWorks 2013

    Dave Paul


      Is there a way to set a component color of a display state using data from the "GetDisplayStateSetting" method?


        'Get display state
        Set swDSS = swModelDocExt.GetDisplayStateSetting(swDisplayStateOpts_e.swAllDisplayState)
        swDSS.Entities = swComponents
        swDSS.Option = swDisplayStateOpts_e.swSpecifyDisplayState
        displayStateNames(0) = "Display - Seed"
        swDSS.Names = displayStateNames
        'Assembly level is the default
        swDSS.PartLevel = False
        'Change the selected component's assembly-level color in the specified display state; this is the overriding color level
        appearances = swModelDocExt.DisplayStateSpecMaterialPropertyValues(swDSS)
        Set swAppearanceSetting = appearances(0)


      Any thoughts are appreciated.