Open xbdr419 opened 6 months ago
I don't know exactly the problem but it's related to the MULTILEADER entity in R2007 format.
It works when you first convert the DWG to R2013:
import ezdxf
from ezdxf.addons import odafc
def main():
odafc.convert('demo.dwg', 'demo_R2013.dxf', version="R2013")
doc = ezdxf.readfile('demo_R2013.dxf')
odafc.export_dwg(doc, 'demo_out.dwg')
# odafc.export_dwg(doc, 'demo_out.dwg', version="R2007") # if you really need R2007
if __name__ == "__main__":
main()
Thanks, that is indeed the way to go, my initial aim was to preserve the version information of the source file, which is the R2007 .
Simpler version:
import ezdxf
from ezdxf.addons import odafc
def main():
# due a bug this requires the odafc version format - fixed in next version
doc = odafc.readfile('demo.dwg', version="ACAD2013")
odafc.export_dwg(doc, 'demo_out.dwg')
# odafc.export_dwg(doc, 'demo_out.dwg', version="R2007") # if you really need R2007
if __name__ == "__main__":
main()
There is no hope of solving this problem. When I create a new drawing in R2007 DXF format using MLEADER, there are no problems. i.e. This is a specific problem that may take a lot of time to analyze - but I've already spent far too much time on this unnecessary (for me) and extremely (unnecessarily) complex entity. Therefore not a quick solution.
Thank you very much, this has been able to solve my problem.
This is a bug and the issue stays open even I won't fix it.
Hello, after I read a DWG file and save it directly, the dimension elements are lost. Here is the code. I hope to get some optimization. My current version is 1.1.4b2. 感谢。
source file:
save file:
dwg file:
demo.zip