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
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
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
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
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
""" | |
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
[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
public static PlugIn CreatePlugIn(Type pluginType, bool printDebugMessages) | |
{ | |
if (null == pluginType || !typeof(PlugIn).IsAssignableFrom(pluginType)) | |
return null; | |
InitializeRhinoCommon(); | |
// If we turn on debug messages, we always get debug output | |
if (printDebugMessages) | |
SendDebugToCommandLine = true; |
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
struct SubDVertex | |
{ | |
SubD m_parent; | |
IntPtr m_ptr_vertex; // ON_SubDVertex* vertex | |
uint m_parent_sn; | |
ComponentIndex m_component_index; | |
internal SubDVertex(SubD subd, IntPtr ptr_vertex, ComponentIndex ci, Point3d location) | |
{ | |
m_parent = subd; |
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 | |
import Rhino | |
def ModifyInstancePiece(): | |
rs.UnselectAllObjects() | |
go = Rhino.Input.Custom.GetObject() | |
go.SubObjectSelect = True | |
go.Get() | |
if go.CommandResult() != Rhino.Commands.Result.Success: | |
return |