Giter Club home page Giter Club logo

Comments (6)

sbaer avatar sbaer commented on July 17, 2024
from scriptcontext import doc

Is not a good thing to do in a separate module. Modules in python are loaded and executed once. This means that the doc variable will point to the correct doc the first time the module is run, but may be pointing to an incorrect doc when the module is run in the future. I would recommend always calling scriptcontext.doc instead.

from ghpython.

bengolder avatar bengolder commented on July 17, 2024

Thanks Steve.

also, I probably could have avoided this by calling RhinoDoc.ActiveDoc instead of scriptcontext.doc in my separate modules.

from ghpython.

sbaer avatar sbaer commented on July 17, 2024

I would avoid RhinoDoc.ActiveDoc if possible and always use scriptcontext.doc. Mac Rhino is a multi-doc application and the ActiveDoc can switch.

from ghpython.

bengolder avatar bengolder commented on July 17, 2024

Thanks Steve! will keep that in mind.

from ghpython.

piac avatar piac commented on July 17, 2024

Variable assignment (document switching) is something that should not be sticky between sessions in any way. Also, I just tried the steps described above now and nothing happens, so a first guess would be that the crash depends later from additional side effects in the script... it might be in different places.

Did you manage to isolate the provoking part in the script? If not, can you check if, after reducing the script to a minimum set of operations and restarting Rhino, the crash disappears?

from ghpython.

bengolder avatar bengolder commented on July 17, 2024

before I could find the steps to recreate it, I tried another reinstall of grasshopper in order to resolve it. That worked. I can switch target docs again.

Now I'll see if I can break it again.

from ghpython.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.