I have been using the event BeforeTransformObjects, and tried to retrieve the objects from it within the function below.
I noticed that e.ObjectCount returns the right amount of objects that have been moved, however, e.Objects is always null. Am I doing something wrong? Seems like a bug to me.
Hi,
I’m trying to add options for my plugin in Rhino option panel. I believe I must create a class inheriting OptionsDialogPage, but I get an error message concerning the constructor, and I can’t figure out how to do this. Any Idea?
Public Class MSWOptionPanel
Inherits Rhino.UI.OptionsDialogPage
Public Overrides ReadOnly Property PageControl As System.Windows.Forms.Control
Get
Return New MSW_OptionControl
End Get
End Property
End Class
I am implementing a method that computes geodesic distances (from a source point or curve) on a brep using a background mesh. How can I visualize a combination of a gradient and a set of contours? Can I combine a gradient and a stripe map?
Does anyone have an example of either one or both combined?
Hi All
Is it possible to create (display) Rhino objects (lets say curves) which are not movable and they are not locked, so I can select them (but not move or other transformation) and delete them. Is it possible with C++?
Regards
Filip
I’ve been digging around on the Rhino site and I can’t find a link that takes me to the developer page, hence I can’t find the samples McNeel has provided.
The method DisplayPipeline.DrawSprite(DisplayBitmap bitnap, Point3d worldLocation, float size, bool sizeInWorldSpace) is not using the Point3d in world coords, it seems to be using th x,y screen coordinates.
Here the code:
public class DrawSpriteCommand : Command
{
private readonly DisplayBitmap _bm;
private bool _enabled;
public DrawSpriteCommand()
{
Instance = this;
_bm = new DisplayBitmap(new System.Drawing.Bitmap(@"C:\Users\MyUser\Desktop\image.jpg"));
}
public static DrawSpriteCommand Instance { get; private set; }
public override string EnglishName => "DrawSpriteCommand";
protected override Result RunCommand(RhinoDoc doc, RunMode mode)
{
_enabled = !_enabled;
if (_enabled) DisplayPipeline.DrawOverlay += DisplayPipeline_DrawOverlay;
else DisplayPipeline.DrawOverlay -= DisplayPipeline_DrawOverlay;
doc.Views.Redraw();
return Result.Success;
}
private void DisplayPipeline_DrawOverlay(object sender, DrawEventArgs e)
{
e.Display.DrawSprite(_bm, Point3d.Origin, 15f,false);
}
}
hi guys at mcneel and in grasshopper
could be amazing if you guys help us (gh users) whom are trying to get into the code writing and to use all the hard work you have done getting all the C# and VB accessible
could you guys make 5 minute tuts for beginners to learn how to use those web pages and integrate it ?
thnx a lot
and for all the hard work you guys have been doing . rhino6 rocks
Hello,
Most of the time I use C# components of my own, but I want now to insert lot of function inside a single C# instead of copying the codes each time I want to make a DLL that will contains all my classes, static function … Does I have to use
An example I used (Thanks for the new function in RhinoCommon)
using Rhino.Geometry;
namespace TestClassLibrary1
{
public static class Class1
{
public static Mesh Catmull(Mesh mesh, int level, int creasedEdge)
{
Rhino.Geometry.MeshRefinements.RefinementSettings rr = new Rhino.Geometry.MeshRefinements.RefinementSettings();
rr.Level = level;
Rhino.PrivateMeshCommands.MeshTypes.CreaseEdges ce = Rhino.PrivateMeshCommands.MeshTypes.CreaseEdges.Auto;
switch (creasedEdge)
{
case 0:
ce = Rhino.PrivateMeshCommands.MeshTypes.CreaseEdges.NakedFixed; break;
case 1:
ce = Rhino.PrivateMeshCommands.MeshTypes.CreaseEdges.NakedSmooth; break;
case 2:
ce = Rhino.PrivateMeshCommands.MeshTypes.CreaseEdges.CornerFixedOtherCreased; break;
case 3:
ce = Rhino.PrivateMeshCommands.MeshTypes.CreaseEdges.Auto; break;
}
rr.NakedEdgeMode = ce;
return Mesh.CreateRefinedCatmullClarkMesh(mesh, rr);
}
}
}
I have found a video online https://vimeo.com/247048808 and they are talking about the calculation time of each language (C#, VB, Python). Python seems very slow. I believed, the calculation time between C# and Python is negligible. The test shows the difference.
However in terms of development, Python is still more comfortable and no need to be compiled. It works like a real time script. I think the best way for script creation is IronPython because when calculation time become crucial it is easier to turn IronPython into C# code.