Invert Selection - No Shortcut Key
-
Or to put it the other way round...
Select something, so that the right-click context-menu item would be available.
Open Preferences
Shortcut section
Filter for 'invert'
Set short-cut key
Close PreferencesYou should now have a key set as required...
-
why doesnt this work for projections?
-
thanks thanks thanks - this is what's happening though:
suppose i have a cube and a sphere and they are not selected, when i click on the invert selection icon the cube and the sphere get both selected (works like select all), when i click again the they deselect (works like select none).
now suppose the cube is selected, when i click on the icon the sphere gets selected (invert selection), click again and the cube gets selected (invert selection)
when the same command is given a shortcut key: if no selection, then pressing the key has no effect - but it works from the icon.
how/can i fix it?
yes why not for projections? if you download the individual scripts from Didier's - you can then assign a key.
-
Did you write a script ? Can we see it ? Or else we can write smt for you ?
-
@matt666 said:
Did you write a script ? Can we see it ? Or else we can write smt for you ?
Hi Matt, first i can barely deal with menus and that working through the night
thing is the script is already there but it has this strange behaviour which differs when run from icon and when run from shortcut key.. if you can sort something out.. from past experience, would i say no to monsieur Rubyn?
-
Can you show the script and the icon code please? We can do smt into the icon code.
For example, to look for a selevtion before starting the script... -
thanks Matt - this is the menu code:
cmd03 = UI;;Command.new("Inverts Selection") {InvertSelection_.toggle} #if InvertSelection_.validate cmd03.small_icon = "CD_ICONS/SELECT/invertselection_16.png" cmd03.large_icon = "CD_ICONS/SELECT/invertselection_24.png" cmd03.tooltip = "Inverts Selection" cmd03.status_bar_text = "Inverts Selection" cmd03.menu_text = "Inverts Selection" gp_cd_zelect_tb.add_item(cmd03)
this is TIG's code to which the menu refers
# Copyright 2005-8, TIG # Permission to use, copy, modify, and distribute this software for # any purpose and without fee is hereby granted, provided that the above # copyright notice appear in all copies. # THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR # IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. # Name ; invertselection.rb # Date ; v1.0 8/7/5 # v1.1 10/2/8 Edges of selected faces are respected. #----------------------------------------------------------------------------- # This script will invert the current selection from the context menu. # It will respect the nesting level if you are editing a group / component. ### require 'sketchup.rb' ### class InvertSelection_ def InvertSelection_;;validate ### model=Sketchup.active_model ss=model.selection return nil if (ss.empty?) return true end # def InvertSelection_;;toggle model=Sketchup.active_model ss=model.selection ### add hidden smoothed edges to faces in selections ### edges=[] ss.each{|e|fedges=[] fedges=e.edges if e.typename=="Face" fedges.each{|ee|edges.push(ee)} if not fedges.empty? } edges.each{|e|ss.add(e)} if not edges.empty? ### ### Find everything in the current edit level. model.active_entities.each {|e|ss.toggle(e)}###Flip selection end end # Class ###
-
That's strange!
It works fine here!
Here is the code I've used, with an icon...
Try this and tell me if it's ok for you...
In case you have a pb in your code...
-
nope, doesn't work - but that means the conflict comes from other scripts present in cd_zelect.rb
will give it a look by elimination - Thanks Matt!
-
solved - i needed to add a plugin menu item - with icon and context menu only i get that registering bug.
Thanks for all the help though!
Advertisement