This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | Last revision Both sides next revision | ||
rhino:macroscriptsetup [2016/04/04] |
rhino:macroscriptsetup [2020/08/14] 127.0.0.1 external edit |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ======How to Set Up and Run Macros and Scripts in Rhino ====== | ||
+ | |||
+ | \\ | ||
+ | |||
+ | =====Creating a button or alias for your macro or script===== | ||
+ | The simplest way to save and run your macro is from a toolbar button or alias. | ||
+ | |||
+ | =====Use the macro editor to work out new macros===== | ||
+ | The MacroEditor command opens a text editing window in which you can type macros and try them without the need to edit a button every time. The run button on the lower edge of the editor runs the macro, of if there is selected text, it runs the selected text. When it all runs to your satisfaction, | ||
+ | |||
+ | {{: | ||
+ | |||
+ | =====Paste your macro or script into the button or alias===== | ||
+ | There are two ways to approach associating the macro or script to your button or alias. | ||
+ | |||
+ | The paste-in-button (or alias) method is fine for macros of Rhino commands and shorter, smaller scripts, but it gets a bit unwieldy to edit if there is a great deal of text. For larger scripts, some people like to place them externally in a folder with a link so that Rhino can find them. Both toolbar buttons and aliases can link to external scripts. One advantage of this system is that all scripts are in one spot so you can easily find and update them. The problem is that if you copy your button or workspace for use somewhere else, you have to remember to bring the scripts with it. | ||
+ | |||
+ | =====Linking to external scripts===== | ||
+ | To set up an external scripts folder: | ||
+ | |||
+ | To link your button or alias to an external script: | ||
+ | |||
+ | \\ | ||
+ | |||
+ | ===Button editor showing pasted in macro and link to external script=== | ||
+ | {{: | ||
+ | |||
+ | You can also paste an entire [[developer: | ||
+ | |||
+ | < | ||
+ | ! -_Runscript ( | ||
+ | <Paste in | ||
+ | your entire | ||
+ | script here> | ||
+ | ) | ||
+ | </ | ||
+ | |||
+ | ===Button editor showing pasted in complete RhinoScript=== | ||
+ | {{: | ||
+ | |||
+ | |||