AnsweredAssumed Answered

Change component color in SolidWorks 2013

Question asked by Dave Paul on Nov 7, 2016
Latest reply on Nov 8, 2016 by Nilesh Patel

All,

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.

Dave

Outcomes