File indexing completed on 2024-11-24 05:05:54

0001 import types
0002 import pyLksPlugin
0003 
0004 def recoulourize(actionHandler):
0005     pigmentRed = pyLksPlugin.Color(237, 27, 36, 255)
0006     viewedEntities = actionHandler.getAllEntitiesInCurrentView()
0007     for viewedEntity in viewedEntities:
0008         viewedEntity.setColor(pigmentRed)
0009 
0010 # The Hook methods are going to be used by codevis
0011 # as entry points to the system. this is one of the
0012 # most simple examples possible, a way to hook
0013 # the graphics view context menu with new features.
0014 # we are adding the recolourize python call when
0015 # the user right clicks on the view, and acesses the menu.
0016 def hookGraphicsViewContextMenu(menuHandler):
0017     menuHandler.registerContextMenu("Color the elements on the screen", recoulourize)