Questions tagged [ezdxf]

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.

92 questions
0
votes
0 answers

How to copy layouts from one dxf to another dxf?

I have a dxf file file1.dxf with layouts ( layout F11, layout F12, layout F13) I have another dxf file file2.dxf with layouts (layout F21, layout F22) I want to copy the layouts from file1 to file2 How do I do that using ezdxf? For now I copy them…
codewin
  • 41
  • 1
  • 9
0
votes
1 answer

How to get paperspace of each entity in a DXF file?

I would like to know on which paperspace each entity in a DXF file would be located. I tried to find this by the code below, but the layout name I got is always the same one for each entity, while there are multiple number of paperspace in the DXF…
isaku
  • 1
  • 1
0
votes
1 answer

how to write comments for layer in a new dxf file with ezdxf

I am using ezdxf to generate a DXF file for a tool. This tool needs to have in the dxf a comment containing informations for each layer. The comments must be formatted in a particular way. Is there a way to create a comment and save it with…
phil
  • 1
0
votes
1 answer

Find .dxf entity based on handle with EZDXF library

I've been using the Autocad API to fill out block attributes based on the (pre determined) handle ID. Here is a sample of the implementation: frame1 = acad.ActiveDocument.HandleToObject('18CA1') frame2 =…
Jowizo
  • 57
  • 1
  • 5
0
votes
1 answer

ezdxf convert WCS to DCS

I am trying to parse .dxf files and I am trying to figure out how to get the dimensions of the actual page (which I got using doc.layouts.active_layout().get_paper_limits() ) and where the page's entities are in relation to each other and the page…
Natalie
  • 447
  • 1
  • 4
  • 16
0
votes
2 answers

How can I offer an ezdxf download in a Flask App?

I am trying to implement ezdxf into a Flask Web-App, where I am trying to render a file and offer it as a download. Is that possible without a database? (If not, how can I can I change the file directory of the saveas function to a web…
Jan
  • 1
  • 2
0
votes
1 answer

How to use ezdxf to find location of mirrored entities like blocks/circles?

How do you calculate the location of a block or an insert entity that has been mirrored? There is a circle inside a 'wb' insert/block entity. I'm trying to identify it's location on msp and draw a circle it. There are 2 'wb' blocks in the attached…
0
votes
0 answers

How to use EZDXF Library to add an image with different scales?

I notice 'The IMAGE entity is like a block reference, you can use it multiple times to add the image on different locations with different scales and rotations.' in the introduction of class 'Image'(see :…
ZackWann
  • 1
  • 1
0
votes
1 answer

Can I delete an empty layer using ezdxf?

Is there no way to delete an empty layer from the layer list? I want to do the same thing as the autocad purge command. I tried to write the code but it didn't work. del_lay = [] for layer in dwg.layers: s = layer.dxf.name lay_=…
leez
  • 85
  • 8
-1
votes
1 answer

How do I delete objects on a specific layer in AutoCAD drawing using Python?

Erase line on a layer a layer in a cad, using python Hi, I want to select objects on a specific layer in my autocad drawning. After, I want to delete them. I tried a couple thing (using python) with exdxf or pyautocad. Can someone send me line to…
-1
votes
1 answer

ezDXF: Can i set a text style inside a BLOCK?

When I try to set up a text style inside a BLOCK, TrueView stops with an error. If I remove the style line the DXF is accepted doc = ezdxf.new(dxfversion="AC1024") #... device = doc.blocks.new(name='device') device.add_text("eBCON", …
Antoni Gual Via
  • 714
  • 1
  • 6
  • 14
-1
votes
1 answer

How to draw the area inside a contour using opencv? (the picture was exported from dxf file)

I have a picture which has multiple mechanical components. They were exported directly from the dxf file using ezdxf. How can I divide them draw each one to an image separately? I have tried using contours, hierarchy =…
-1
votes
1 answer

I cant run ezdxf,

i just try to use ezdxf, and copied that code from ezdxf website: import ezdxf doc = ezdxf.new('R12', setup=True) msp = doc.modelspace() msp.add_text("A Simple Text").set_pos((2, 3), align='MIDDLE_RIGHT') msp.add_text("Text Style Example: Liberation…
Kolkornik
  • 1
  • 2
-1
votes
1 answer

Get Attributes in dynamic block using ezdxf 0.14.1 and Python 3.8

I made a dynamic block using auotcad as attached and there are several attributes inside, i.e. "RXXX", "COOR". https://drive.google.com/file/d/1c8WdeAql1U5edFBKEK7coupx9ilX_Ga6/view?usp=sharing I would like to extract the attributes following the…
-1
votes
1 answer

Get a list of autocad layers with edzxf

I want to get a list of autocad layer names with ezdxf. I have referenced the ezdxf documentation but I do not know how. The following is described in the documentation, do you use this? Drawing.layout_names()   Get a list of available paper…
leez
  • 85
  • 8