This tag should be used for questions concerning the ezdxf Python package, a library of functions which may be used to read & manipulate DXF files.
Questions tagged [ezdxf]
92 questions
3
votes
3 answers
Cannot display Mesh in Freecad after exporting Mesh from Python using the ezdxf interface
This is my first time posting here. I am making 3D models of houses using python and I would like to visualise the output using FreeCAD. I found the ezdxf interface (https://pypi.org/project/ezdxf/) which writes to dxf format and I ran the below…

lukecoburn
- 31
- 3
3
votes
1 answer
How to find which Lines and Arcs are connected when imported from DXF?
I am using ezdxf to import a .dxf file into Python. It works smoothly. I get a list of lines and arcs.
How do I figure out which lines and arcs are connected to each other? Are they somehow indexed or do I need to search start and end points of…

Tola
- 254
- 3
- 17
2
votes
2 answers
Get circles x and y center
My target is to get all circles from dxf file with 3 information like: circumference, X center, Y center. So far i am able to get circumference. How can i get Y & X? This is my current code:
import sys
import ezdxf
doc =…

Arie
- 3,041
- 7
- 32
- 63
2
votes
2 answers
Is there a way to change the background color in ezdxf?
I want to change the background color of the photo because it's not clear I tried to change the Figure of matplotlib background but it doesn't work
import matplotlib.pyplot as plt
import ezdxf
from ezdxf.addons.drawing import…

Hamza Mohammed
- 53
- 7
2
votes
1 answer
ezdxf python mtext set location
I have some simple text I want to place in my dxf, like this:
mtext = msp.add_mtext("TEXT TEST", dxfattribs={'style': 'OpenSans'})
I want to insert this text in x=1 and y=1 location in my dxf.
This is what i tried:
mtext.dxf.insert([1,1,0])
But I…

user2727167
- 428
- 1
- 3
- 16
2
votes
1 answer
How do I return the string within 'MTEXT' with ezdxf?
I am using the below code to return a string from all TEXT items within a .dxf
for i in m_space.query('TEXT'):
return(str(i.dxf.text))
This is working well so I would like to do the same for all MTEXT items. From reading the docs I have…

ajcnzd
- 53
- 4
2
votes
1 answer
How can I use python to write a dxf file from coordinates?
I am trying to use ezdxf to write a dxf file from a list of coordinates.
I am able to create a dxf file with a simple line drawn using the code below:
import ezdxf
doc = ezdxf.new('R2010') # create a new DXF drawing in R2010 fromat
msp =…

paperstsoap
- 335
- 4
- 13
2
votes
2 answers
Python module to merge DXF files
I am looking for a python module that will merge dxf files. I have found dxfgrabber and ezdxf, however they seem to be used for different applications then what I am after.
I am using ExpressPCB, which outputs each layer of the PCB, the holes, and…

paperstsoap
- 335
- 4
- 13
1
vote
1 answer
Dxf file generated using ezdxf doesn't render text in 3d model when viewed in Autodesk Viewer
I have written code that created dxf file with 2 cylinders stacked on top of each other, most of the part is working fine except when I add text into the 3d model it doesn't show in the Autodesk Viewer, any idea why or any possible fix? Below is my…

Mohamad Fadil
- 33
- 3
1
vote
0 answers
How can I mass create a drawing for laser cutting (DXF, DWG, etc.) with different QR codes
I am trying to cut some tags with a laser cutter. Every tag that I cut should have a different QR code.
The cut pattern is the same for all, but I need a way to create an image of a QR code that can work in a loop. In total there will be about 80…

ItsMeBrille
- 33
- 5
1
vote
1 answer
How to extract entity wise color, transparency, linewidth of AutoCAD dxf file using ezdxf python package?
I'm using ezdxf package in python to read the AutoCAD .dxf file. Can anyone tell me how to extract Line width, Transparency, and Color information of each entity present in modelspace?
I tried the below code:
doc = ezdxf.readfile('test.dxf')…

Adithya
- 25
- 3
1
vote
1 answer
change page setup with ezdxf
i would like to change the properties of layouts with ezdxf.
There is a function called page_setup, but it is not working in my case.
This is a minimal example created from the API.
What is wrong with my approach?
import ezdxf
# Create a new DXF…

Christoph Müller
- 483
- 1
- 5
- 16
1
vote
0 answers
Geometric Dimensioning and Tolerancing support in EZDXF Python
I am trying to read the GD&T Symbols like Concentricity, Perpendicularity using ezdxf parser on DXF Files. The GDT Symbols get read as TOLERANCE Entity and using the content attribute I have succeeded to find the tolerance value, GDT Type and the…

Anuradha
- 1,089
- 4
- 18
- 29
1
vote
0 answers
Render Geometric Tolerance in ezdxf
Is Geometric Tolerance supported by ezdxf? I've been trying to render some dxf files with geometric tolerances like;
-Flatness
-Position
-Runout
-Parallelism
-Perpendicity, etc
But I get a "skipped entity TOLERANCE(#!!). Reason: "unsupported""
Is…

Joe Joseph
- 11
- 1
1
vote
0 answers
ModuleNotFoundError: No module named 'ezdxf'
I've installed ezdxf running following library in the same folder that my .py file is located, with this command:
pip install ezdxf
I see this error when hovering on import ezdxf
Import ezdxf could not be resolved Pylance
When I try to run the…

Arie
- 3,041
- 7
- 32
- 63