Create a new variable which contains the class for each respondent based on a MaxDiff latent class analysis output (this is different than a Latent Class Analysis tree output that creates segments based on various variable sets from the data). You should select the output before running this script or in the Latent Class MaxDiff's object inspector click on Save Variable(s) > Class Membership.
Example
When run from the menu, the script produces both a variable of the class membership for each respondent and a SUMMARY table with the new variable:
The Class Membership button will only create the new variable, which you can then drag to the page to create the summary table.
Technical details
Each respondent has a probability of being in each class. You can determine these probabilities by using Marketing - MaxDiff - Save Variable(s) - Class Membership Probabilities, and looking at the RAW DATA. The new variable generated by this script assigns each respondent to the class with the largest probability of membership.