Valid for version 1.0 RC1
of Sketchup plugins d/Code.
Table of contents
Up | Down
Features
- Load and show file
- Syntax beautifying for Ruby files
- Syntax highlighting for Ruby, C, YAML, RHTML, HTML, XHTML, XML files
- Views for encoded, decoded, beautifyed and raw code
- Encryption if Sketchup Ruby Scrambler is availble
- Export current view as HTML file
- Open current file with system preferences
- Write current code to source file
- Write current code to new file
- Reset code field
- Clear complete view
- Select all code in input field
- Select all code in output field
- Encode current Ruby code
- Decode current Ruby code
- Step-by-step evaluate current (Ruby) code
- Mulitlanguage support (English and German at the moment)
- Toolbar icon for fast access
- Menu position configurable
- Separate shortcut definition files for each language
- Resizable window
- Set window back to defined position and size
- Toggling on and off via Sketchup "Windows > Preferences" possible
Up | Down
Requirements
System requirements
The d/Code plugin is usabel with Windows an Mac operating systems. For that you have to care about the requirements Sketchup is asking to the system.
Software requirements
You can use d/Code with Sketchup Pro 6 and Google Sketchup 6.
Up | Down
Dependencies
d/Code depends on one Ruby library, one modified script and some parts of an original Ruby:
Furthermore the following files have to resist in the "Plugins" folder of Sketchup:
- extensions.rb
- sketchup.rb
These files resist in this folder by default after a regular Sketchup installation.
Up | Down
Installation
Plugin installation
- Close all running instances of Sketchup.
-
With the file manager navigate to the "Plugins" folder of your current Sketchup installation.
If this filder contains the file "dcode_loader.rb" and/or the folder "dcode", save them to
a place of your choice and delete it from the Sketchup folder.
-
Copy the file "dcode_loader.rb" and the folder "dcode" to your "Plugins" folder of
your current Sketchup installation.
Installation of required libraries
The required libraries do not need to be installed manually, they will be shipped with this plugin and
resist in the folder "dcode/lib"
Installation of the Sketchup Ruby Scrambler
If you have access to the Sketchup Ruby Scrambler, you can copy it to one of the following folders (or both):
- "Plugins"
- "Plugins/dcode"
After that you will have access to its functionality from d/Code.
Up | Down
User Interface
MenĂ¼
- Plugins: This is the root menu in whicht the d/Code menu is included. You can customize it by
modifying the language file "dcode/lang/decodede.strings"
- d/Code: This is the d/Code submenu.
- Show: Choosing this item opens the d/Code window.
- Set default window: If oyu choose this item, the d/Code window will be positioned on a defined
position with a defined size. For that the current screen resolution you are using will be determined
and the window will fit into it. This functionality is useful i.e. if you use two computer displays
and have had the d/Code window on the second monitor - and later you disconnect this monitor. That will
result in an invisible, nealy unreachable window. By clicking the menu item you can get the window back.
- How to use: If you choose this item you will reach the d/Code help.
- Shortcuts: Choosing this item results in a small window showing the defined keyboard shortcuts
for using with d/Code orderd:
- by shortcut
- by command
- About...: Choosing this item shows a small window which includes version number of d/Code among
other things.
Toolbar
- Handle: The handle (the small vertical bar on the left side of the button) is used to move and
position the d/Code toolbar verschieben.
- Button: Clicking this button opens the d/Code window.
- Tooltip: By moving your mouse over the button a tooltip will be shown explaining the
function of the button.
Window
- Load: If you click this button, a file chooser is displayed, in which you can choose
a file to load. d/Code reads the whole file in one step, the file won't stay opened all the time.
- Save: Choosing this button will save the contents of the input field to the file opened by
clicking the Load button. Keep in mind, that this only is possible, if there aren't changes to the
content. Changes to the content are made by hand. Pressing the buttons for the different views (16 to 19)
do not change the content - your code will stay the some in its contents.
- Save to: Clicking this button opens a file chooser for saving files. You enter a file name for
the file the code from the input field should be written to.
- Save as .rbs: If you have installed the Sketchup Ruby Scrambler to the "Plugins" and/or
d/Code folder an the current shown code is Ruby code, this button is available. If you have made any
changes to the Code and haven't updated the view or executed the code and you want to have these
changes within your .rbs file, please use one of the mentioned buttons. Clicking the "Save as .rbs" button
will than open a file chooser for saving files. You here have to enter a filename for a .rb file to
which the code from the input field should be written. After that the .rb file will be translated into
a .rbs file - the .rb file stays conserved. The functionality of this button only is available for
Ruby code.
- Export HTML:Clicking this button will open a file chooser for saving files, in which you
can enter a HTML file name. In that file the HTML output of the window will be written.
- Clear: Clicking this buttons removes all contents from the input and output fields.
- Shortcuts: When clicking this button results in a small window showing the defined keyboard shortcuts
for using with d/Code orderd:
- by shortcut
- by command
- Filename: In this area the filename of the current loaded file is displayed, if the code
wasn't manipulated from the input field. This file name you can click. The following action is equal
to a doubleclick on the file in a file manager (i.e. Windows Exploerer).
- Select all: Clicking this area selects all contents from the input field.
- Input field: The input field is used to enter code. It has a horizontal and a vertical scrollbar.
Line breaks have to be entered by hand by pressing the Return / ENTER button as it is common in each
ordinary editor. Automated line breaks or wraps do not take place.
- Update: Clicking this button gives the contents from the input field to the plugin to show in
in the Code field. If you have not selected the view "Raw", the code will also be written formatted to
the input field, if the code is Ruby code. If the code from the input field wasn't manipulated, it will
be treated as if it is the code from beginning (loading a file). If you have executed the code and the
output field is visible, it will remain when clicking the "Update" button.
- Reset: This button is used to undo changes made to the code in the input field. It is only
possible to undo changes till the last update / execute.
- Execute: Clicking this button gives the contents from the input field to the plugin for
execution. Unless the view "Raw" is selected, the code will be formatted. Furthermore the output
field will be opend, if it isn't already open. In the output field you can see the step-by-step
execution of the code and possible errors.
- Code field: The code field contains teh contents of the input field with respect to the
choosen view. The field has a horizontal and vertical scrollbar, lines won't be automatically breaked.
- Quickinfo: If the view "Raw" isn't choosen, you will see some quickinfo while moving the mouse over
the code from the code field. The quickinfos contain the type of the hovered element.
- Raw: Clicking this button will show the Code as it was entered (by hand or from file). If the code
was manipulated while having a view enabled different to "Raw", and this code was executed or updated, the "Raw"
view will show the formated code (if it is Ruby code).
- Highlighted: Clicking this button will format (Ruby code) and highlight the current code.
- Decoded: Clicking this button will show a view of the code if it is decoded. Code which can't be
decoded because it is decoded will be shown formatted and highlighted. This only works for Ruby Code.
- Encoded: Clicking this button will show a view of the current code when encoded. This only works
for Ruby code.
- Select all: Clicking this area selects all contents from the input field.
- Output field: This field shows the step-by-step execution of the entered code and the results
of the single steps. Also you can see error messages in this field. The output field only has a vertical
scrollbar, the contents will be wrapped.
Window > Preferences
You will reach the following window by choosing the menu entry "Window > Preferences"
- Entry and checkbox: This is the entry for the d/Code Sketchup Plugin. The checkbox is used
to enable/disable loading of the Plugin when Sketchup starts.
- Information: This field shows a short description ot the d/Code plugin.
- Version: Here you can see the current used d/Code version.
- Created by: This field shows the creator (author, programmer) of the plugin.
- Copyright: Some remarks on copyright.
Up | Down
Usage
First steps
- Start Sketchup.
- If you can't find the d/Code toolbar, check the following:
- Is the plugin installed as described?
- Is it active? Check this by choosing "Window > Preferences > Extensions"
and control, whether the checkbox on the left side of the d/Code entry is checked.
- Check the menu "View > Toolbars" for the d/Code entry is enabled.
- Click the button on the d/Code toolbar, the d/Code window will open.
- Now click on the "Load" button in the d/Code window and choose a file, mabe a Ruby or HTML file.
- Change the contents in the Input field.
- Click the "Update" button and watch what will happen in the d/Code window.
In case an error occurs
If an uncommon error occurs, you can send its error message to the publisher of this plugin, that
he can regist the and fix the error. Please describe the error as good as possible: Circumstances,
what have you done right before the error occured, how often the error occured, is it repeatable etc.
Up | Down
d/Code Help, Last Update: 31.01.2008
© 2008 Mario Pehle, error initus. All Rights reserved.