Peter, can you please run the attached version in the too-long situation and send me or post the contents of the output window? Thanks - also please Pre-select the block instance to update so that selection does not come into the timing.
The too-long situation only happened in the original script, now it seems to be doing well with this script.
I did update my rhino this morning it was not an update that was presented by rhino itself, but I had to click “check for updates” manually to find that there was an update. I don’t know if this fixed anything but here are the results of the debug script.
37657.01
Stage 1 Time in Seconds = 0.2109375 37657.22
Stage 2 Time in Seconds = 0.2109375 37657.22
Stage 3 Time in Seconds = 0.2109375 37657.22
Stage 4 Time in Seconds = 0.2109375 37657.22
37660.19
Hi Peter- so, just to be sure— the debug script and the previous one that I updated are the same except for a timer in the debug so I could see where the lag was. So - both should be equally quick or slow. If it’s all working better now, just delete the debug version.
Hi Micha- the ‘correct’ one is attached way up the thread, I’ll attach it again here- as far as I can tell it does work now- it is a very simple and dumb script…
I try to collect my favourite tools to a toolbar so that I can easy back up it and transfer it to a fresh installation. Did I something wrong here? It doesn’t work.
_-RunScript (
Option Explicit
’Script written by Pascal
’ RMA
’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
Next
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)
Next
str = "_-BlockManager" & str & " _Enter _Enter"
Rhino.Command str, False
Rhino.EnableRedraw True
Hi Micha- just put UpdateSelectedBlocks , as a command, on your toolbar. Does that do it? (You do need to have the script drag and dropped to load at startup for this to work. If you want to put the entire script on the button, then
remove or comment these lines:
Rhino.AddStartUpScript Rhino.LastLoadedScriptFile
Rhino.AddAlias “UpdateSelectedBlocks”, “NoEcho -Runscript (UpdateSelectedBlocks)”
and
un-comment this one
’Call UpdateSelectedBlocks()
(i.e. remove the ')
and then put the entire thing inside parentheses like so, with _-Runscript: