SketchUcation Premium Membership

 

 

[Plugin] Ruby Console Pro #2

[Plugin] Ruby Console Pro #2

Postby MartinRinehart » Sat May 15, 2010 5:48 pm

Edit: New file (Sun. AM, 5/23/10) includes experimental animated Move code.

Edit: I've moved ou(), out() and outs() outside the protection of the module so, for example, outs() can be used anywhere you would have puts(), before.

Before I begin with the plugin, let me ask that those who like this thank Jim Foltz. I learned how to do this by studying Jim's WebConsole.

This is strictly for developers, hence the announcement here. The console (RCP) looks like this:

input_console.jpg


If you click "Init" you get this:

default_init_code.jpg


You can provide, via Setup, your own init code. Code in the console is executed when you click "Exec" or when you press Enter in the RCP. The output window, for the above code, reports:

sample_output.jpg


The "Save", "Load", "Clear" and "Exit" buttons do what their names promise. "Output" toggles visibility of the Output window. "Setup" launches this dialog:

setup_dialog.jpg


This lets you provide your own default save file, your own init code and "One-touch" commands for F1 through F12 (skipping, on PC, F6). These commands execute immediately when you press the key. Since you can load a program with these keys, there's no theoretical reason why you can't create a model of the Taj Mahal with a single keystroke.

As always, the window with focus receives keystrokes. One-touch commands work when RCP has focus.

We are not heading toward an IDE, here, however. Reason: HTML's textarea widget is not suitable for serious text editing. Sorry.

Extract to your Plugins directory. Ruby Console Pro is added below the Ruby Console in the Windows menu. Use outs to output a string (plus a newline). Use out to output a string plus a single space. Use ou to output a string and nothing else.

Edit: Version 0.? in continuous use developing move code.
Please, register (free) to access all the attachments on the forums.
Last edited by MartinRinehart on Sun May 23, 2010 2:47 pm, edited 3 times in total.
Author, Edges to Rubies - The Complete SketchUp Tutorial at http://www.MartinRinehart.com/models/tutorial.
MartinRinehart
 
Posts: 762
Joined: Mon Jul 27, 2009 1:13 pm
Name: Martin Rinehart

Re: [Plugin] Ruby Console Pro

Postby Chris Fullmer » Sat May 15, 2010 6:54 pm

Hey, I like the looks of thei Martin. I have used Jim's plugin devoutly for a long time (since my first days programming for SU). I can't do without a multi-line editor. I've used Alex's a bit, but I dnot like some of the things it does (specifically wraps everything into a single undo - I want to control that on my own!).

Anyhow, this looks great. I like the F-keys macros. I would use that a lot I'm sure.

I'll be looking forward to this release, thanks!

Chris
Lately you've been tan, suspicious for the winter.
All my Plugins I've written
User avatar
Chris Fullmer
SketchUp Team
 
Posts: 6699
Joined: Wed Nov 21, 2007 3:21 am
Location: Davis, CA
Name: Chris Fullmer
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: landscape architecture
Level of SketchUp: Advanced

Re: [Plugin] Ruby Console Pro with Code!

Postby MartinRinehart » Tue May 18, 2010 2:10 pm

Bug: NameError:

If you Save or Load, then Cancel, you get a NameError and the Save/Load terminates. That's exactly what you wanted when you clicked Cancel, so this one's harmless. Will be fixed next time I UL the file. For now, ignore it.
Author, Edges to Rubies - The Complete SketchUp Tutorial at http://www.MartinRinehart.com/models/tutorial.
MartinRinehart
 
Posts: 762
Joined: Mon Jul 27, 2009 1:13 pm
Name: Martin Rinehart

Re: [Plugin] Ruby Console Pro #2

Postby MartinRinehart » Fri May 21, 2010 5:31 pm

Updated 5/21. New file in original post.
Author, Edges to Rubies - The Complete SketchUp Tutorial at http://www.MartinRinehart.com/models/tutorial.
MartinRinehart
 
Posts: 762
Joined: Mon Jul 27, 2009 1:13 pm
Name: Martin Rinehart

Re: [Plugin] Ruby Console Pro #2

Postby Chris Fullmer » Wed Jun 23, 2010 11:42 pm

ok, I'm finally getting this installed and I'm using it. Or well, I've used it for about 15 minutes. first impressions are that I like it in general. I keep hitting the init button instead of the exec button. So it might be nice to have a larger exec button, and maybe not placed right next to the init button.

I am also not sure that I like that 'enter' executes the code. I generally never want my code to execute until I'm redy to hit the execute button. Perhaps <ctrl>+<enter> could be execute. That might be nice.

I am still undecided on that output screen. I thinik I like it though. I have not used it enough to really know what I think. But I do like how it shows the returned info from each line of code. That is kind of handy.

So far so good Martin,

Chris
Lately you've been tan, suspicious for the winter.
All my Plugins I've written
User avatar
Chris Fullmer
SketchUp Team
 
Posts: 6699
Joined: Wed Nov 21, 2007 3:21 am
Location: Davis, CA
Name: Chris Fullmer
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: landscape architecture
Level of SketchUp: Advanced

