I want to write a program to convert .3dm to .stl extensions in Visual Studio Form Application. I am having trouble using Rhino packages as a source. Do you have a source suggestion for this? Or a program that I can take as an example?
What kind of trouble do you have, with which packages? Can you share some code, error messages to help pinpoint the problem?
I’m assuming you want to do something like:
- Open 3dm file
- Read one or more mesh objects
- Write mesh(es) to STL format
If you only want to use the package to read the 3dm, you’ll have to write the STL yourself, the STL writer is only part of Rhino for which you need a license. Fortunately, the STL format is not very complicated.
Actually I can’t install rhinocommon API as a package in visual studio. If you know a trouble-free installation method, can you share it? Actually, what I want to do is convert .3dm files to .stl, I’m looking for an API that I can add to visual studio and a method on how to add it.
If you’re creating a standalone application and you want to read/write 3dm files, use the rhino3dm package from Nuget.
Veyis,
I would start by following these instructions to setup Visual Studio to work with Rhino’s Templates for projects.
Then you will be able to create a new project, that will already have the necessary NuGet packages referenced.
Follow these steps to create your first plugin:
Good luck,
Jason
While that is useful for Rhino plug-in development, it sounds to me like @Veyis_Gök is developing a standalone application, in which case the plug-in templates cannot be used.
Yes, actually my aim is to make a standalone application. I reviewed your recommendations but these are done by running the rhino environment. I understand that making it independent is a difficult task.
I was able to make a plug-in via rhino but it doesn’t work with an application logic, Rhino does not work without opening it ((
Attached is a standalone commandline program that reads a 3dm file, extracts the meshes and prints out the mesh vertex and face counts. I hope this can help you get started to create a standalone application that reads meshes from 3dm files and writes them to STL.
It uses the rhino3dm nuget package.
TestStandalone3dm.zip (2.0 KB)
Here’s the source code that Pancake used to export Rhino Mesh
to STL files. You may take it as a reference.