.Net API & RhinoCommon

Hi,

I’m new with Rhino. My goal is to write a .net program which load & parse (extract datas) a 3dm file.

1 - I don’t know if the API can do that

2 - I read some other posts and it seems that Rhino need to be installed & started before to use the API, is that true ?

3 - I installed the latest Rhino (8.23.25251.13001) and my visual studio .net8 project use the lastest nuget package RhinoCommon but the console app can’t load the library rhcommon_c.dll. I tried to copy some needed dll (listed by depencencies walker for RhinoCommon.dll) but nothing works.

Thansk for helping.

Here my short code

using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Rhino;
using Rhino.Geometry;
using Rhino.FileIO;
using Rhino.Runtime.InProcess;

namespace RhinoReader
{
internal class Program
{
static void Main(string args)
{
string filepath = @“D:\tmp\test.3dm”;

        var file3dm = File3dm.Read(filepath);

        foreach (var obj in file3dm.Objects)
        {
                
        }
        return;
    }
}

}

}

Hi @Alican,

A standalone application cannot use the version of RhinoCommon that is included with Rhino. In order to use the version of RhinoCommon that comes with Rhino, you must write a plug-in that runs in Rhino.

If you are writing a standalone application, then you should add the following NuGet package to your project.

– Dale

Hello @dale

Thank you for your answer, that’s clear ! Now it works fine with Rhino3dm package !