How to add ezdxf module to Rhino python?

I tried to add c:\Python38 path to Rhino python options, but still didn’t find the module “Message: No module named ezdxf”

ezdxf source: ezdxf · PyPI

Hi @gdlfactory,

Rhino’s implementation of Python is based in IronPython, not CPython. Thus, it cannot use Python packages you get from Pypi.

That said, Rhino can import and export DXF files. So what is it that you are trying to do?

– Dale

I would like to remove programmatically layer 0 from dxf files. That seems impossible in Rhino by default. Or is there another way to do that?

ezdxf lib would do the thing, but haven’t figured out if it’s even possible to install on Rhino / IronPython…

Hello,
It says it requires at least python 3.7 so it should not work in IronPython. There are some older versions on pypi which claim Python 2.7 compatibility - you could try one of them. You may also need to set an environment variable to disable C extensions as these will not work in IronPython.

I see this post is a few years old - predating Rhino8. Is this still relevant?

I would assume not, but I don’t know anything about the library.

— Dale