====== Scripts, Workspace, and Macros====== Created by G.C. Webster (Guilherme Cozer Webster) for Rhino. > **Info:** //Olá. Welcome to my humble wiki page. I'm not a VB Expert, but I do my best. If you'd like to report a bug (or maybe a spelling / grammar mistake), send a suggestion or just contact me, feel free to send an [[gcwebster36@gmail.com|e-mail.]]// ===== VB.NET ===== This [[http://wiki.mcneel.com/_media/legacy/en/gcwebster-rhinoscripts.zip|.zip file]] (last revision: **03/Feb/06**) contains all the scripts described below, saved in **.rvb** format. It is simpler than uploading every single script... These .rvb files are ready to be copied and pasted to a button. Take a look at the [[developer:macroscriptsetup|MacroScriptSetup]] tutorial page to know what I'm talking about. **AbsTol** - Quickly change the absolute tolerance of a document. **AnglePivot** - Runs the Angle command with a pivot point. **AnnotateCrvLengths** **AnnotateCrvRadius** **BothColors** - Quickly changes both wireframe and render/material colors of any objects. **ClearAllMeshes** - Runs the ClearAllMeshes command with a secure confirmation box. **ClearUndo** - Runs the ClearUndo command with a secure confirmation box. **ClosedPlanarCrvIndAreaCentroids** - Creates individual area centroids for each closed planar curve selected. **CopyToPt** - Copies several objects to selected points at the same time. (Original idea by [[people:davidrutten|Gelfling aka David Rutten]]) **CSec2** - Automatically creates open curves from the intersection between given cross-section and profile curves. **DigDisconnect** - Runs the DigDisconnect command with a secure confirmation box. **EncloseCrvs** - Encloses open planar curves inside a closed planar curve boundary. **ExtendCrvs** - One of the most useful scripts I've ever written: extend several curves at the same time. **IndAreaCentroids** - Creates individual area centroids for each srf or polysrf selected. **IndBoundingBoxes** - Creates individual bounding boxes for each object selected. **IndProjBB** - Creates projected to Cplane bounding boxes for each object selected. **InvBottom** - Sets an Invert Bottom view in any Rhino document. **InvTop** - Sets an Invert Top view in any Rhino document. **InvDel** - Simply inverts selection and deletes remaining objects with a secure confirmation box. **OffsetCrvs** - Offsets more than one curve at the same time, including a BothSides option. **OriBB** - Creates an oriented Bounding Box accordingly to a 3pt Cplane. (Thanks for the help, Pascal!) **Orient2pt_pivot** - The orient command with a pivot point (same first point on both reference and target). **ProjBB** - Also extremely useful: creates a Projected To Cplane Bounding Box. **QuadMirror** - Mirror an object twice, first horizontally and then vertically, using the origin, resulting in four equal objects. (Hmmm...is this clear enough?) **RenderColor** - Quickly changes the render/material color of objects. **ResetBothColors** - Re-assigns both wireframe and render/material color of objects as By Layer. **ResetColor** - Re-assigns the wireframe color of objects as By Layer. **ResetRenderColor** - Re-assigns render/material color of objects as By Layer. **SelCrvInPlane** - Selects only the planar curves in a model that coincides with the active CPlane. **SelPlanar** **SelPlanarPolysrf** **SelPlanarSrf** **ShowE** - All objects of the model on the screen - basically unlocks and shows everything. **Txt2Crv** - Transforms text objects in curves. **UndoViewChangeInAllViewports** **WireColor** - Quickly changes the wireframe color of objects. ===== Workspace===== [[http://wiki.mcneel.com/_media/legacy/en/gcwebsterRH3_SR4.zip|Here]] it's possible to download my personal workspace file, with custom buttons and organization. It contains the macros below, all scripts above and other useful codes from some VB masters such as [[http://www.avgauge.com|Dan Bayn]] and [[http://www.rayflectar-graphics.com/Rhino/RhinoScripts-Gallery.htm|Thomas Anagnostou.]] ===== Macros===== [[rhino:basicmacros|Macros]] are usually quite easy and simple. Here are some of mine: **New file using template** - Just replace YOURTEMPLATE with the real name of the template wanted. **_New YOURTEMPLATE** **SelColor+Hide & SelColor+InvHide** **_SelColor** _pause _Hide **_SelColor** _pause _Invert _Hide **Set the Default layer on** - You obviously must have a layer named default. **-_OneLayerOn Default** **Open the Units Tab in Document Properties page** '_NoEcho '//DocumentPropertiesPage //Units **Set the Gradient View ON in all viewports & Set the Gradient View OFF in all viewports** **_NoEcho** -GradientView View Enter **_NoEcho** -GradientView View State Enter **Show Wireframes on render & Don't show wireframes on render** - It works only with TreeFrog as the current renderer . **_NoEcho** -_DocumentProperties _TreeFrog _Wireframe=yes //Enter //Enter _SetRedrawOn _Echo **_NoEcho** -_DocumentProperties _TreeFrog _Wireframe=no //Enter //Enter _SetRedrawOn _Echo **Blend curve: tangent - position continuity** - Creates a blend curve using G1 and G0 continuities in the first and last input, respectively. You can use this macro as a model to create other continuity combinations. **_Blend** continuity=tangency _pause continuity=position **Line: Perpendicular from Curve, Both Sides from First Point** **Line Perpendicular** _BothSides _pause _FromFirstPoint **Mark Both Curve Start and End** **_NoEcho** _CrvStart _CrvEnd ---- Saudações, G.C. Webster (Guilherme C. Webster) RS - Brasil **[[gcwebster36@gmail.com|Contact]]**