This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[CommandStyle(Style.Hidden)] | |
public class TestOpenGlCallCommand : Command | |
{ | |
public override string EnglishName { get { return "TestGlCall"; } } | |
protected override Result RunCommand(RhinoDoc doc, RunMode mode) | |
{ | |
m_conduit.Enabled = !m_conduit.Enabled; | |
doc.Views.Redraw(); | |
return Result.Success; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Post-Build script for RhinoCommon plug-in projects. | |
Make sure this file is in the same directory as your plug-in | |
project. In Xamarin Studio under project properties, add the following | |
to Custom Commands->After Build | |
python monobuild.py ${TargetFile} | |
Also make sure to set your project's build output to build to the MacPlugIns | |
directory | |
ex. | |
/Users/steve/Library/Application Support/McNeel/Rhinoceros/MacPlugIns/HelloMonoPlugIn |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using Eto.Forms; | |
using Eto.Drawing; | |
using Eto; | |
using System.Collections.Generic; | |
namespace EtoRhinoTests | |
{ | |
public class EtoRhinoCommand : Rhino.Commands.Command | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ghpythonlib.components as ghcomp | |
import ghpythonlib.parallel | |
#custom function that is executed by parallel.run | |
def slice_at_angle(args): | |
brep, plane = args #unpack input | |
result = ghcomp.BrepXPlane(brep, plane) | |
if result: return result.curves | |
if parallel: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import rhinoscriptsyntax as rs | |
rs.UnselectAllObjects() | |
rs.Command('-AttachGHSData General Title "My Scripted Vessel" Enter') | |
id = rs.AddSphere((0,0,0), 30) | |
rs.SelectObject(id) | |
rs.Command('-AttachGHSData HullItems Add BySurface SelId ' + str(id) + 'Enter') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using Rhino; | |
using Rhino.Commands; | |
using Rhino.Geometry; | |
namespace examples_cs | |
{ | |
[System.Runtime.InteropServices.Guid("476cc15c-8979-4325-8819-298024efbb56")] | |
public class CustomMeshCommand : Command | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
Rhino.Runtime.PythonScript m_py_script; | |
Rhino.Runtime.PythonCompiledCode m_compiled_script; | |
protected override Rhino.Commands.Result RunCommand(RhinoDoc doc, Rhino.Commands.RunMode mode) | |
{ | |
// create an instance of a python script processor | |
if (m_py_script == null) | |
m_py_script = Rhino.Runtime.PythonScript.Create(); | |
if (m_py_script == null) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Sample script that accesses the shapeways API | |
http://www.shapeways.com/api | |
""" | |
import wsdlprovider | |
wsdl_url = "http://api.shapeways.com/v1/wsdl.php" | |
username = "username" | |
password = "password" | |
application_id = "rhinotest" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import System.Threading.Tasks as tasks | |
import Rhino | |
import rhinoscriptsyntax as rs | |
import time, math | |
import scriptcontext | |
def radial_contour(brep, parallel, slice_count=360): | |
"""Generate series of curve slices through a brep by rotating a plane | |
multiple times and intersecting that plane with the brep. This function |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Use Google translate web service""" | |
import rhinoscriptsyntax as rs | |
import json, urllib | |
import scriptcontext | |
# Api key that I (Steve Baer) got from Google | |
# http://code.google.com/apis/console-help/#UsingKeys | |
# You might want to generate your own key, but I don't care | |
# if you continue to use this one. | |
KEY = "AIzaSyAZGoS-GjZGaSHZMZdoczfdUtWTjm_D-p4" |