Hi,
Below is the sample script that reproduces the error. I have a dxf file and i want to extract all the line entities present in it. I want to do this parallely. But it throws recursion error : Maximum recursion depth exceeded.
Below is the script
import ezdxf
import concurrent.futures
def extract_line_entity_data(entity):
data = {}
data["Entity Type"] = entity.dxftype() # Store the type of entity
data["Layer Name"] = entity.dxf.layer # Store the name of the layer to which the line entity belongs
data["Start Point"] = tuple(entity.dxf.start) # Store the start point of the line as a tuple (x, y, z)
data["End Point"] = tuple(entity.dxf.end) # Store the end point of the line as a tuple (x, y, z)
return data
def extract_line_entities(file_path):
doc = ezdxf.readfile(file_path)
entities = doc.modelspace().query('LINE')
extracted_line_data = []
with concurrent.futures.ProcessPoolExecutor() as executor:
results = list(executor.map(extract_line_entity_data, entities))
extracted_line_data = [result for result in results if result is not None]
return extracted_line_data
if __name__ == "__main__":
file_path = 'Sample_Filer.dxf' # Replace with your DXF file path
line_entities = extract_line_entities(file_path)
print(line_entities)
Below is the error
File "C:\Users\user1\anaconda3\envs\deploy\lib\site-packages\ezdxf\entities\dxfns.py", line 123, in __getattr__
attrib_def: Optional[DXFAttr] = self.dxfattribs.get(key)
File "C:\Users\user1\anaconda3\envs\deploy\lib\site-packages\ezdxf\entities\dxfns.py", line 297, in dxfattribs
return self._entity.DXFATTRIBS
File "C:\Users\user1\anaconda3\envs\deploy\lib\site-packages\ezdxf\entities\dxfns.py", line 123, in __getattr__
attrib_def: Optional[DXFAttr] = self.dxfattribs.get(key)
File "C:\Users\user1\anaconda3\envs\deploy\lib\site-packages\ezdxf\entities\dxfns.py", line 297, in dxfattribs
return self._entity.DXFATTRIBS
File "C:\Users\user1\anaconda3\envs\deploy\lib\site-packages\ezdxf\entities\dxfns.py", line 123, in __getattr__
attrib_def: Optional[DXFAttr] = self.dxfattribs.get(key)
File "C:\Users\user1\anaconda3\envs\deploy\lib\site-packages\ezdxf\entities\dxfns.py", line 297, in dxfattribs
return self._entity.DXFATTRIBS
RecursionError: maximum recursion depth exceeded
Even if i do not extract any data from line entity, still the script is throwing the same error,
import ezdxf
import concurrent.futures
def extract_line_entity_data(entity):
data = {}
return data
def extract_line_entities(file_path):
doc = ezdxf.readfile(file_path)
entities = doc.modelspace().query('LINE')
extracted_line_data = []
with concurrent.futures.ProcessPoolExecutor() as executor:
results = list(executor.map(extract_line_entity_data, entities))
extracted_line_data = [result for result in results if result is not None]
return extracted_line_data
if __name__ == "__main__":
file_path = 'Sample.dxf' # Replace with your DXF file path
line_entities = extract_line_entities(file_path)
print(line_entities)
Hi, Below is the sample script that reproduces the error. I have a dxf file and i want to extract all the line entities present in it. I want to do this parallely. But it throws recursion error : Maximum recursion depth exceeded.
Below is the script
Below is the error
Even if i do not extract any data from line entity, still the script is throwing the same error,
Can anyone help??