This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
|
es:rhino:basicmacros [2020/08/14] 127.0.0.1 external edit |
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** en Rhino para automatizar muchas tareas, personalizar los comandos y mejorar su flujo de trabajo. |
| - | 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, Python u otros lenguajes de programación es mucho más complejo que crear macros, |
| - | 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. | + | * Su cerebro :-P |
| + | * El archivo **Ayuda de Rhino**: lista todos los comandos de Rhino y sus subopciones. Esta es la referencia más importante. | ||
| + | * El **EditorDeMacros** de Rhino, una interfaz integrada para crear y probar macros. | ||
| + | * Saber cómo añadir macros a su flujo de trabajo en forma de alias o botones de la barra de herramientas (se explica [[https:// | ||
| + | =====Ya ha utilizado una o dos macros...===== | ||
| + | En primer lugar, si es usuario de Rhino, ya es usuario de macros aunque no lo sepa. Muchos de los comandos de Rhino ya están " | ||
| + | //(se muestra V6 para Windows)// | ||
| - | The Rhino Help file - lists all Rhino commands and their sub-options. This is your most important reference. | + | {{: |
| - | The Rhino **MacroEditor**, to easily run and debug your macros. | + | Simplemente llama al comando |
| - | =====You' | + | Este es un ejemplo del tipo más simple de macro, que establece una serie de opciones dentro de un único comando para que no tenga que especificarlas cada vez que lo utilice. **ExtruirCrv** tiene varios botones con opciones preestablecidas, |
| - | First, if you are a user of Rhino, you are already a macro user even though you may not know it. | + | |
| - | {{:legacy:en:ExtrudeCrvButtonEditor.gif}} | + | 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 is an example of the simplest macro, which sets a series of options within a single command so that you don’t have to specify each one every time you use it. | + | 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. |
| - | 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. | + | > **Nota:** //¿Por qué el uso del guión bajo _? El guión bajo Indica |
| - | 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. | + | ======Para empezar====== |
| - | > **Note:** //Why the _Underscores? | + | Digamos que tiene que colocar una serie de cajas de 10x10x10 con el centro de la cara inferior sobre un punto deseado, y con ese punto que tiene que especificarse ya sea mediante un clic del ratón en la ubicación deseada o introduciendo las coordenadas con el teclado. |
| - | ======Getting started====== | + | Podría utilizar el comando estándar Caja (**Esquina a Esquina + Altura**), pero por defecto se colocará el punto de inserción en la primera esquina de la caja. Para tener el punto de inserción donde queremos, es más fácil utilizar el comando Caja, Centro. |
| - | Say you have to place a series of 10x10x10 boxes with the center of the bottom face landing at the desired point, with that point to be specified by either by a mouse click at the desired location or by entering the coordinates by the keyboard. | + | Abra el **EditorDeMacros** y escriba esto: |
| - | + | ||
| - | You could use the standard Box (**Corner to Corner + Height**) command, but by default this will place the insertion point at the first corner of the box. To have the insertion point where we want, it is easier to use the Box, Center command. | + | |
| - | + | ||
| - | Open the **MacroEditor** and type this in: | + | |
| ! _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: |
| - | =====OK, let’s get a bit more complicated…===== | + | > //Nota sobre el comando Pausa:// En versiones anteriores de Rhino, para algunas macros de comandos era necesario utilizar una Pausa por cada selección en pantalla que se necesitaba. |
| - | Some commands invoke dialog boxes with many options. | + | Por ejemplo, la siguiente |
| - | =====Loft two open curves===== | + | ! _Polyline _Pause _SelLast |
| - | Let’s say you would like to repetitively | + | funcionará bien para hacer la polilínea, pero no se seleccionará al final. |
| + | |||
| + | Sin embargo, la siguiente macro | ||
| + | |||
| + | ! _Polyline _Multipause _SelLast | ||
| + | |||
| + | funciona incluyendo la selección de la polilínea al final porque Multipause incluye //todas// las selecciones de la polilínea, permitiendo que SelLast se ejecute y funcione al final. | ||
| + | |||
| + | =====Vamos a complicarnos un poco más…===== | ||
| + | |||
| + | Algunos comandos invocan cuadros de diálogo con muchas opciones. | ||
| + | |||
| + | =====Transición de dos curvas abiertas===== | ||
| + | |||
| + | Pongamos que quiere realizar repetidamente una **Transición** de dos curvas | ||
| < | < | ||
| Line 80: | 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 98: | 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 110: | 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 123: | 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 144: | 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** es una buena manera de " | ||
| + | |||
| + | < | ||
| + | -_Options _Appearance _Visibility _Crosshairs _EnterEnd | ||
| + | </ | ||
| - | 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 215: | 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 233: | Line 254: | ||
| </ | </ | ||
| - | **Please feel free to add to or edit this tutorial!** | + | //última edición: 28.08.19/msh// |
| - | This is a work in progress... | + | |
| + | **Puede añadir información o editar este tutorial** | ||
| + | Se trata de una versión en progreso... | ||