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.