Convert .DWG to 3dm using Rhino Compute

Is it possible to convert a .dwg file from disk into .3dm using Rhino Compute?

const filePath = './sample.dwg'
const fileData = fs.readFileSync(filePath).toString('utf8')

...cool rhino compute code/call goes here

1 Like

We need to add a new endpoint for rhino.compute to support file conversion to 3dm. Technically this could be achieved by passing a python script to compute and returning a base64 encoded version of the 3dm file, but this approach doesn’t seem nearly as elegant as simply having a new endpoint called something like /to3dm

I added this to our bug tracker at Create to3dm endpoint · Issue #415 · mcneel/compute.rhino3d · GitHub
and will see what we can do to get this implemented soon

Here’s an option, in the form of a sample Rhino Compute plug-in.