签到天数: 3096 天 连续签到: 1 天 [LV.Master]开坛元老
|
What is Monkey?
Monkey is a new script editor in Rhino4 which can be used to edit, run, debug and compile scripts. It contains all the standard programmer editor features such as Find/Replace (with regular expressions), multi-document interface, code trees and integrated helpfiles. Monkey also comes with a separate application called the Monkey Script Compiler. This is a standalone exe which turns .rvb scripts into .rhp plugins. More information on the script compiler can be found here .
This Wiki page focuses on the features of the Monkey plugin. Monkey is a DotNET plugin meaning you need the Microsoft DotNET Framework 2.0 installed on your machine. Note that many computers already are DotNET compliant, so you only need to download and install this if Monkey doesn't run (you'll get an error message telling you when this happens).
If you are a plug-in developer and have extended RhinoScript to use your plug-in methods, then you can access your methods from Monkey. Click here for details.
[url=]The Code Editor[/url]
The most important item on the Monkey Editor is the Code Editor. It is here that you make your scripts. As you can see, the editor is much more than a simple text editor (a la notepad). It performs automatic syntax parsing meaning you get properly coloured keywords, collapsable code groups which encapsulate Sub() and Function() blocks, automatic indenting, autocompletion and error highlighting. These are features that we have come to expect from any developer tool nowadays, and Monkey brings them to Rhino for the first time.
Autocompletion and parameter tips are generally grouped under the catch-phrase Intellisense . Since RhinoScript is not a strongly typed language, it is very difficult to provide a fully functional intellisense system, which is why intellisense in Monkey is limited to ”RhinoScript methods and Script Scope procedures. We may expand this functionality later on to include vbScript specific procedures and classes as well. An example of Intellisense in action can be seen below:
Note that the autocompletion list pops up as soon as “Rhino.” is typed anywhere. The list updates when you keep typing to reflect the best possible match with your current text. In this case, we want to use the Rhino.GetObject() method but we have to type at least “geto” in order to get it (Rhino.GetAngle() comes earlier in the alphabet and is the initial provided solution). Once the Rhino.GetObject() method is highlighted in the pop up list, we can simply press [Enter] and the complete method name will be inserted into the script. Once the method name is in place, we have to supply the arguments. Intellisense displays a tooltip showing us the required arguments and which one we are currently setting.
Above the code editor you will find the document tab. Monkey is multi-document capable and you can switch between documents by clicking on the appropriate tab. You can also add existing files quickly by dragging them onto the file tab. If there are too many files in the tab to be shown on a single screen, you can scroll the bar left and right by click+dragging the ◄ ► icon. Also, if you press the right mouse button on the tab, you'll get a menu with all loaded files so you can quickly locate the correct one.
该贴已经同步到 modern的微博 |
|