by jeff hammond » Sat Feb 09, 2008 9:03 am
i currently use the workaround of selecting all and then deselecting but it always feels counter intuitive + i just don't like the look of everything being highlighted while i'm working..
it seems like this would be an easy enough task to handle via a script.. no? or better yet, is there already a script out there or some other way to do an inverse selection?
the photoshop shortcut (⇧⌘ I) is used in sketchup for model info but i'll be happy with something else..
dotdotdot
-

jeff hammond
- Global Moderator
-
- Posts: 5372
- Joined: Thu Jan 24, 2008 11:16 pm
- Location: newyorkcity
- Name: Jeff Hammond
- Operating system: Mac
- SketchUp version: 2015
- License type: Pro
- SketchUp use: architecture
- Level of SketchUp: Advanced
by Gaieus » Sat Feb 09, 2008 9:30 am
Good point! Maybe an Alt+Select could do this (since the Shift and Ctrl keys are taken already)
-

Gaieus
-
- Posts: 27379
- Joined: Sat Oct 20, 2007 8:24 am
- Location: Pécs, Hungary
- Name: Csaba Pozsárkó
- Operating system: Windows
- SketchUp version: 2013
- License type: Pro
- SketchUp use: historical reconstruction
- Level of SketchUp: Advanced
-
by pilou » Sat Feb 09, 2008 12:04 pm
this one? Right click/ menu
Last edited by pilou on Sat Feb 09, 2008 6:30 pm, edited 1 time in total.
-

pilou
- Top SketchUcator
-
- Posts: 21102
- Joined: Wed Jan 23, 2008 10:33 pm
- Name: Pilou
- Operating system: Windows
- SketchUp version: 2017
- License type: Free/Make
- SketchUp use: hobby
- Level of SketchUp: Advanced
-
by PRSS » Sat Feb 09, 2008 5:50 pm
Thanks Pilou
I was very badly in need of this kind of a script. I want to hide all objects which are unselected. i.e. an equivalent of Max's Alt-Q which hides everything that is not selected.
With best regards PRSS
-
PRSS
-
- Posts: 106
- Joined: Sun Nov 25, 2007 6:12 am
by pilou » Sat Feb 09, 2008 6:29 pm
So easy now Selection : Right click/inverse + click "H" (if H is the shortcut of hide 
-

pilou
- Top SketchUcator
-
- Posts: 21102
- Joined: Wed Jan 23, 2008 10:33 pm
- Name: Pilou
- Operating system: Windows
- SketchUp version: 2017
- License type: Free/Make
- SketchUp use: hobby
- Level of SketchUp: Advanced
-
by jeff hammond » Sat Feb 09, 2008 6:38 pm
hmm.. close but no cigar..
there is a weird quirk with the script in that it introduces hidden geometry... it works ok with flat faces but doesn't help at all with curved ones..
i'd like to be able to select a curved face and then invert the selection so everything else besides the face is selected... then i hit delete and all i'm left with is the curved face...
with this script, i select the face (+ it's edges) and then activate the script.. when the selection is inverted, the hidden geometry shows up so when i delete, i'm only left with the outlining edges of the face... the workaround is to show hidden geometry from the beginning and make sure to select all of that stuff prior to running the script... then, it will work as i'd like but that's a bigger hassle then my previous work around..
i'd like something to work exactly opposite of the normal select then delete where i can select a face with one click and delete it with one key.. easy ... i'd like to be able to select that same face and Save it with three moves (select, invert selction, delete).. if i have to double click the face in order to get the edges in the initial selection, that would be fine too..
thanks for the help so far..
dotdotdot
-

jeff hammond
- Global Moderator
-
- Posts: 5372
- Joined: Thu Jan 24, 2008 11:16 pm
- Location: newyorkcity
- Name: Jeff Hammond
- Operating system: Mac
- SketchUp version: 2015
- License type: Pro
- SketchUp use: architecture
- Level of SketchUp: Advanced
by TIG » Sat Feb 09, 2008 9:36 pm
I wrote 'invert selection' almost 2 years ago... What would you like it to do differently - exactly ?
TIG
-

TIG
- Global Moderator
-
- Posts: 20265
- Joined: Mon Nov 12, 2007 7:24 pm
- Location: Northumbria UK
- Name: TIG
- Operating system: Windows
- SketchUp version: 2021
- License type: Pro
- SketchUp use: architecture
- Level of SketchUp: Advanced
by jeff hammond » Sat Feb 09, 2008 10:43 pm
thanks for the response TIG .. and any further assistance you may be able to add..
i'm not sure if this little video clip is going to make my wishes clear or further compound the confusion but i'll give it a shot :)...
you'll notice my hi tech number system in the lower left corner of the video.. the only operation you won't see me doing is pushing the delete key on my keyboard..
1) selecting the surface and deleting it.. this is exactly opposite of what i'd like to be able to do which is select the surface and delete everything else (ie - select, invert, delete)
2) trying to do just that with invertselection.rb... selecting only the face then inverting and deleting
3) double clicking the surface in order to get the edges as well then inverting and deleting... this way would be fine as well except the hidden geometry comes into play upon the inversion which causes the surface to delete.
4) in order for the face to remain, i have to show hidden geometry and select all of the hidden lines + the individual faces... then, when i invert and delete, i'm left with what i want .. however, the flow of doing it like this is not practical at all (especially when considering the more complex forms that i really want this script for)
does this make any sense? if so, is it possible to tweak the script? thanks, jeff
dotdotdot
-

