Quicker Block Select Instances

My current method for quickly selecting all the instances of a selected block is by bringing up the block manager and then hitting the select button.

Is there a method that could be written which does this quicker? Bringing up the block manager is quite time consuming once the model builds up.

Of course there is SelBlockInstanceNamed but scrolling through the names to remember which one you want is also not ideal.

So the logic would be something like: (Prompt user to select block) :arrow_forward: Select all items with reference block ID :arrow_forward: return selected Blocks

Would also be good if it could work with multiple selections of block instances

Any ideas?
Cheers

Hi Benjamin,

You can try the hypenated version of -SelBlockInstanceNamed -> SelectBlockToMatch to pick source block instances and select all of the instances of these blocks. Works on multiple block definitions.
(many commands when used with “-” before run in command-line mode only and sometimes in V5 have options not available in regular command mode. This is one of them.

hth,

–jarek

2 Likes

Perfect! I’m surprised (and embarrassed) I missed that options for -SelBlockInstanceNamed

Thanks!

I know this is an old thread but here is a simple script to select similar blocks, using the method Jarek suggested with pre-select accepted :

Sub SelectSimilar()
	
	Dim strObject, StrName
	strObject = Rhino.GetObject("Select block",, 1)

	If Rhino.IsBlockInstance(strObject) Then
		StrName = Chr(34) & Rhino.BlockInstanceName(strObject) & Chr(34)
		Rhino.Command "-SelBlockInstanceNamed " & StrName
	Else
		Rhino.Print("No Block Selected")

	End If	
End Sub

*Edited to format script