How to Cycle/Change through assembly/pars display states

Hi,

I have a macro which cycles through all my saved camera views and renders each one.

I want to do the same for each display state.

How can add to my macro a FOR loop which does the following:

  1. Cycles through all the pars/assembly display states.
  2. Change the part/assembly to this display state
  3. Store the display state name in a string

Thank you

SolidworksApi macros