ScriptEditor Bug

@eirannejad what could be causing the following?

@stevebaer this.problem exists from the times of ironpython. When an script always refers to thw first file instead of second opened file. What is happening here?

compas_rhino selection methods (essentially bunch of rhinoscript selection methods) has a strange bug:

  • selection commands works on a freshly opened rhino version
  • when you open a new file in an existing rhino file, these commands are not found
  • only way to make this work is to restart rhino

I think this is a rhino bug, that we cannot solve for a decade…


@Petras_Vestartas Sorry for the delayed response. Please give me a bit more context. I see python 3 in the screenshots but you are referring to IronPython(?).

  • Where are these commands?
  • Are you running them inside the new script editor or from Rhino command line?
  • What is the expected behaviour? Please be as descriptive as possible so I can try to replicate on my side :folded_hands:

Hi,

The code is here, it is a scripeditor python project:

Look at the end of the video 1:16 minute, when I open a new rhino file on existing one. Any selection command from python results in an error:

Error:


Command: _RV_pattern_supports
Add or Remove supports ( Add  Remove ): Add
Traceback (most recent call last):
  File "file:///C:/Users/petrasv/.rhinocode/stage/4bxlfksa.dha", line 99, in <module>
  File "file:///C:/Users/petrasv/.rhinocode/stage/4bxlfksa.dha", line 61, in RunCommand
  File "C:\Users\petrasv\.rhinocode\py39-rh8\site-envs\brg-csd-5H3xDoTG\compas_rv\scene\patternobject.py", line 80, in redraw
    self.clear()
  File "C:\Users\petrasv\.rhinocode\py39-rh8\site-envs\brg-csd-5H3xDoTG\compas_rui\scene\meshobject.py", line 522, in clear
    super().clear()
  File "C:\Users\petrasv\.rhinocode\py39-rh8\site-envs\brg-csd-5H3xDoTG\compas_rhino\scene\meshobject.py", line 76, in clear
    compas_rhino.objects.delete_objects(self.guids, purge=True)
  File "C:\Users\petrasv\.rhinocode\py39-rh8\site-envs\brg-csd-5H3xDoTG\compas_rhino\objects.py", line 636, in delete_objects
    purge_objects(guids, redraw=redraw)
  File "C:\Users\petrasv\.rhinocode\py39-rh8\site-envs\brg-csd-5H3xDoTG\compas_rhino\objects.py", line 672, in purge_objects
    purge_object(o.RuntimeSerialNumber)
AttributeError: 'NoneType' object has no attribute 'RuntimeSerialNumber'
Error occured running command "e75197a9-573c-411c-8797-f83506f572ad" | Traceback (most recent call last):
  File "file:///C:/Users/petrasv/.rhinocode/stage/4bxlfksa.dha", line 99, in <module>
  File "file:///C:/Users/petrasv/.rhinocode/stage/4bxlfksa.dha", line 61, in RunCommand
  File "C:\Users\petrasv\.rhinocode\py39-rh8\site-envs\brg-csd-5H3xDoTG\compas_rv\scene\patternobject.py", line 80, in redraw
    self.clear()
  File "C:\Users\petrasv\.rhinocode\py39-rh8\site-envs\brg-csd-5H3xDoTG\compas_rui\scene\meshobject.py", line 522, in clear
    super().clear()
  File "C:\Users\petrasv\.rhinocode\py39-rh8\site-envs\brg-csd-5H3xDoTG\compas_rhino\scene\meshobject.py", line 76, in clear
    compas_rhino.objects.delete_objects(self.guids, purge=True)
  File "C:\Users\petrasv\.rhinocode\py39-rh8\site-envs\brg-csd-5H3xDoTG\compas_rhino\objects.py", line 636, in delete_objects
    purge_objects(guids, redraw=redraw)
  File "C:\Users\petrasv\.rhinocode\py39-rh8\site-envs\brg-csd-5H3xDoTG\compas_rhino\objects.py", line 672, in purge_objects
    purge_object(o.RuntimeSerialNumber)