V8 script compiler issues

Trying to update my scipts for V8, and the V8 compiler has issues that I can’t figure out. Well, probably could - but one of you probably knows the answer without hours of experimenting.

The Python 3 compiler gives me a syntax error at ‘None’ at the end of the GetMultipleObjects line:

import rhinoscriptsyntax as rs
import Rhino
import scriptcontext as sc

def main():

rc, objrefs = Rhino.Input.RhinoGet.GetMultipleObjects("Select surfaces, polysurfaces, curves, subds, and meshes to annotate",False,Rhino.DocObjects.ObjectType.None)
if not objrefs or rc != Rhino.Commands.Result.Success: return

if( name == “main” ):

Change None to NONE when it is part of a Rhino-defined enum. Everywhere where None was used as part of the RhinoCommon API this had to be renamed to NONE since None is a Python3 keyword.

@eirannejad I wonder if we can just do a preprocess to replace .None with .NONE

Or at least notice the existence of .None and provide guidance

1 Like

See RH-66291 RhinoCode: Accessing Dotnet member with name of “None” was invalid code in Python 3 .

Yes, guidance would be great.

Script editor does provide an error when .None is used anywhere in code:

Are diagnostics enabled on your editor? Right-Click on script or script tab and select “Language Options” nad make sure Diagnostics (Linting) is on


Yes, I’m set up like that. The editor shows that there is a syntax error, but no further guidance. If I click on Help->Help Topics, it brings me to help for Rhinoscript, so…not helpful.

I see. Okay I’ll make sure the error mentions you can use .NONE instead

RH-77801 Python lint to mention to use .NONE instead of .None

1 Like