Complete Crash?
-
What can I do to debug a plugin when Sketchup just crashes and closes without any message or chance to see a problem on the Ruby console?
My guess is that it's having problems colouring some faces, but it really shouldn't. -
hi
are you running it from the 'plugins folder' or from Ruby Console.
I turn off 'ruby' [the plugins folder] and run the new script from console either by copy pasting all [mac only] or line feeding.
that eliminates clashes with other plugins.
if all works fine I turn Plugins back 'on' and retest.
john
-
OK, I've narrowed it down a bit and this seems to be the line that makes it crash:
savePath = UI.savepanel("Save results file",model.path,"Sunlight analysis.csv")
If I Process.exit() just before that, SU stays open. Otherwise it crashes. Weirdly, though, not always. On a few occasions it survives. This is on Windows Vista: never had this problem on Mac in a whole lot of testing.
-
OK...it doesn't crash if just before showing the savepanel I put a line of code to show a simple messagebox: then the savepanel shows. Although the messagebox is nowhere to be seen.
Then I tried this code:
if UI.messagebox("Save results to file?", MB_YESNO) == 6 savePath = UI.savepanel("Save results file",model.path,"Sunlight analysis.csv") # If the user doesn't press cancel; if savePath outfile = File.new(savePath, "w") outfile.write(allResults) outfile.close() end end
Now when the execution reaches this point SU suddenly switches program, i.e. as if someone had pressed Alt+Tab. It's still there, but I have to reopen it. And the messagebox still isn't anywhere, hence neither is the savepanel. I just seem to have gotten the UI very confused in general.
Advertisement