Re: [Plugin] Ruby Console Pro #2

Postby Chris Fullmer » Thu Jun 24, 2010 12:37 am

hmm, also it seems to kick out errors for any "end" statement:

end # #<SyntaxError: (eval):1:in `process': compile error\n(eval):1: syntax error>
Lately you've been tan, suspicious for the winter.
All my Plugins I've written
User avatar
Chris Fullmer
SketchUp Team
 
Posts: 6699
Joined: Wed Nov 21, 2007 3:21 am
Location: Davis, CA
Name: Chris Fullmer
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: landscape architecture
Level of SketchUp: Advanced

Re: [Plugin] Ruby Console Pro #2

Postby Dan Rathbun » Thu Jun 24, 2010 7:22 am

Is this 'plugin' still valid ?

.. or is it superceded by the one in the Plugins forum?
[Plugin] Ruby Console Pro with SketchTalk in Motion++

.. or does one use THIS edition if they do not care for the 'SketchTalk in Motion++' features ??
User avatar
Dan Rathbun
Top SketchUcator
 
Posts: 4101
Joined: Tue Oct 06, 2009 3:06 am
Location: Florida, USA
Name: Dan Rathbun
Operating system: Windows
SketchUp version: 2013
License type: Pro
SketchUp use: education
Level of SketchUp: Advanced

Re: [Plugin] Ruby Console Pro #2

Postby Jim » Sun Jul 31, 2011 2:45 am

Hey Dan, didn't you say you were working on a webdialog console, too? How's that coming?
Jim
Global Moderator
 
Posts: 4126
Joined: Mon Nov 12, 2007 10:13 pm
Location: NEOH
Name: Jim
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: other
Level of SketchUp: Intermediate

Re: [Plugin] Ruby Console Pro #2

Postby Dan Rathbun » Sun Jul 31, 2011 5:44 am

Many of my ideas were implemented by Alex. I was working instead on a Win32 native version. I may switch to writing it in C or C++ as I want to do some things using MFC objects, such as docking the toolbar inside the console window (currently it follows the window and "snaps" itself to the upper left corner.)

I have the font handling working OK (need to fix the height sizing a bit to account for different dot pitches.) I can switch between the Google OEM font (Courier New), "Normal" user font, and a "Custom" user font (for say a large bold font used only for classroom lecture, as an example.)

I have the "memory" location working (and solved the issue when then user closes the console with the "X" button,) as well as 3 custom locations the user can set by double-clicking on a numbered button.

Looks like this, except I added a timed reload button (a gem with a clock,) after the reload button (the one with the double load arrows.)
DanConsoleToolbar.png
Please, register (free) to access all the attachments on the forums.
User avatar
Dan Rathbun
Top SketchUcator
 
Posts: 4101
Joined: Tue Oct 06, 2009 3:06 am
Location: Florida, USA
Name: Dan Rathbun
Operating system: Windows
SketchUp version: 2013
License type: Pro
SketchUp use: education
Level of SketchUp: Advanced

Re: [Plugin] Ruby Console Pro #2

Postby jolran » Mon Aug 01, 2011 9:27 am

That looks good, Martin and Dan. Thumbs up for all developpers of these kind of tools.

If I would could wish for 1 feature that is missing(or I have overlooked) in all these editors, is the capability
to fold methods or conditionals etc. When getting longer scripts that helps a lot.

But having longer scripts is maybe not what these "inside Sketchup" code editors was created for, so just a thought of mine.
User avatar
jolran
 
Posts: 641
Joined: Sun Oct 26, 2008 9:23 pm
Location: Sweden
Name: Joel G
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: other
Level of SketchUp: Advanced

Re: [Plugin] Ruby Console Pro #2

Postby Dan Rathbun » Mon Aug 01, 2011 9:23 pm

A console and an editor are two different things.

I'm on Windows, and I suggest using NotePad++, it has block folding.
User avatar
Dan Rathbun
Top SketchUcator
 
Posts: 4101
Joined: Tue Oct 06, 2009 3:06 am
Location: Florida, USA
Name: Dan Rathbun
Operating system: Windows
SketchUp version: 2013
License type: Pro
SketchUp use: education
Level of SketchUp: Advanced

Re: [Plugin] Ruby Console Pro #2

Postby jolran » Tue Aug 02, 2011 6:09 pm

A console and an editor are two different things.



Ok, I see.. I do use notepad ++ as well. To be more precise then, my wish was for folding methods in console.
But I get your point.
User avatar
jolran
 
Posts: 641
Joined: Sun Oct 26, 2008 9:23 pm
Location: Sweden
Name: Joel G
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: other
Level of SketchUp: Advanced

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago

Artisan Organic Toolset - a set of powerful organic modeling tools.

Premium Members get 20% discount!

Ad Machine
Robot
 
Posts: 2012


Return to Plugins

Who is online

Users browsing this forum: artdir31, dmhmaestro69, hmeli, Jambez, KMak, Majestic-12 Bot, prasadm40, Raffao222 and 9 guests