For those playing at home, I’ve sent @eirannejad the log output, but it looks like things might be choking on the fact that there’s a space in the directory path for my home directory. Just waiting to hear if that’s a correct interpretation or I’m horribly wrong.
Yup. Home directory is C:\Users\Jason Gillman\... that has a space in the middle I will fix the code to wrap the paths so spaces aren’t an issue.
Logges as RH-66372
Update: Fixed and pushed but I’m not sure if it is going to show up in today’s release. If not it’s gonna be in next weeks’
Using the Format command on a Python file in the Rhino Code Editor has unexpected consequences. It turned:
ignore_colors = False # Set to True to minimize memory usage.
into:
ignore_colors = (
…False # Set to True to minimize memory usage.
)
The python script still executes but it is no longer tidy for reading.
It seems as though Format is applying what makes sense for C# type formatting to the Python script. What I really want is my own formatting with all tabs and no spaces at the start of lines like what I could do in Rhino 7 Python Editor.
The Format command turns all my tabs into spaces so that there are no more errors when I add lines. Well mostly no errors. I find that the code completion monitoring can cause typing results not to show on the screen for over 5 sec and then it sometimes does not ever restart and I have to kill and restart the Rhino Code Editor. This happened when I was typing: print(‘Select file’) → it hung up before I could finish typing the rest of the ‘Select file’ string. Is there a way to turn off command completion? I mostly do not need it and currently it makes editing so painful that I use the old Rhino 7 Python Editor instead. Then I copy and paste into the Rhino Code Editor for execution in Rhino 8 WIP.
The message area at the bottom is now scrollable which is very good.
The Rhino Code Editor now almost fits in the Rhino Window when it first comes up. It is still about 10% too tall. Again this only occurs on the native laptop screen not when I am using my external 42" Display.
So nice progress. Thanks for your work on the Rhino Code Editor.
Closed RH-66280. RhinoCode now has language options. Diagnostics can be toggled through this options window for each language independently. More language-specific options to be added to this window later. See “Toggle Diagnostics” in Edit menu as well
I’ll update the language editor in the future so it has a better ui. Each option really has 3 states Default: whatever the default setting is in editor Checked: This will be stored in config file as user preference UnChecked: This will be stored in config file as user preference
Editor now focuses on diagnostic lines when clicked in the diags panel items
Editor now can activate minimap
CPython runtime now includes header files (necessary for some packages on macOS)
CPython runtime directory changed from cpython-X.X/3.X.X format to python3.X-X.X. It’s simpler and shallower now
CPython runtime config file is now called config.json and does not include the version anymore. that is reflected in the directory name
~/.rhinocode now includes logs/ for log files. Rhinocode logger will now dump logs and stack trace on dotnet fails with unhandled exception
Rhino.Runtime.Code does not reference RhinoCommon anymore. This is to keep the api clean for future
CPython now does not install packages every time the script is opened. It checks the script packages against what is already installed in the environment and caches this information during the session
Welcome panel now shows a link to release notes
Improved RhinoCode server and cli for upcoming vscode integration
Editor now support converting indentation types. Closed RH-66341
One nice feature in the Rhino 7 Python Editor (and Visual Studio Editor) is that clicking on an error line in the message window at the bottom of the editor jumps to that line in the code. Big time saver. Just want to make sure this is in your sights.
One serious problem I am having in the Rhino Code Editor is that some of my long lines (more than 100 characters) are not editable without becoming mangled (dropped characters). It can look ok on the display but if I Save, Exit Editor, Reopen Editor, then I see the mangled line. I will try to put together a simple test case that shows this.
Great thank you. I know where the problem are is for this specific issue. This needs cleanup and improvements to be robust. Please DM me any/all the examples you have
import rhinoscriptsyntax as rs
import scriptcontext as sc
import Rhino
current_doc: Rhino.RhinoDoc = sc.doc
rs.MessageBox("Hello")
And this is the error it threw:
Obviously not liking the colon used to specify the expected type.
Also doesn’t seem to like the -> for specifying method return types:
def increment_hsv(rgba, inc_amt) -> System.Drawing.Color:
"""
Increment the Hue degree and return the new System.Drawing.Color object
:param rgba: The current object
:param inc_amt: The amount to increase the hue
:return:
"""
temp_hsv = Rhino.Display.ColorHSV(rgba)
current_hue = temp_hsv.H
temp_hsv.H = current_hue + inc_amt
return temp_hsv.ToArgbColor()
Based on what I’m seeing for the available signatures, I’m guessing it’s not liking default_number
def RealBox(message="", default_number=None, title="", minimum=None, maximum=None):
"""Display a dialog box prompting the user to enter a number
Parameters:
message (str, optional): a prompt message.
default_number (number, optional): a default number.
title (str, optional): a dialog box title.
minimum (number, optional): a minimum allowable value.
maximum (number, optional): a maximum allowable value.
Returns:
number: The newly entered number on success
None: on error
Example:
import rhinoscriptsyntax as rs
radius = rs.RealBox("Enter a radius value", 5.0 )
if radius:
point = (0,0,0)
rs.AddCircle( point, radius )
See Also:
GetReal
"""
if default_number is None:
default_number = Rhino.RhinoMath.UnsetValue
if minimum is None:
minimum = Rhino.RhinoMath.UnsetValue
if maximum is None:
maximum = Rhino.RhinoMath.UnsetValue
rc, number = Rhino.UI.Dialogs.ShowNumberBox(
title, message, default_number, minimum, maximum
)
if rc:
return number