Quantcast
Channel: Rhino Developer - McNeel Forum
Viewing all 8676 articles
Browse latest View live

Class for injecting control directly into viewport?

$
0
0

@ChristopherBotha wrote:

Is there an exposed class for adding buttons, sliders etc directly into a viewport?

I can do it externally with a win32control wrapper, but transferring info is messy and exiting is messy as well.

Posts: 3

Participants: 2

Read full topic


Registering plugin problem

$
0
0

@andrew3 wrote:

I am registering our net.commons plugin programmatically, by making the usual registry entries at:

HKEY_LOCAL_MACHINE\Software\McNeel\Rhinoceros\6.0\Plug-ins<your_plugin_guid>`

This works OK, except that the plugin isn’t enabled… this means that on every Rhino 6 start the user is asked if they want to load this plugin.

Is there a setting that I can add to avoid this?

Posts: 1

Participants: 1

Read full topic

BeforeTransformObjects: the argument e.Objects is always null

Adding options for my plugin in option panel

$
0
0

@Matthieu_from_NAVINN wrote:

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

Best regards

Posts: 1

Participants: 1

Read full topic

Visualize stripe plot and gradient

$
0
0

@rene_hiemstra wrote:

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?

Posts: 3

Participants: 2

Read full topic

Select group in python

$
0
0

@onrender wrote:

Hi,

I am looking for a solution to select initially grouped objects in python. Is there any way to select group at once?

Thanks,
Andras

Posts: 2

Participants: 1

Read full topic

Remove bit of line between split objects

Embed Python in C# plug-in

$
0
0

@onrender wrote:

Hi,

I could not find the video about how to embed python script into C# plugin. I can remember it was on vimeo.

R
Andras

Posts: 2

Participants: 2

Read full topic


Not Movable but Not Locked Objects

$
0
0

@Filip wrote:

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

Posts: 2

Participants: 2

Read full topic

GUID of Rhino Command (same or different for Rhino 5 and Rhino 6 plugins)

Where are all the sample program codes?

$
0
0

@donl517 wrote:

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.

Thanks,
Don

Posts: 7

Participants: 4

Read full topic

DrawSprite WorldLocation

$
0
0

@henrydm wrote:

Hello,

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);
    }
}

Here a video of the behavior:

Best Regards
Enric

Posts: 1

Participants: 1

Read full topic

Rhino videos > C# tutorial (please mcneel!)

$
0
0

@Asaf_Yaacobi wrote:

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

Posts: 2

Participants: 2

Read full topic

How to make a DLL with Visual Studio and using it in Grasshopper C# script

$
0
0

@laurent_delrieu wrote:

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


.NetCore (1.0 1.1 2.0)
. NetStandard (which one 1.0 1.1 … 2.0)
I found and I used template for Rhino and Grasshopper. Is there an example for a DLL ?

I tried .NetStandard/.NetCore with no compilation error and I get an error message in Grasshopper. What I miss ?

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);
        }
    }
}

Posts: 1

Participants: 1

Read full topic

Python - watch cursor and place object

$
0
0

@onrender wrote:

Hi,

I have a question for the following procedure. I am also not sure if it is possible in python.

  1. Watch position of cursor,
  2. Watch angle of the line that the cursor covers,
  3. Move object to cursor (how the cursor moves around the object can follow the cursor) (Dynamic draw?)
  4. Align object to line (and Dynamic draw?)
  5. Place object by a click.

I know that Event watcher exists for C# but all together is even more foggy.

Posts: 2

Participants: 2

Read full topic


C# vs Python

$
0
0

@onrender wrote:

Hi,

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.

Posts: 2

Participants: 2

Read full topic

RhinoCommon.dll path error

OpenNURBS member function declared with 'override' does not override a base class member

$
0
0

@gm_user wrote:

Almost seems working properly but, when building the final solution I do receive several errors of the following type:

E1455 member function declared with ‘override’ does not override a base class member c:\Program Files\Rhino 6 SDK\openNURBS\opennurbs_curveproxy.h 216

Suppose something trivial is compromising the final result. Any hint will be greatly appreciated.

Posts: 1

Participants: 1

Read full topic

Split Mesh or Brep using RhinoCommon

Missing PDB files for debugging in VS2010

$
0
0

@Guillaume wrote:

I am developing a 64 bits plugin for Rhino 5 with VS 2010 and the C++ SDK. I followed the instructions given on the following page:

But when I press the “Start Debugging” button, then I get the following error messages:

“Debugging information for ‘Rhino5x64_d.exe’ cannot be found or does not match. Cannot find or open the PDB file”

“‘Rhino5x64_d.exe’: Loaded ‘C:\Program Files (x86)\Rhino 5.0 x64 SDK\Bin\x64\Rhino5x64_d.exe’, Cannot find or open the PDB file”

“‘Rhino5x64_d.exe’: Loaded ‘C:\Windows\System32\ntdll.dll’, Cannot find or open the PDB file”

… and many others

It seems that PDB files are missing in my Rhino installation. Has anyone had this problem before?

Thanks

Posts: 4

Participants: 2

Read full topic

Viewing all 8676 articles
Browse latest View live