- some more work in the Excellon Editor - Drill adding
- some fixes in the image loader when clicking the an image that is in the list of previous loaded files
- a small fin in the SVG parser
- added a new Tcl command that is returning the name of the active object ('get_active') to accompany the 'set_active' command
- a small fix for the 2d graphic mode by replacing the q5agg matplotlib backend with the qtagg backend which should work with the Qt6
51 lines
1.3 KiB
Python
51 lines
1.3 KiB
Python
|
|
from tclCommands.TclCommand import TclCommand
|
|
|
|
import collections
|
|
|
|
|
|
class TclCommandGetActive(TclCommand):
|
|
"""
|
|
Tcl shell command to get the current active object name.
|
|
|
|
example:
|
|
|
|
"""
|
|
|
|
# List of all command aliases, to be able to use old names for backward compatibility (add_poly, add_polygon)
|
|
aliases = ['get_active']
|
|
|
|
description = '%s %s' % ("--", "Gets the active (selected) application object name.")
|
|
|
|
# Dictionary of types from Tcl command, needs to be ordered
|
|
arg_names = collections.OrderedDict([
|
|
])
|
|
|
|
# Dictionary of types from Tcl command, needs to be ordered , this is for options like -optionname value
|
|
option_types = collections.OrderedDict([
|
|
])
|
|
|
|
# array of mandatory options for current Tcl command: required = {'name','outname'}
|
|
required = []
|
|
|
|
# structured help for current command, args needs to be ordered
|
|
help = {
|
|
'main': 'Gets the active (selected) application object name.',
|
|
'args': collections.OrderedDict([
|
|
]),
|
|
'examples': ['get_active']
|
|
}
|
|
|
|
def execute(self, args, unnamed_args):
|
|
"""
|
|
|
|
:param args:
|
|
:param unnamed_args:
|
|
:return:
|
|
"""
|
|
|
|
try:
|
|
return self.app.collection.get_active().options['name']
|
|
except Exception as e:
|
|
return "Command failed: %s" % str(e)
|