jeff hammond
- Global Moderator
-
- Posts: 5372
- Joined: Thu Jan 24, 2008 11:16 pm
- Location: newyorkcity
- Name: Jeff Hammond
- Operating system: Mac
- SketchUp version: 2015
- License type: Pro
- SketchUp use: architecture
- Level of SketchUp: Advanced
by pilou » Sat Feb 09, 2008 11:21 pm
You want this in one click?
-

pilou
- Top SketchUcator
-
- Posts: 21102
- Joined: Wed Jan 23, 2008 10:33 pm
- Name: Pilou
- Operating system: Windows
- SketchUp version: 2017
- License type: Free/Make
- SketchUp use: hobby
- Level of SketchUp: Advanced
-
by jeff hammond » Sun Feb 10, 2008 1:01 am
Pilou wrote:You want this in one click?
no, not exactly and i think i'm confusing things by bringing 'delete' into the conversation.. what i want is an exact interpretation on the term 'inverse selection'... if i have some lines and faces selected, i'd like to be able to switch those to unselected and everything else selected... the downfall of the script (imo) is that it introduces hidden geometry even if that option is off.. a perfect example of what i'm talking about can be seen on the cylinder that you've posted above.. draw the cylinder and make sure hidden geometry is turned off (as in -- sketchup -> view -> Hidden Geometry... it should be turned off so that the outside face appears smooth with no dotted lines running down it)... now select all.. everything that is visible highlights.. by my logic, running the inverse select script at this point should deselect everything but it doesn't... everything visible deselects but now the hidden geometry shows up and is highlighted.. try it out.. see what i mean? jeff
dotdotdot
-

jeff hammond
- Global Moderator
-
- Posts: 5372
- Joined: Thu Jan 24, 2008 11:16 pm
- Location: newyorkcity
- Name: Jeff Hammond
- Operating system: Mac
- SketchUp version: 2015
- License type: Pro
- SketchUp use: architecture
- Level of SketchUp: Advanced
by Gaieus » Sun Feb 10, 2008 2:03 am
I understand your problem, Jeff - and also I'd say the script is working "logically" since those softened (or hidden) edges were not selected until you ran the script so now they got selected.
Also I understand that you wish the script didn't work this way. Maybe TIG can tweak it a bit...
-

