Grasshopper

algorithmic modeling for Rhino

Hello Everyone,

 

I am trying to test the Rhino SDK in Visual Studio but for some reason it cannot load the RhinoCommon.dll and rhinocommon_c.dll (copy local is set to "false"). If I drag and copy the console app into "Rhino\System\"  directory the program runs fine. I've searched for days regarding the loading of dll's but to no avail. Could it be that the Rhino dll's are protected in the program files directory? The code is very simple, please take a look.

 

using Rhino.Geometry;
using System;
using System.Collections.Generic;
using System.Text;

namespace Rhino
{
    class Program
    {
        static void Main(string[] args)
        {
            Point3d j = new Point3d(1, 1, 1);
            Point3d k = new Point3d(2, 2, 2);
            List<Point3d> list = new List<Point3d>();
            list.Add(j);
            list.Add(k);
            Console.WriteLine(new List<Point3d>{j,k});
            Point3d p = Point3d.Add(j, k);
            Console.WriteLine(Point3d.ArePointsCoplanar(list, 1.0));
            Console.Read();
        }
    }
}

 

 

 

Views: 1700

Replies to This Discussion

First off you only need to reference RhinoCommon.dll. rhinocommon_c.dll is an unmanaged dll that is used by RhinoCommon.dll to communicate with core Rhino.

The reason it's not working is because you're making a console app. This does not work. RhinoCommon.dll requires rhinocommon_c.dll and rhinocommon_c.dll requires Rhino.exe to be up and running. You can only make plug-ins using our SDK, not standalone programs.

--

David Rutten

david@mcneel.com

Tirol, Austria

I'm not referencing rhinocommon_c.dll only RhinoCommon.dll. 

I disagree the console app works inside the Rhino directory (Rhino.exe not running) but on my Debug directory it doesn't seem to load the external dll's. I'm trying to learn the Rhino API by testing simple operations and later incorporating them into the "Grasshopper C#" component (Visual Studio seems to be good IDE to code and debug). Do you have a special set-up inside Visual Studio when you debug Grasshopper?

-JP 

It is possible to use some functions from RhinoCommon.dll without Rhino.exe as it does have complete implementations for simple data-types such as points, vectors, lines, planes etc. But as soon as you start with curves, surfaces, breps or meshes you'll need Rhino.exe

I debug Grasshopper and all standard component libraries in the usual fashion. Visual Studio is set up to start Rhino.exe when debugging starts, and then I run the Grasshopper command and my breakpoints will be hit.

--

David Rutten

david@mcneel.com

Tirol, Austria

Thanks. I think Visual Studio is the problem. Honestly, I give up.

RSS

About

Translate

Search

Photos

  • Add Photos
  • View All

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service