- sketchup community · pdf filein that new project, i created a new ruby-file named...

26
Ok, preparation steps done: installed SketchUp 2014 to "D:\SketchUp 2014\SketchUp.exe" installed RubyMine 6 to "C:\Program Files (x86)\JetBrains\RubyMine 6.0.1\bin\rubymine.exe" installed SketchUp-Ruby-API Debugger from https://github.com/SketchUp/sketchup-ruby-debugger by putting the (32 bit-) version of "SURubyDebugger.dll" into the respective SketchUp root directory, that is: "D:\SketchUp 2014\SURubyDebugger.dll" made a small test-script which I named „testSU.rb“, containing just the following: puts "Hello World!" Sketchup.active_model.entities.add_line [0,0,0], [9,9,9] puts "thats all folks!" this script I made inside RubyMine into a project on its own: "C:\Users\kr\RubymineProjects\SketchUpTest\HelloSketchUpWorld.rb"

Upload: vuhanh

Post on 16-Mar-2018

216 views

Category:

Documents


2 download

TRANSCRIPT

Ok, preparation steps done:

– installed SketchUp 2014 to "D:\SketchUp 2014\SketchUp.exe"– installed RubyMine 6 to "C:\Program Files (x86)\JetBrains\RubyMine 6.0.1\bin\rubymine.exe"– installed SketchUp-Ruby-API Debugger from https://github.com/SketchUp/sketchup-ruby-debugger by putting the (32 bit-) version of

"SURubyDebugger.dll" into the respective SketchUp root directory, that is: "D:\SketchUp 2014\SURubyDebugger.dll"– made a small test-script which I named „testSU.rb“, containing just the following:

puts "Hello World!"Sketchup.active_model.entities.add_line [0,0,0], [9,9,9]puts "thats all folks!"

– this script I made inside RubyMine into a project on its own: "C:\Users\kr\RubymineProjects\SketchUpTest\HelloSketchUpWorld.rb"

Start RubyMine, create a new project:

I named it „SketchUpTest“:

In that new project, I created a new Ruby-file named „HelloSketchUpWorld“: right click upon the project folder, „new“ -> „file“ -> „HelloSketchUpWorld.rb“:

I filled that file with just 3 lines of simple Ruby-code:

Set a line break-point on the 1st line, made a right click on the „HelloSketchUpWorld.rb“ entry of the project tree and selected „Debug 'HelloSketchUpWorld.rb'“ as action:

Voila, it runs till the first breakpoint and sits & waits for user actions:

pressing „F8“ to step over that line and switching to the „Console“ window shows that everything works as expected:

The Ruby debugger processed the 1st line as it should. Another F8 drives the debugger into an error -as expected, because the 2nd line holds SketchUp specific code to draw a line which cannot be handled within just RubyMine:

So it is time to remote connect the SketchUp.exe with the RubyMine IDE! I did so as described on http://forums.sketchup.com/t/please-help-me-to-setup-de-debugger-on-rubymine-for-mac/289 , just adapted a bit to my Windows 8.1 configuration:

Invoke „Run“ -> „Edit Configurations...“:

Obviously, there lacks a „remote debug“ entry, so I created one:

– select the „Ruby“ root node and click on the upper left plus sign to create a new entry (note: it must be done on the „Ruby“ node, not the „HelloSketchUpWorld“ one):

– choose „Ruby Remote Debug“

– now RubyMine comes up with a template to fill out:

I gave it the „Name“ = „SketchUp 2014“, set the „remote port“ to 7000, let the „local port“ at the (magic?) default 26162 and set both folders „remote root“ and „local root“ to where my HelloSketchUpWorld.rb file is lcoated, that is: "C:\Users\kr\RubymineProjects\SketchUpTest“, but didn't close the dialog with „OK“, as I also wanted to link the start of the Sketchup2014-exe with a VBS as well:

So I started a notepad in parallel, pasted in the 4 following lines, which where just adapted to my SketchUp.exe and saved that stuff as "D:\SketchUp 2014\Remote_Debug_SketchUp2014.vbs" (that is, I made it into the same directory where SketchUp itself is located):

Dim objShellSet objShell = WScript.CreateObject("WScript.Shell")objShell.Run("""D:\SketchUp 2014\SketchUp.exe"" -rdebug ""ide port=7000""")Set objShell = Nothing

Having the VBS-script in the right place, I continued to add the proper „Before launch“ entry by clicking on the green plus sign and select „Run external tool“

In the new dialog, I selected my new „Sketchup 2014 Remote Mode“ and clicked upon the green plus sign to add a tool setup:

RubyMine presents a new „Creat Tool“-dialog that I filled in as follows:

- „Name“ = „Invoke SketchUp 2014 Remote Debug“– „Group“ = „Debug SketchUp“– „Description“ = „Wscript to launch SketchUp 2014 in debug mode at port 7000“– „Program“ = „wscript.exe“– „Parameters“ = „"D:\SketchUp 2014\Remote_Debug_SketchUp2014.vbs"“ (note: within „“)– „Working Directory“ = „D:\SketchUp 2014“ (note: w/o „“)

Some „OK“s later, I'm back in RubyMine's regular main window. There, a right click on the „SketchUpTest“ project now offers a „Debug SketchUp“ group with my newly created „Invoke SketchUp 2014 Remote Debug“ item in it:

Selecting it, the VBS-script starts and shoots up SketchUp 2014, but afterwards, SketchUp just sits there and does nothing:

Switching back to RubyMine, it just says.. ..nothing?:

That the VBS-script finished is okay in my opinion (as it did start SketchUp in remote debug mode); however, RubyMine states also that the Ruby script finished (at least there is no such thing as an active debug mode or somethin similar), no error, no console, no option to step in/over, etc.: nothing!?

SketchUp is „frozen“, sitting there and waiting for something to happen, it must be manually killed with the task manager.