Gaieus
-
- Posts: 27379
- Joined: Sat Oct 20, 2007 8:24 am
- Location: Pécs, Hungary
- Name: Csaba Pozsárkó
- Operating system: Windows
- SketchUp version: 2013
- License type: Pro
- SketchUp use: historical reconstruction
- Level of SketchUp: Advanced
-
by jeff hammond » Sun Feb 10, 2008 2:44 am
ok, cool.. i'm glad i'm getting my point across now.. i admit, i'm no wordsmith. :)
the thing about what's logical or not is confusing because sketchup deals with it two different ways.. if i use edit -> select all (⌘A) or the select tool's window to encompass everything, then the hidden lines remain hidden and unselected (unless i have hidden geometry turned on)... if i use a triple click, then it includes everything including the hidden geometry... i'm basing mine off the first choice but the other one makes just as much sense to me.. i just hope both situations are easy to deal with in ruby language (which i know Absolutely zero about)
dotdotdot
-

jeff hammond
- Global Moderator
-
- Posts: 5372
- Joined: Thu Jan 24, 2008 11:16 pm
- Location: newyorkcity
- Name: Jeff Hammond
- Operating system: Mac
- SketchUp version: 2015
- License type: Pro
- SketchUp use: architecture
- Level of SketchUp: Advanced
by Gaieus » Sun Feb 10, 2008 3:16 am
Ah yes, triple select always selects hidden geometry as well. I haven't figured out its logic in this but there may be one. However I'm a total non-programmer so I can only use scripts. 
-

Gaieus
-
- Posts: 27379
- Joined: Sat Oct 20, 2007 8:24 am
- Location: Pécs, Hungary
- Name: Csaba Pozsárkó
- Operating system: Windows
- SketchUp version: 2013
- License type: Pro
- SketchUp use: historical reconstruction
- Level of SketchUp: Advanced
-
by TIG » Sun Feb 10, 2008 11:19 am
Now I see...
Here v1.1 - it works the same as before, BUT if the selection includes faces then it now assumes you want to include those faces' edges in the selection (visible/hidden/smoothed) even if you haven't explicitly picked any edges: then when it inverts the selection (and say you delete the now selected stuff) any previously selected faces AND their edges are retained...
Feedback please...
Gaieus - you might want to move this to the Ruby realms...
TIG
-

TIG
- Global Moderator
-
- Posts: 20265
- Joined: Mon Nov 12, 2007 7:24 pm
- Location: Northumbria UK
- Name: TIG
- Operating system: Windows
- SketchUp version: 2021
- License type: Pro
- SketchUp use: architecture
- Level of SketchUp: Advanced
by pilou » Sun Feb 10, 2008 11:42 am
works fine when you delete but when you hide seems curious result  (hidden geometry was enable for select facett then disable after selection and only 2 facets were selected) Edited : all works fine, it was only result when you click on the selected facetts! 
-

pilou
- Top SketchUcator
-
- Posts: 21102
- Joined: Wed Jan 23, 2008 10:33 pm
- Name: Pilou
- Operating system: Windows
- SketchUp version: 2017
- License type: Free/Make
- SketchUp use: hobby
- Level of SketchUp: Advanced
-
by Gaieus » Sun Feb 10, 2008 11:54 am
TIG wrote:...Gaieus - you might want to move this to the Ruby realms...
Yeah, it makes sense - "done". Thanks for the update, TIG! 
-

Gaieus
-
- Posts: 27379
- Joined: Sat Oct 20, 2007 8:24 am
- Location: Pécs, Hungary
- Name: Csaba Pozsárkó
- Operating system: Windows
- SketchUp version: 2013
- License type: Pro
- SketchUp use: historical reconstruction
- Level of SketchUp: Advanced
-
by jeff hammond » Sun Feb 10, 2008 3:04 pm
TIG wrote:Here v1.1
wow TIG.. you_are_the_man thank you!
dotdotdot
-

