This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
es:rhino:basicmacros [2023/10/27] noemi |
es:rhino:basicmacros [2026/05/18] (current) noemi [Herramientas necesarias] |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ======Creating Macros====== | + | ======Creación de macros====== |
| - | >A basic tutorial on creating | + | >Tutorial básico sobre cómo crear macros (scrips de comandos de Rhino) |
| - | You can create | + | Puede crear **macros** |
| - | There may be some confusion about the use of the term “scripting”. | + | Puede haber cierta confusión sobre el uso del término "scripting”. |
| - | //The two things are actually very different.// Writing functions in RhinoScript, | + | //En realidad, las dos cosas son muy diferentes.// Escribir funciones en RhinoScript, |
| - | I use the term “Macro” here exclusively to describe the putting together of strings of ordinary | + | Utilizaremos el término "Macro" aquí exclusivamente para describir la unión de cadenas de comandos de Rhino y sus opciones para crear una función automatizada. |
| - | =====The tools you need===== | + | =====Herramientas necesarias===== |
| - | * Your brain :-P | + | * Su cerebro |
| - | * The **Rhino | + | * El archivo |
| - | * The Rhino **MacroEditor**, a built-in interface for creating and testing your macros. | + | * El **EditorDeMacros** de Rhino, una interfaz integrada para crear y probar |
| - | * An understanding of how to add your macros | + | * Saber cómo añadir |
| - | =====You've already used a macro or two...===== | + | =====Ya ha utilizado una o dos macros...===== |
| - | First, if you are a user of Rhino, | + | En primer lugar, si es usuario de Rhino, |
| - | //(shown: | + | //(se muestra |
| {{: | {{: | ||
| - | It just calls the **ExtrudeCrv** command and sets it to make a closed solid. | + | Simplemente llama al comando |
| - | This is an example of the simplest kind of macro, | + | Este es un ejemplo del tipo más simple de macro, |
| - | In a sense, you’re doing the same thing as if you clicked or typed the options one at a time at the command line. | + | En cierto sentido, está haciendo lo mismo que si pulsara o tecleara las opciones de una en una en la línea de comandos. |
| - | This scripting of options for a single command can also be combined with data entry (i.e. coordinates or other numerical data). It is also possible to string together several commands in a row, for an automated sequence of events to manipulate or create objects. | + | Esta programación de opciones para un único comando también puede combinarse con la introducción de datos (es decir, coordenadas u otros datos numéricos). También es posible encadenar varios comandos seguidos, para una secuencia automatizada de eventos de manipulación o creación de objetos. |
| - | > **Note:** //Why the _Underscores? | + | > **Nota:** //¿Por qué el uso del guión bajo _? |
| - | ======Getting started====== | + | ======Para empezar====== |
| - | Say you have to place a series of 10x10x10 | + | Digamos que tiene que colocar una serie de cajas de 10x10x10 |
| - | You could use the standard Box (**Corner to Corner | + | Podría utilizar el comando estándar Caja (**Esquina a Esquina |
| - | Open the **MacroEditor** and type this in: | + | Abra el **EditorDeMacros** y escriba esto: |
| ! _Box _Center | ! _Box _Center | ||
| - | //(This is actually the macro under the Box, Center button if you check.)//\\ | + | //(Esto es la macro del comando Caja, botón Centro, si lo comprueba.)//\\ |
| - | All entries | + | Todas las entradas |
| - | Now, we need to specify the center point. | + | Ahora tenemos que indicar el punto central. |
| ! _Box _Center _Pause | ! _Box _Center _Pause | ||
| | | ||
| - | Once the data has been entered, you can specify the box size directly in the command. | + | Una vez introducidos los datos, puede especificar el tamaño de la caja directamente en el comando. |
| ! _Box _Center _Pause r5,5 | ! _Box _Center _Pause r5,5 | ||
| | | ||
| - | (Why the "r”? | + | (Por qué la "r"? |
| - | At this point you can put in the height, which in this case is relative to the original | + | En este punto puede introducir la altura, que en este caso es relativa al punto de inicio |
| ! _Box _Center _Pause r5,5 10 | ! _Box _Center _Pause r5,5 10 | ||
| | | ||
| - | Since there is no further input necessary nor options possible, the macro completes and our box is there. | + | Como no es necesaria ninguna otra entrada ni hay opciones posibles, la macro se completa y nuestra caja ya se ha creado. |
| ! _Box _Center _Pause r5,5 _Enter | ! _Box _Center _Pause r5,5 _Enter | ||
| - | Now that the macro is running, [[rhino: | + | Ahora que la macro se está ejecutando, [[rhino: |
| - | > //Note on the Pause command:// In earlier versions of Rhino, | + | > //Nota sobre el comando Pausa:// En versiones anteriores de Rhino, |
| - | For example the macro below | + | Por ejemplo, la siguiente |
| ! _Polyline _Pause _SelLast | ! _Polyline _Pause _SelLast | ||
| - | will work fine to make the polyline, but it will not be selected at the end. | + | funcionará bien para hacer la polilínea, pero no se seleccionará al final. |
| - | However, the following | + | Sin embargo, la siguiente |
| ! _Polyline _Multipause _SelLast | ! _Polyline _Multipause _SelLast | ||
| | | ||
| - | works including selecting the polyline at the end because the Multipause | + | funciona incluyendo la selección de la polilínea al final porque |
| - | =====OK, let’s get a bit more complicated…===== | + | =====Vamos a complicarnos un poco más…===== |
| - | Some commands invoke dialog boxes with many options. | + | Algunos comandos invocan cuadros de diálogo con muchas opciones. |
| - | =====Loft two open curves===== | + | =====Transición de dos curvas abiertas===== |
| - | Let’s say you would like to repetitively | + | Pongamos que quiere realizar repetidamente una **Transición** de dos curvas |
| < | < | ||
| Line 95: | Line 95: | ||
| </ | </ | ||
| - | Note that when you invoke the command, immediately a pause lets you pick your curves. | + | Tenga en cuenta que cuando ejecuta el comando, una pausa le permite elegir sus curvas inmediatamente. |
| - | =====Modifying it to use with closed curves===== | + | =====Modificación usar con curvas cerradas===== |
| - | Now, try it with two closed curves. | + | Ahora, inténtelo con dos curvas cerradas. |
| - | Adding a pause in the right place lets you check and adjust the seam on screen: | + | Añadir una pausa en el lugar adecuado permite comprobar y ajustar la costura en pantalla: |
| < | < | ||
| Line 113: | Line 113: | ||
| </ | </ | ||
| - | Adding an Enter instead of the Pause tells Rhino you don’t care. Just leave the seam the way it is by default. | + | Añadir un Intro en lugar de la Pausa indica a Rhino que no le importa. Deja la costura como está de manera predeterminada. |
| < | < | ||
| Line 125: | Line 125: | ||
| </ | </ | ||
| - | Or, you can specify another Loft seam option by stepping down into the seam sub-option level: | + | También puede especificar otra opción de costura de la Transición bajando al nivel de subopción de costura: |
| < | < | ||
| Line 138: | Line 138: | ||
| </ | </ | ||
| - | (The Enter after Natural | + | (El Enter después de Natural |
| - | //Unfortunately, the same macro will not work correctly for both open and closed curves because of the extra seam option required. | + | //Desafortunadamente, la misma macro no funcionará bien para curvas abiertas y para curvas cerradas debido a la opción |
| - | ======Using macros | + | ======Uso de macros |
| - | Macros can also be used to set various GUI and Document Properties options automatically without having to go wading into the Options dialog. | + | Las macros también pueden utilizarse para establecer automáticamente varias opciones de la interfaz de usuario y de las propiedades del documento sin tener que entrar en el cuadro de diálogo Opciones. |
| < | < | ||
| Line 159: | Line 159: | ||
| </ | </ | ||
| - | Why are there two Enters at the end? | + | ¿Por qué hay dos Enter al final? |
| - | You went down two levels in -_DocumentProperties, | + | Se bajaron dos niveles en -_DocumentProperties, |
| - | The following is from Jeff LaSor, | + | Lo siguiente es de Jeff LaSor, |
| - | To script Crosshairs | + | Para activar o desactivar el cursor en cruz, ponga lo siguiente en un botón: |
| < | < | ||
| -_Options _Appearance _Visibility | -_Options _Appearance _Visibility | ||
| _Crosshairs _Enter _Enter _Enter | _Crosshairs _Enter _Enter _Enter | ||
| </ | </ | ||
| - | Notice the reference to each individual | + | Fíjese en la referencia a cada nombre de opción de comando |
| - | **EnterEnd** | + | **EnterEnd** |
| < | < | ||
| Line 178: | Line 178: | ||
| </ | </ | ||
| - | Or, if you just use an exclamation point **!** at the end (which in a script | + | O, si usa un signo de exclamación |
| - | The script | + | El script |
| - | Always ON version: | + | Versión activar siempre: |
| < | < | ||
| -_Options _Appearance _Visibility | -_Options _Appearance _Visibility | ||
| _Crosshairs=_Show ! | _Crosshairs=_Show ! | ||
| </ | </ | ||
| - | Always OFF version: | + | Versión desactivar siempre: |
| < | < | ||
| -_Options _Appearance _Visibility | -_Options _Appearance _Visibility | ||
| _Crosshairs=_Hide ! | _Crosshairs=_Hide ! | ||
| </ | </ | ||
| - | Note the use of the **!** here. Also, note you can assign directly the values options can take on to that option using the ' | + | Fíjese en el uso del **!** aquí. Además, tenga en cuenta que puede asignar directamente los valores que pueden tener las opciones en esa opción utilizando el operador |
| - | (Thanks, Jeff) | + | (Gracias, Jeff) |
| - | ======Other useful macro writing tools and commands====== | + | ======Otras herramientas y comandos útiles para crear macros====== |
| - | There are some handy tricks for doing more complex | + | Hay algunos trucos útiles para crear macros |
| < | < | ||
| - | Select | + | Seleccionar |
| - | SelLast | + | SelÚltimo |
| - | SelPrev | + | SelAnterior |
| - | SelNone | + | SelNinguno |
| - | SetObjectName | + | DefinirNombreDeObjeto |
| - | SetGroupName | + | DefinirNombreDeGrupo |
| - | SelGroup | + | SelGrupo |
| - | SelName | + | SelNombre |
| - | Group | + | Agrupar |
| - | Ungroup | + | Desagrupar |
| </ | </ | ||
| - | To set a single object name (this in itself is a macro!): | + | Para definir un único nombre de objeto |
| < | < | ||
| _Properties _Pause _Object _Name | _Properties _Pause _Object _Name | ||
| - | [put your object name here] _Enter _Enter | + | [ponga aquí el nombre del ] _Enter _Enter |
| </ | </ | ||
| - | To cancel a single object name (without deleting the object) | + | Para cancelar el nombre de un objeto |
| < | < | ||
| _Properties _Pause _Object _Name | _Properties _Pause _Object _Name | ||
| - | “ “ _Enter _Enter (quote space quote for the name) | + | “ “ _Enter _Enter (espacio entre las comillas para el nombre) |
| </ | </ | ||
| - | =====Examples using the above tools===== | + | =====Ejemplos en los que se utilizan las herramientas mencionadas===== |
| - | Look at the following | + | Mire la siguiente |
| < | < | ||
| Line 236: | Line 236: | ||
| _Delete _Setredrawon | _Delete _Setredrawon | ||
| </ | </ | ||
| - | It creates an offset bounding box around an object. The offset is input by the user. | + | Crea un cuadro delimitador desfasado alrededor de un objeto. El usuario introduce el desfase. |
| - | **//As a final example,//** the following | + | **//Como ejemplo |
| - | Note the use of a named group and various selection commands. | + | Fíjese en el uso de un grupo con nombre y varios comandos de selección. |
| < | < | ||
| Line 254: | Line 254: | ||
| </ | </ | ||
| - | //last edited: 28.08.19/ | + | //última edición: 28.08.19/ |
| - | + | ||
| - | **Please feel free to add to or edit this tutorial!** | + | |
| - | This is a work in progress... | + | |
| + | **Puede añadir información o editar este tutorial** | ||
| + | Se trata de una versión en progreso... | ||