TclCommandGetNames.py 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. from tclCommands.TclCommand import *
  2. class TclCommandGetNames(TclCommand):
  3. """
  4. Tcl shell command to set an object as active in the GUI.
  5. example:
  6. """
  7. # List of all command aliases, to be able use old names for backward compatibility (add_poly, add_polygon)
  8. aliases = ['get_names']
  9. # Dictionary of types from Tcl command, needs to be ordered
  10. arg_names = collections.OrderedDict([
  11. ])
  12. # Dictionary of types from Tcl command, needs to be ordered , this is for options like -optionname value
  13. option_types = collections.OrderedDict([
  14. ])
  15. # array of mandatory options for current Tcl command: required = {'name','outname'}
  16. required = []
  17. # structured help for current command, args needs to be ordered
  18. help = {
  19. 'main': 'Lists the names of objects in the project.',
  20. 'args': collections.OrderedDict([
  21. ]),
  22. 'examples': []
  23. }
  24. def execute(self, args, unnamed_args):
  25. """
  26. :param args:
  27. :param unnamed_args:
  28. :return:
  29. """
  30. return '\n'.join(self.app.collection.get_names())