Rhino 8 DXF export breaks color parsing in legacy ShapeDiver import

Hi everyone,

I just spent the entire afternoon debugging why my new DXF files (exported via Pancake in Rhino 8) weren’t parsing correctly using the legacy ShapeDiver Import Geometry component-both locally and online.

:magnifying_glass_tilted_left: The issue:

In the latest Rhino 8 builds, DXF lines with color 0,0,0 (black) are being interpreted as 255,255,255 (white) by the legacy ShapeDiver Import Geometry component-the one where the M output gives RGB values directly.
This doesn’t happen with DXFs exported from Rhino 7 or older builds of Rhino 8.

Please see the screenshot below to compare the behavior across versions:

:white_check_mark: Temporary workaround:

Use Rhino 7 for DXF export if you need compatibility with older ShapeDiver components that rely on proper color parsing.

Hi @brian, I noticed you worked on this related DXF export issue - could this be connected?

PS: I’m pretty burned out from chasing this down, but posting it here in case it saves someone else hours of frustration. :slightly_smiling_face:

Since these components did not get any update in a long time (especially not the Legacy Import component), then this must be due to a change in Rhino itself.
Is there any reason why you do not upgrade to the latest version of the Import component? If I understand correctly, it would solve the issue, correct?

Thanks Mathieu,
Yeah, I resolved it by exporting the DXF files from Rhino 7, so I don’t expect any action from your side.

I’m still using the older import components mainly because they give me the raw R,G,B values directly. The newer ones output materials, and I’d have to explode them to get separate values - plus they convert RGB codes into color names like “White”, “Black”, etc. It’s not a dealbreaker, just a bit more work.

Also, since I often need to import many 3D models, I’d need multiple import components - which can easily turn the definition into a full-on spaghetti mess. So yeah, partly laziness on my side :sweat_smile:

That said, is there any easy way to turn off the color name translation in the new import component?

I think the color name translation is a “feature” of GH_Colour when it gets cast to a string. Can you avoid the casting?

Hi Alex!

Lets keep it simple, how to get rid of “black” from the list?


example.gh (4.7 KB)

Here is my approach, it is clearly show why I do prefer the legacy way. Or do I miss something?

Why do you want to get rid of the “Black” color? As Alex said, this is just a matter of the way colors in Grasshopper are cast to strings, but the component outputs a real color which can then be used further in your definition for whatever purpose you are interested in. In other words, it should not have any impact on your workflow.

As a matter of fact, the old Import component was using an external algorithm, whereas the new one imports objects and materials using only Rhino functionalities.

1 Like

I am embedding a metadata trough RGB channels, as back in the times it was the only way to describe what is inside the imported 3D model. We build up the whole system base on this. At the moment there would be more convenient paths I am sure.

Got it. Given that this behaviour is the standard one in Grasshopper, I think the workaround from your screenshot above is the best solution at the moment. It would indeed make sense in the future to revisit your workflow making use of the most recent feature or Rhino 8/ShapeDiver.

Can you please suggest what is the latest version of the plugin working well with Rhino 6 backend and Import geometry component?

You should be able to use the latest released version of the plugin for all versions of Rhino. Note that the Rhino 6 plugin still includes the old Import Geometry components, as the new ones are only compatible with Rhino 7+.

I see only the “new” one, the legacy is probably missing.