Rhino 8 Feature: ScriptEditor (CPython, CSharp)

@Terry_Chappell What’s you laptop screen height? Would you mind sending an screenshot of how the editor does not fit?

rhinoscriptsyntax still needs cleanups to make it work with cpython. I have logger this here RH-66339

1 Like

thanks

Here is a screen shot of my entire laptop screen:


The editor window runs off the page at the bottom.
Here is a similar screen shot with Rhino 7:

The editor window stop neatly at the bottom of the Rhino window.

This issue would be less of a problem if the message region at the bottom was scrollable. Currently it is fixed and more can be seen only by moving the partition line between the text of the script above and the message window below. Making the message portion of the editor window scrollable is more important that even getting it to fit in the Rhino window. This is because with lots of messages, the message window cannot be expanded upwards enough to read all of the messages.

Four fixes are needed for good operation on the native screen of my laptop (the editor window fits inside the Rhino window when I use a 4K display with my laptop):

  1. Message window needs to be scrollable like in Rhino 7 Python Editor
  2. Rhino Code Editor needs to fit in Rhino Window.
  3. Font needs to be changeable to Consolas 12 for much better readability
  4. Need option for Tab key to make tab characters and not 4 spaces. This option is in Rhino 7 Python Editor
  5. Should be able to add new lines without editor complaining about illegal syntax. This happens now because my script came from Rhino 7 and has all tabs which works until I try to add a new line which is injected with spaces on left instead of tabs which causes illegal tabs and spaces mixture error.
  6. Search and Replace need to work (this you already know)

Regards,
Terry.

Checked items have a fix and will be released with the new WIP tomorrow. Others marked as in progress for later releases:

  • Message window needs to be scrollable like in Rhino 7 Python Editor → RH-66354
  • Rhino Code Editor needs to fit in Rhino Window → RH-66355
  • Font needs to be changeable to Consolas 12 for much better readability → RH-66351
  • Need option for Tab key to make tab characters and not 4 spaces. This option is in Rhino 7 Python Editor
  • Should be able to add new lines without editor complaining about illegal syntax. This happens now because my script came from Rhino 7 and has all tabs which works until I try to add a new line which is injected with spaces on left instead of tabs which causes illegal tabs and spaces mixture error
  • Search and Replace need to work → Logged RH-66353
2 Likes

Ehsan,

  1. In the Rhino 7 Python Editor under the Edit tab there is a Selection option the provides some nice functions as shown below.


    I notice that the new Rhino Code Editor also has a Selection option but it is not yet active. Will it incorporate similar functions? Some of these functions deal with tabs so its related to the 3rd checked item in your list.

  2. One function I find very useful in the Visual Studio Editor is Go To Line as shown below:


    There are many other Go To functions as well but Go To Line is really all that applies to a simple text editor. Would you please consider adding a Go To Line option in the Edit tab? Ctrl+g would be the logical shortcut to quickly access this function.

  3. Thank you for your excellent work on the Rhino Code project. It is going to provide a much needed improvement to the Rhino-Python environment → We get to jump from IronPython 2.7 to Python 3.9. Wow!

Regards,
Terry.

1 Like

So… am I the only one excited that we can use type hints now?

:eyes:

3 Likes

Type hinting is nice.

  1. That’s the goal. RCE uses Monaco editor control which is what vscode uses so some of these functionality is already provided by the control and are easy to expose in the menus and UI. We’ll incorporate them as we go e.g. “Convert Indentation” has already been added for next release.
  2. Logged as RH-66361
  3. You are most welcome.
1 Like

f-strings for the win

3 Likes

Notepad++ has a nice feature where you can search across closed files. So if you are writing a script, and you recall using a particular method in the past, you can search for it across all of your scripts in a specific folder. Then Notepad++ lists the files and the lines where it was used. I use that pretty frequently, so I thought I would mention it since we’re throwing ideas out there.

Thanks,

Dan

3 Likes

Yup we are gonna have a file browser on the side with search and replace

2 Likes

100%

It’s painful to not be able to go string_var = f'Here is some random variable: {rando_var}' after using it almost daily

1 Like

Thanks Steve. I’m reading the thread as a more casual writer of small basic python scripts, just wondering what the repercussions are (and how much of a revelation/difference/impact this can have for such casual activities).

So all this excitement’s got me ready to pull the trigger early and pick up a license for v7 so I can get access to the v8 WIP.

I think I asked earlier, and may have missed the answer, but I like doing environment management manually, and development in PyCharm, so how is the environment going to be managed and where will the location of the interpreter be?

This way I can point pycharm at the right place

1 Like

RhinoCode sets up the python runtime under ~/.rhinocode directory. I’d love to know more about how you setup your environments to make it usable for you as well

1 Like

So really nothing too fancy on my end. Just do ye ol’ conda create --name env_name, activate the environment, and install packages (usually via pip) as needed.

Most of my Python work is actually done on Linux, but I’ve found Windows 10 not too bad to work with.

We’re going to support/expose virtual environments in RhinoCode. See ~/.rhinocode/python3.9-1.10/site-envs/default-*. This is the default env setup for scripts. We’re testing to make sure everything is working and then expose this option probably thru a tag like # env: my-project so custom environments can be created for your scripts.

Support for conda is also in the works. Althought the modern pip is pretty powerful

3 Likes

Well, just pulled the trigger. Hoping to get a chance to take a crack at the new stuff tonight!

1 Like

Thank you! Would love to work with you (everyone here) to get your feedbacks and make this a great editor that can work for you