Refresh selected block

possible? (without going into block manager which is slow because of a lot of blocks)

Hi Ryan - if you are willing to refresh all blocks, use

! _-BlockManager _Update _All _Enter


No way. I guess we need a _Selected option

Try this Python:

import rhinoscriptsyntax as rs

  def UpdateSelected():
      insts = rs.GetObjects("Select block instnces to refresh.", 4096, preselect=True)
    if  insts:
    names  = [rs.BlockInstanceName(inst)for inst in insts]
    for name in list(set(names)):
        if not rs.IsBlockEmbedded(name):
            rs.Command("-BlockManager Update " + chr(34) +name+ chr(34) + " Enter")


It’s complaining about indentation. I messed with them a bit to try and make it look like yours but no joy.

I obviously have no idea what I am doing here (471 Bytes)

Try the attached - it looks like the formatting got hosed.


Winner. Thanks Pascal.

Thanks so much for this script, Pascal. I just managed to alter it to change the linked file for a block - saves me 5 clicks and going an extra 2 dialogs deep into the BlockManager and back out. I update linked blocks (to another file in same folder) many times a day - really wish I knew this was something scriptable a long time ago!

I guess with this script I personally don’t need it nearly as much, but how is V6 progress looking on a new and improved non-modal BlockManager?

Thank you again, Pascal, and to @wynott for bringing this up!

1 Like

Hi Pascal,

you non-python version was great too, I used it the last years.


_-RunScript (
Option Explicit
’Script written by Pascal
’Script version Wednesday, March 14, 2012

Call UpdateSelectedBlocks()
Sub UpdateSelectedBlocks()

Dim aObj: aObj = Rhino.GetObjects(“Select blocks to update.”, 4096, True)
If Not isArray(aObj) Then Exit Sub

Dim sBlock, aUpdate(), n
n = 0

For Each sBlock In aObj
ReDim Preserve aUpdate(n)
aUpdate(n) = Rhino.BlockInstanceName(sBlock)
n = n + 1
Dim aFinal: aFinal = Rhino.CullDuplicateStrings(aUpdate)

Dim str
str = “”

Rhino.EnableRedraw False
Dim X
For Each sBlock In aFinal
X = Rhino.BlockInstanceName(sBlock)
str = str & " _Update " & chr(34) & sBlock & chr(34)

str = “_-BlockManager” & str & " _Enter _Enter"

Rhino.Command str, False

Rhino.EnableRedraw True
End Sub