Upload and Process DXF using Rhino Compute

I’m trying to run a Rhino Compute server that processes an uploaded DXF file. The Appserver is running in a docker on my mac and the computer server is running in a VM of windows 11.

Right now, my workflow is:

  1. Receive a Base64 string.

  2. Save it as a temp .dxf file.

  3. Load the objects into a Headless Doc.

The problem is that I need to output these objects to the native Group Content component in Grasshopper. When I try to pass the objects from the script, they don’t seem to preserve the layer information in a way the component can read, or I get a “Data conversion failed from Goo to Model Content” error.

I’ve tried File3dm.Read (fails to read the temp file on Mac so I’m not sure if it will work deployed in a container) and doc.Write3dm (not supported on Mac headless), so I’m stuck on how to get valid ModelObjects that the Group component will accept.

I will need to eventually expand this process to work with a few more file types (dwg, svg, 3dm), but for now my focus is DXF.