jeff hammond
- Global Moderator
-
- Posts: 5372
- Joined: Thu Jan 24, 2008 11:16 pm
- Location: newyorkcity
- Name: Jeff Hammond
- Operating system: Mac
- SketchUp version: 2015
- License type: Pro
- SketchUp use: architecture
- Level of SketchUp: Advanced
by pvbuero » Fri Nov 05, 2010 7:52 am
@ TIG, that's just fantastic what you're doing here. I face a problem an two minutes later it's been solved thanks to your script. Great 
-
pvbuero
-
- Posts: 29
- Joined: Sat Apr 03, 2010 9:00 pm
- Location: Germany
-
by thomthom » Fri Nov 05, 2010 8:12 am
pvbuero wrote:two minutes later
...and two years later there is a reply... 
-

thomthom
- PluginStore Author

-
- Posts: 19478
- Joined: Tue Nov 13, 2007 12:47 pm
- Location: Trondheim, Norway
- Name: Thomas Thomassen
- Operating system: Windows
- SketchUp version: 2019
- License type: Pro
- SketchUp use: other
- Level of SketchUp: Advanced
-
by Jim » Fri Nov 05, 2010 2:08 pm
Curious, has the selection behavior of hidden geom changed in recent versions?
Hi
-
Jim
- Global Moderator
-
- Posts: 4678
- Joined: Mon Nov 12, 2007 10:13 pm
- Location: ohio
- Name: Jim
- Operating system: Windows
- SketchUp version: 2017
- License type: Pro
- SketchUp use: hobby
- Level of SketchUp: Intermediate
-
by thomthom » Fri Nov 05, 2010 2:31 pm
Jim wrote:Curious, has the selection behavior of hidden geom changed in recent versions?
What/how do you mean?
-

thomthom
- PluginStore Author

-
- Posts: 19478
- Joined: Tue Nov 13, 2007 12:47 pm
- Location: Trondheim, Norway
- Name: Thomas Thomassen
- Operating system: Windows
- SketchUp version: 2019
- License type: Pro
- SketchUp use: other
- Level of SketchUp: Advanced
-
by Jim » Fri Nov 05, 2010 2:36 pm
Just my mind being illogical - it makes sense that hidden geoms are included when inverting the selection. It always feels like hidden geoms should not be included in the active_entities collection.
Hi
-
Jim
- Global Moderator
-
- Posts: 4678
- Joined: Mon Nov 12, 2007 10:13 pm
- Location: ohio
- Name: Jim
- Operating system: Windows
- SketchUp version: 2017
- License type: Pro
- SketchUp use: hobby
- Level of SketchUp: Intermediate
-
by jeff hammond » Fri Nov 05, 2010 3:31 pm
Jim wrote:Just my mind being illogical - it makes sense that hidden geoms are included when inverting the selection.
nah  hidden geometry (by my logic at least) shouldn't come into the equation unless you have it turned on.. otherwise, it should remain hidden.. that said, this script will still mess with hidden geometry.. if i draw a cube and a sphere, hide the cube, select the sphere, then invert the selection... the hidden cube will become selected.. in my mind, when something is hidden, it should mean that no operations affect it.. it should be ignored.. using the sphere/cube example again.. if i hide the cube and do a 'select all', only the sphere(which is visible) will be selected.. that's how it should work i think. [and the same could be said for a window select operation.. if something is hidden and i do a window select over it, it shouldn't be selected because i've chosen to hide it]
dotdotdot
-

jeff hammond
- Global Moderator
-
- Posts: 5372
- Joined: Thu Jan 24, 2008 11:16 pm
- Location: newyorkcity
- Name: Jeff Hammond
- Operating system: Mac
- SketchUp version: 2015
- License type: Pro
- SketchUp use: architecture
- Level of SketchUp: Advanced
by Jim » Fri Nov 05, 2010 4:27 pm
Jeff Hammond wrote:nah  hidden geometry (by my logic at least) shouldn't come into the equation unless you have it turned on.. otherwise, it should remain hidden..
I agree from a user point of view; alttough I can see it both ways. I meant it's logical when using the Ruby API. Otherwise, there would be no way to reference hidden entities.
Hi
-
Jim
- Global Moderator
-
- Posts: 4678
- Joined: Mon Nov 12, 2007 10:13 pm
- Location: ohio
- Name: Jim
- Operating system: Windows
- SketchUp version: 2017
- License type: Pro
- SketchUp use: hobby
- Level of SketchUp: Intermediate
-
by thomthom » Sat Nov 06, 2010 12:56 am
But the API can access whether Hidden Geometry is on or not..
-

