What happened to rhinoscriptsyntax sr12!?

Just updated to SR12, ran a script I had just run in SR11 and received this error message:

 'module' object has no attribute 'GetReal'

The module being rhinoscriptsyntax!!!

What happened to GetReal, GetString, GetInteger, etc.?

Hi Guido,

I have not updated yet, so I checked to find the file where Get… methods reside:
userinterface.py

Do any of the other rhinoscriptsyntax methods work?

At my machine they are located in:
C:\Users\username\AppData\Roaming\McNeel\Rhinoceros\5.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\rhinoscript

Can you locate that folder and find userinterface.py?

-Willem

Hi @gmacarchitect,

Did you have any files locked that were in the
C:\Users\username\AppData\Roaming\McNeel\Rhinoceros\5.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\rhinoscript
directory when you did the update?

Can you check that, i.e., close any external programs that have some of those files opened, and restart Rhino?

Alain

I guess I’m confused now.
I reported something like this on February 22 after problems with the WIP.

Steve then created an issue in YouTrack and I’ve been waiting since for this to get solved - with an error message appearing each time I start Rhino and automatically load that script. Looking at RH-29960 now, it looks like this was fixed in March - but I’m still getting the ‘module’ object has no attribute ‘Get[something]’ error.

@wim, this concerns the SR12 release candidate just released, not the WIP.
For the record, I am not experiencing the same problem here with the current SR12 RC.
–Mitch

Yes, I understand this is RC 1 SR 12 but it sounded like a regression - not sure how that trunk code stuff works…

At the time I reported this you chimed in with stuff that didn’t work on your end.
OK, going through that thread a bit more careful now, I see that @stevebaer only replied to the issues that you found.
I guess I’ll have to see if anything gets solved in this current thread that will also solve the problems I’m having :worried:

@Alain thanks! That solved it!

Great!

@wim, so you’re still having problems with Rhino wip? You’ve confirmed in the other thread that you mentioned that those directories exist.

Does the content of your C:\Users\username\AppData\Roaming\McNeel\Rhinoceros\5.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib directory look like this?:

rhinoscriptsyntax/
    application.py
    block.py
    curve.py
    dimension.py
    document.py
    geometry.py
    grips.py
    group.py
    hatch.py
    layer.py
    light.py
    line.py
    linetype.py
    material.py
    mesh.py
    object.py
    plane.py
    pointvector.py
    selection.py
    surface.py
    toolbar.py
    transformation.py
    userdata.py
    userinterface.py
    utility.py
    view.py
rhinoscriptsyntax.py
scriptcontext.py

And does userinterface.py contain the missing functions?

Thanks for your support. I’ll check that as soon as I get a chance!

Hi @Alain,
I’ve now had a chance to look at this again.
Attached is the output of

dir . /s > dir.txt

run from a cmd prompt in the following directory.

C:\Users\\[USER]\AppData\Roaming\McNeel\Rhinoceros\6.0\Plug-ins\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib
dir.txt (2.7 KB)

Hi @wim,

Just to make sure … if you type the ‘EditPythonScript’ command from Rhino wip and then select “options…” from the “Tools” menu do you see that directory in the “Module Search Paths” box? I’m asking because you have \6.0\ in your path and instead it could be something like \wip\.

After you check that can you confirm that userinterface.py contains the missing (GetReal, GetString, …) functions?

Thanks,
Alain

Hi @Alain,
the directory containing \6.0\ is also listed in the “Module Search Paths” box under Tools > Options from the Rhino Python Editor window, yes.

There is no […]\wip\ folder on this machine.

As for the userinterface.py file, there is one called like that in the …\IronPython (814d908a-e25c-493d-97e9-ee3861957f49)\settings\lib\rhinoscript directory and the GetReal function is in there, yes - see screenshot:

Hmmm. I’ll ask the same question you asked Guido. Do any of the other rhinoscriptsyntax functions work?

And are you getting the exact same error message that he was having?

Sorry to be so demanding but since I can’t duplicate the problem it’s hard to know what’s going on.

Thanks,
Alain

I just tried running Mitch’s QuadMirrorWHistory.py script as a test and got a “Message: ‘module’ object has no attribute ‘GetPoint’” error. Should I test something else specifically?

As for the exact error message:

@wim thanks for posting the dialog screenshot.

The problem is with the AutoCPlane.py file. The top of the file looks like this:

import rhinoscript.userinterface
import rhinoscript.geometry
import Rhino
import scriptcontext
import System
import math
import time
import rhinoscriptsyntax as rs

The last import normally loads all the modules and all functions are associated with the “rs” alias but since the userinterface and geometry modules have already been loaded in the 1st 2 lines they won’t be reloaded and the functions from these modules won’t be associated with “rs”. That’s why “rs.GetInteger” on line 250 fails. Delete the 1st 2 imports and then reset the python engine and everything should work.

Let me know how this works out.
Alain

Boy, that was simple enough - if you know where to look :sunglasses:
Thank you, @alain!!

By the way, do you know why it suddenly stopped working after a Rhino update?

probably just a coincidence that AutoCPlane.py was the 1st file you loaded after the update.

Yes, it’s set to auto-load on start-up.
But are you saying that somehow lines 1 and 2 were added automatically? I don’t understand how the first script run after an update would become ‘corrupt’.

The lines were not added automatically but the author of the script probably forgot to remove them. If a file that has the

import rhinoscriptsyntax as rs

import statement is loaded before AutoCPlane.py is loaded then the bug won’t manifest itself.

Hi Alain- thanks for your explanation - I can only plead ignorance, I did not know that, but on the other hand I have never imported other than the entire rhinoscriptsyntax that I know of- probably this was a copy/paste, since I was getting help left and right with this thing.

anyway, thanks for the heads up

-Pascal