# Copyright 2009 Autodesk, Inc.  All rights reserved.
# Use of this software is subject to the terms of the Autodesk license agreement 
# provided at the time of installation or download, or which otherwise accompanies
# this software in either electronic or hard copy form.
#
# Topic: FBModelList, FBGroup, FBNamespaceAction
#

from pyfbsdk import FBModelList, FBGetSelectedModels, FBMessageBox

lModelList = FBModelList()

# Get the selected models.
FBGetSelectedModels( lModelList )

# Show the list to the user.
if len( lModelList ) == 0:
  FBMessageBox( "Message", "Nothing selected", "OK", None, None )
else:
  lMessage = "%d selected models:" % len( lModelList )

  # Okay, the following line looks a bit complicated... but we just
  # build a string with all the selected object's name. One per line.
  lMessage += ''.join( map( lambda pModel: "\n  " + pModel.Name, lModelList ))

  # And bring up the pop-up...
  FBMessageBox( "Message", lMessage, "OK", None, None )
  del( lMessage )

# Cleanup.
del( lModelList, FBModelList, FBGetSelectedModels, FBMessageBox )