Rhino Mesh class >> AutoCAD Solid3d class?

Hi @dale - you helped me on a previous post to import some of our legacy Inventor part file geometry into Rhino. My question now relates to the same project but now we are serving the manipulated geometry back to Users…

Our Rhino.Compute server is now successfully streaming the Rhino mesh geometry to our plugin running inside AutoCAD/Civil3D. In this image you can see the geometry (streamed as Rhino mesh objects which our plugin converts in memory to Three.js meshes) rendered in the preview window.


Once the User clicks a commit button we want the geometry to be inserted into their AutoCAD drawing.
Can you advise a strategy for converting the Rhino mesh geometry to native AutoCAD objects (Solid3d class) ? The options I am aware of are:

  • save meshes as .3dm file, use AutoCAD IMPORT command to import the ,3dm file.
  • export meshes to .dwg file, use AutoCAD INSERT command to insert the .dwg file.

Can you advise of a better solution that avoids file IO and could translate in memory from mesh to Solid3d ? Perhaps Rhino.Inside AutoCAD offers some in-memory translation methods @kike ?
If the two file IO solutions I’ve mentioned are the way to go, would IMPORT 3dm be better than EXPORT dwg - I assume OpenNURBS is much easier for autoCAD people to create an importer with than the other way around since AutoCAD may be less, urr, open! Any thoughts?

Thanks
Dan

Hi @MonkeyFace,

If you have a Rhino mesh and are sitting inside of AutoCAD, why not just create an AutoCAD mesh?

Here is an example of creating an AutoCAD mesh from a Rhino mesh:

– Dale

Hi Dale that’s really helpful - thank you. Clearly we can take that route for mesh geometry.

However, if i get kick-back from Autocad Users that faceted mesh objects are undesirable is there anything you can point me to for constructing a Solid3d class from a Rhino BRep ?

Hi @MonkeyFace,

AutoCAD has as Brep API that is .NET accessible. I don’t know anything about it. But I’m sure it’s worth looking into.

– Dale

Thanks Dale, apparently AutoCAD can create a Solid3d from a SubDMesh … according to these links which i post in case anyone else finds it helpful…



This looks super interesting!

If you are having compute do the work, you may not even need to have Rhino.Inside AutoCad. You could use our stand alone Rhino3dm libraries in your AutoCAD plug-in to convert the Rhino geometry to AutoCad geometry.

Hi Steve, yes we aren’t planning to use Rhino.Inside at all - i just wondered if the guys working on that project had faced the challenge of converting in-memory from Rhino BRep to AutoCAD BRep/Solid3D in which case we could just look at their source code or pinch their methods!!

When you say “use our stand alone Rhino3dm libraries to convert the Rhino geometry to AutoCad geometry” - can you advise does Rhino3dm have methods to do this in-memory or is it file IO methods (exporting to dwg, using AutoCAD to import file) ? I’m new to Rhino so my apologies if there are well known methods that i am not aware of.

1 Like

The most similar to an in-memory conversion for breps is calling C++ TbDbBody::acisIn or in .NET Body.acisIn see here.

The newly created objects are not added to a Database, so it is the calling application’s responsibility to either add them to a database or delete them from memory when they are no longer needed.

The thing is that this method takes a .SAT file path.
If your are able to generate a .SAT from compute then is a way to go.

If you only need to move tesselated geometry the SubD path looks promissing and will be trully in-memory.

1 Like

We experimented with a few of the above strategies and this Body.acisIn method was lightning quick compared to the others. Great solution for us, thank you Kike.