Site Tools


Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
rhino:macroscriptsetup [2016/04/04]
sandy
rhino:macroscriptsetup [2016/04/04] (current)
sandy
Line 14: Line 14:
 There are two ways to approach associating the macro or script to your button or alias. ​ First and simplest is to just copy/paste the whole thing into the left or right button box (or in the alias box).  The advantage of the button method is that it is portable. That is, if you copy or export the button to another installation the macro goes with it.  Once the test is pasted in, click **OK** to exit the button editor, and you’re ready to go! There are two ways to approach associating the macro or script to your button or alias. ​ First and simplest is to just copy/paste the whole thing into the left or right button box (or in the alias box).  The advantage of the button method is that it is portable. That is, if you copy or export the button to another installation the macro goes with it.  Once the test is pasted in, click **OK** to exit the button editor, and you’re ready to go!
  
-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 located ​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.+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===== =====Linking to external scripts=====
-To set up an external scripts folder: ​ Find a logical place to create your folder. ​  This may be either in the Rhino/​system folder or some other common place. ​ Open the Options dialog, and navigate to the Files tab.  In the **file search paths** box, click the new button and then the little … button and browse to the location of the scripts folder. Then click **OK**. ​ Exit the options dialog. ​ Rhino will now go looking ​for scripts in this folder.+To set up an external scripts folder: ​ Find a logical place to create your folder. ​  This may be either in the Rhino/​system folder or some other common place. ​ Open the Options dialog, and navigate to the Files tab.  In the **file search paths** box, click the new button and then the little … button and browse to the location of the scripts folder. Then click **OK**. ​ Exit the options dialog. ​ Rhino will now look for scripts in this folder.
  
-To link your button or alias to an external script: ​ The syntax used will depend on the type of script. ​ If it is a simple text file with normal Rhino commands (like a long macro), you will need to use the command **ReadCommandFile** **//​Filename.txt//​** ​ Substitute the name of your text file for //​Filename.txt//​. ​ Paste that string into the left or right button box and you’re good to go.  To run a [[developer:​rhinoscript|RhinoScript]] .rvb file use the command **LoadScript** **//​Filename.rvb//​** instead. ​ That’s all you need to do.+To link your button or alias to an external script: ​ The syntax used will depend on the type of script. ​ If it is a simple text file with normal Rhino commands (like a long macro), you need to use the command **ReadCommandFile** **//​Filename.txt//​** ​ Substitute the name of your text file for //​Filename.txt//​. ​ Paste that string into the left or right button box and you’re good to go.  To run a [[developer:​rhinoscript|RhinoScript]] .rvb file use the command **LoadScript** **//​Filename.rvb//​** instead. ​ That’s all you need to do. 
 + 
 +\\
  
 ===Button editor showing pasted in macro and link to external script=== ===Button editor showing pasted in macro and link to external script===
rhino/macroscriptsetup.txt · Last modified: 2016/04/04 by sandy