How many polygons do I have in the file?

ok i think you´ve found a funny bug in Rhino4 which i`m able to reproduce but without a crash on startup.

You said you`ve now removed the script and Rhino4 starts in regular mode. Once Rhino4 started, do you see something like this in the commandline (Press F2 to see the full report after startup):

Cannot find script file C:\ThePathToYourScript\PolyCount.rvb

if this is the case, please go to Rhino Options / General and look on the right side of the dialog for “Command Lists”, “Run these commands every time Rhino starts”. This is a list of commands Rhino runs during startup. The picture is shown below.

Is this list empty or do you see the PolyCount.rvb with it`s path listed ?

@pascal, i have created a script which adds an alias and loader as you do with almost all your scripts. But i left one call in the script to run it immeadiately. I´ve noticed that this construction adds the alias so that rhino calls the command right after starting rhino … invoking the script and asking for selection of objects.

The thing i don`t get here, is an empty startup command list in the Rhino4 Options dialog:

but to my surprise my registry for Rhino4 startup commands shows this:

How is that possible ? The only plausible explanation i could imagine is that flo saved the script in the plugins folder which Rhino4 searches in if the script (which is self-tagged to run on startup) is not found.
In my case, the script is in a folder which is part of my file search paths, so the same error happens. The only way to prevent it from loading was to rename it, because the startup command list in Rhino 4 is empty.

i´ll try if this can be reproduced in Rhino5 too.

c.

Hi Clement,

I get this:
RhinoScript loaded.
Cannot find script file C:\Users\Michael\Desktop\PolyCount.rvb

the Command list is empty…

Greetings,
Flo

@flo ok, i´m glad we´ve found the reason. To finally get rid of the error message, you can do this carefully. EDIT: steps 1-7 not required. read post by pascal below.

  1. Close Rhino4
  2. Open regedit
  3. Navigate to the location shown in my second picture (see statusbar for full path)
  4. On the right side, locate the entry line with “C:\Users\Michael\Desktop\PolyCount.rvb”
  5. Select the item in the name column, in my picture it is in blue “File0”
  6. Right click only on this single item and delete it
  7. Close regedit and start Rhino4

the “Cannot find script file…” message after starting Rhino4 will then be gone. As an alternative to run the script in Rhino4, you can make a new toolbar button using this button command:

! _-LoadScript "C:\Users\Michael\Desktop\PolyCount.rvb"

I asumed the script is still located on your desktop, if not you`ll need to use the proper path to it. The script can be used from this toolbar button instead of typing the word “PolyCount”.

Note that if you move the script again to a different location, it will not be found. The same happens if you drag and drop scripts which add themself as a startup command.

c.

Hi Clement- I am not sure I follow completely but the startup commands list and the load at startup scripts list are not the same. The latter is under Options > RhinoScript page. If there is a script in there that calls itself, regardless of adding an alias or not, it will try to run when Rhino starts. The AddStartUpScript method adds the drag and dropped script to this list of scripts to load at startup, and AddAlias adds an alias to Options > Alias. Neither does anything with the startup commands list in your image.

Dunno is I am making things any clearer or muddier…,

-Pascal

clearer thanks, you should have chimed in much earlier :smile: You`re absolutely right. The add startup script should appear under RhinoScript not under general. So @flo the change in registry is not really needed and if you made it though, you´ve just removed the path from the page under RhinoScript.

What remains a mystery to me, is, if you look at my script above, it doesn`t add a startup script, this was removed once i’ve updated it. And even with a missing path, why should it prevent Rhino4 from starting or crash it ? I was not able to repeat that, instead it just gave me the error message that the script was not found.

back to work in V5.
c.