CreateRegions in rhinoscriptsyntax

Are there any rs.“something” that dose the same as CreateRegions command in rhino?

If not, can I use the command to call the command:

import rhinoscriptsyntax as rs
s = rs.GetObject("Pick a surface")
rs.Command('CreateRegions' + " " + str(s), False) #know that this do not work, just a example

Looking for answer that do not use any manual interaction, other that picking the first surface.

I don’t know that command, nor how it works, but you basically type in the command as a macro:

rs.Command(" CreateRegions s",False)

(Use " instead of ’ to indicate the start and end of the command/macro)

You can also add Pause and Enter as commands in a macro, and use space as enter after a command.
Check in Help for more info about macros. _ is to indicate an english command and - is to open up the “hidden” options/text based version. You don’t need to use the ! in combination with rs.Command.

Hope that helps.

Either one works in Python for delimiting a string, and is actually considered to be more “pythonesque”. I still use mostly " but old VB habits die hard… --Mitch

Thanks, that’s good to know!

This do not work, still ask me to “pick a polysurface” when the command is runned.

s = rs.GetObject("Pick a surface") #I pick a surface here
rs.Command("CreateRegions s", False) # Do not like to pick one here.

I think we need to use the pointer to the object s, in my example s points to eb41f2c6-1e5e-40e3-87e1-dc354d4a6367 but

s = rs.GetObject("Pick a surface") #I pick a surface here
rs.Command("CreateRegions eb41f2c6-1e5e-40e3-87e1-dc354d4a6367", False) 

This do not work either.

How about doing this:
ask to pick object.
Select object
Run rs.Command(“CreateRegions”)

But can you use CreateRegions on a surface? I didn’t get any success on that.

I think you need to explain what you want to accomplish.
And add an desired “before and after” Rhino file too.

Tank you so much, you said the correct word that tricked the answer “select”

def CreateRegions(s):
    rs.SelectObject(s)
    rs.Command("CreateRegions", False)
    return rs.LastCreatedObjects()

This snip of code is doing the same as the command CreateRegions in python now.