thomthom
- PluginStore Author

-
- Posts: 19478
- Joined: Tue Nov 13, 2007 12:47 pm
- Location: Trondheim, Norway
- Name: Thomas Thomassen
- Operating system: Windows
- SketchUp version: 2019
- License type: Pro
- SketchUp use: other
- Level of SketchUp: Advanced
-
by kwalkerman » Wed Nov 10, 2010 10:10 pm
I recently wrote a plugin that will hide all unselected entities: viewtopic.php?t=31378For some of you, this is what you are trying to accomplish by inverting the selection. I'm pretty sure I first inverted the selection, and then hid geometry, so you are welcome to look at the code and modify (or add a menu option). -- Karen
-
kwalkerman
-
- Posts: 144
- Joined: Mon Feb 08, 2010 9:48 pm
- Name: kwalkerman
by Trip12091 » Sat Feb 11, 2017 4:34 am
This is an old post, but it comes up first on a google search for "Sketchup, invert selection". What I do is select the entire entity that I only want part of (usually a big spiral with 1000s of segments) and then hold down the shift key (you'll see the little + and - sign indicating you can add or subtract elements now) and I'll subtract the pieces I want to keep. Once they have been removed from the selection, I'll delete everything else.
So, "inverse" for me means start by selecting everything as opposed to only selecting the things you want, once you have selected everything unselect the things you want to keep.
-
Trip12091
-
- Posts: 12
- Joined: Sun Jan 01, 2017 6:03 pm
- Name: Trip
- Operating system: Windows
- SketchUp version: 2017
- License type: Free/Make
- SketchUp use: engineering and mechanical design
- Level of SketchUp: Beginner
by runninghead » Fri Apr 07, 2017 11:17 am
Not quite what we're after though trip- imagine doing that with 1000 polys and lines by hand 
-
runninghead
-
- Posts: 3
- Joined: Mon Mar 27, 2017 6:58 pm
- Name: runninghead
- Operating system: Mac
- SketchUp version: 2017
- License type: Pro
- SketchUp use: product design
- Level of SketchUp: Intermediate
by SJS66 » Sat Jun 22, 2019 1:36 pm
InverseSelection is awesome. How'd I go so long without it? Thanks TIG.
-

SJS66
- Premium Member

-
- Posts: 123
- Joined: Thu Mar 26, 2015 3:44 am
- Location: Far Nth. Coast of N.S.W. Australia
- Name: Steve
- Operating system: Windows
- SketchUp version: 2020
- License type: Pro
- SketchUp use: landscape architecture
- Level of SketchUp: Advanced
by LetsSee » Fri Feb 21, 2020 12:25 am
thomthom wrote:pvbuero wrote:two minutes later
...and two years later there is a reply... 
And yet another TEN years later there is another reply  I am truly sorry that I so often come so late! I seem to have missed the best 10 years of sketchup, or rather pf the entire internet. Because today the formerly glorious internet has become a close-popups-close-autoplay-vids-close-cookie-confirmations-close-accept-privacy-not-accepted-close-your-eyes-or-suffer NIGHTMARE. LOL No, I am here to say: TIG, you ARE the man, indeed! SO MANY beyond-genious-beyond-cool-solutions I see from you! TIG for President! aka get rid of the current joke, yeah. 
-
LetsSee
-
- Posts: 5
- Joined: Fri Jan 17, 2020 6:03 pm
- Name: david
- Operating system: Windows
- SketchUp version: 2017
- License type: Free/Make
- SketchUp use: architecture
- Level of SketchUp: Beginner
by Ad Machine » 5 minutes ago
-
Ad Machine
- Robot
-
- Posts: 2012
-
Return to Developers' Forum
|