Isolate Selection

Hi,

A long standing wish for an Isolate/Unisolate functionality.
I have been using a script for years now and starting work in V6 it immediately strikes me how much I use it.

Basic setup:

Have a (pre-)selection and run Isolate.
it will hide all but the Selected objects
options could include:

  • hide locked objects yes/no
  • hide objects on locked layers yes/no

to reset the isolation run Unisolate

-Willem

1 Like

So would the command be?

Invert
Hide
SelAll

isolate_py.py (1.3 KB)

I wrote this one a while back, it does about what youā€™re asking.

easiest to use if you alias it to ā€œIsolateā€ or something

edit: oh, i see the point of the post was to get it into v6, nvm

Hi Willem - Invert Hide does that bit, itā€™s the Unisolate that takes more typing. I use a (hack-o-rama) script as wellā€¦ Iā€™ll add it to the pile, though I think I probably have done that in the dim past.

Some details -

  • should it be possible to nest Isolate so that you can repeat it as needed and Unisolate works backwards through the pile? I think that was one request and I may even have it that way in the script but if so I donā€™t use it enough to even remember.
  • Is it important to save the view at the time of isolation?

thanks,

-Pascal

Hi Steve - it is InvertHide, but remember the objects that were hidden so that only they are restored by Unisolate.
(It is indeed very useful.)

-Pascal

Yeah, the important part is not re-showing objects that were hidden prior to the invocation of Isolate

Got it. Sounds useful and relatively easy to do in the RhinoCommon based commands plug-in. @piac could probably whip up a command if you are looking for someone to assign the wish list item to.

1 Like

Hi Steve,

EDIT, I see there were a lot of replies already, below might be obsolete

See my edit above and below the script I use for it @Pascal it is an adaptation of a script by you, matbe you have already logged this in the bugtracker ad a feature request?

Thanks
-Willem
IsolatePascal_WD.rvb (1.9 KB)

Option Explicit

  'Script date Thursday, September 03, 2009 

Call Rhino.AddAlias ("PG_Isolate", "!_NoEcho _-Loadscript " & Chr(34) & Rhino.LastLoadedScriptFile & Chr(34))

Call Isolate
Sub Isolate()

	Dim str : str = Rhino.GetString("Isolate or Unisolate")
	
	If LCase(str) = "u"  Then Call UnIsolateAction()
	
	If LCase(str) = "i"  Then Call IsolateAction()
	
End Sub



Sub IsolateAction()

	Dim strSection, strEntry
	Dim arrSel, arrObj
  	
	
	arrSel = Rhino.GetObjects("Select objects to isolate",,,True ,True)
	If Not isArray(arrSel) Then Exit Sub
	
	Rhino.EnableReDraw(False)
	
	Dim aObj: aObj = Rhino.InvertSelectedObjects(True)
	
	If Not IsArray(aObj) Then 
		Rhino.EnableReDraw(True)
		Exit Sub
	End If
	
	Dim aDat, sDat, sHDat, 	blnHDat, sSection
	blnHDat = False

	
	If Rhino.IsDocumentData() Then
		aDat = Rhino.GetDocumentData()
		
		For Each sSection In aDat
			If sSection = "Iso" Then
			
				sHDat = Rhino.GetDocumentData("Iso",  "H_Objects")
				If Not isNull(sHDat) Then blnHDat = True
			
				Exit For
				
			End If
		Next
			
	End If 
	
	
	
	Rhino.EnableRedraw(False)
		
	If isEmpty(sHDat) Then
		sHDat= Join(aObj, ",")
	Else
		sHDat = sHDat &"," & Join(aObj, ",")
	End If

		Call Rhino.HideObjects (aObj)
		Call Rhino.SetDocumentData ("Iso", "H_Objects", sHDat)
   
	Rhino.EnableRedraw(True)			
		
End Sub
  
Sub UnIsolateAction()
	
	Dim  sHDat

	If Rhino.IsDocumentData() Then
		sHdat = Rhino.GetDocumentData("Iso","H_Objects")
		If IsNull(sHDat) Then Exit Sub
	End If
	
		
	Rhino.EnableReDraw(False)
		
	Dim aHDat
	If Not iSNull(sHDat) Then aHDat = Split(sHDat,",")
		
	If Not IsArray(aHDat) Then 
		Rhino.EnableReDraw(True)
		Exit Sub
	End If
	
			
		If isArray(aHDat) Then Rhino.ShowObjects(aHDat)
		Call Rhino.DeleteDocumentData ("Iso", "H_Objects")
		
		
	Rhino.EnableReDraw(True)
	
End Sub

Hi Pascal, @piac

I do not think miss such a feature, however I guess with some ahead planning it could be easy to add

Save subsequent isolate actions in such a way that there is an ordered array/list of objects that got isolated in each step. Initially all object in the list get unisolated.
An advanced command would be able to step through the list and go back and forward various steps

-Isolate (stepForward)

UnIsolate ( All, stepBack)

I have found that to be more confusing that usefull I think It was a functionality I deleted from your script.

Thanks
-Willem

I found the same thingā€¦

-Pascal

@stevebaer, @piac See

http://mcneel.myjetbrains.com/youtrack/issue/RH-1938

-Pascal

Pascal - You also created the Isolate Lock option for me in the old scripts, which lock rather than hide the surrounding geometry so that it can still be referenced. I still use the Isolate scripts a lot!

Can someone clarify what exactly theyā€™re stepping forwards and backwards in to/out of in the above comments?

Hi Matt -What I meant in my question was the idea that you could isolate say 10 objects and then from there isolate four objects and have the first Unisolate only restore the six hidden by the last Isolate, not all. Another shot of Unisolate , in this example, would get back to the completely-pre-isolate stateā€¦ if you see what I mean. I think maybe my script does that, or maybe I just dreamed itā€¦ I will test, but it seems not to be important anyway.

-Pascal

Ah, OK. Thanks for the explanation. I donā€™t recall ever trying that, but I guess it could be a possibility in very complex models. It would be a bit like burrowing down when using BlockEdit, I guess. As long as thereā€™s a command line message to tell you when thereā€™s no more ā€˜undiggingā€™ to be done, I canā€™t see that such a facility would do any harm.

Here is my contribution:

SampleCsIsolate.cs
SampleCsUnisolate.cs

I have thought of this behaviour for a while. I really like how Illustrator does it with groups. If you double click on a group it will isolate it by hiding the rest of the things. I envision this for both groups and blocks. Darkening the background color and adding a little tag at the top will help the user know he is editing a block/group. It is similar to clusters in grasshopper.

Check out: http://youtu.be/RTvN0fxtRsk?t=2m

For years now, I use Isolate a lot, and made it slightly different. Over here Rhino also Zooms Extend the isolated object, and that is very useful.
Left mouse click: !_Select _Pause _Invert _Hide _Zoom _Extents
Right mouse click: !_Select _Pause _Invert _Hide _Zoom _All _Extents

Also I put it next to zoom _Extents in my toolbar with a dedicated icon.

2 Likes

I think the following is on the subject hereā€¦

When I use Isolate I almost never wanted to see objects on locked layers, but they remain visible as the command currently functions. Iā€™d like to easily be able to isolate my selection from everything including locked objects.

1 Like

I was just searching the forum for this same thing.

I suppose it could be done by script that would Unlock the LockedGeo, then Select it, and Hide it. Then, of course, run in reverse to being the geo back as visible and locked.

@pascal Do you have something laying around that does this? It would be really useful, as for example, right now Iā€™m kitbashing from an existing model, copying geo to a new model, then Locking that original geo so I know itā€™s been used. Iā€™d like to be able to Isolate at times, and have the locked geo out of viewā€¦

Hm - I do not have that lying around Iā€™m afraid. I do not know that it is within my power, tbhā€¦ need to think on it.
-Pascal