Replies: 2 comments 1 reply
-
I am not a Fusion 360 nor a AAMA/AST expert, but there exist an add-on to export ASTM-D6673-10 compatible DXF files for usage with Gerber Technology applications: https://ezdxf.mozman.at/docs/addons/gerber_D6673.html See also this thread: #789 But be aware |
Beta Was this translation helpful? Give feedback.
-
This is a simple version of a converter script, most code of the converter is error handling: import sys
import ezdxf
from ezdxf import recover
from ezdxf.addons import gerber_D6673
def convert(dxf_fname, astm_fname):
try:
doc, auditor = recover.readfile(dxf_fname)
except IOError:
print(f"Not a DXF file or a generic I/O error.")
exit(1)
except ezdxf.DXFStructureError:
print(f"Invalid or corrupted DXF file.")
exit(2)
if doc.dxfversion > ezdxf.DXF12:
print(f"Only DXF R12 input files are supported, input file has version {doc.acad_release}.")
exit(3)
try:
gerber_D6673.export_file(doc, astm_fname)
except IOError as e:
print(f"Cannot write file '{astm_fname}'\n{str(e)}")
exit(4)
print(f"File '{astm_fname}' successfully written.")
if __name__ == "__main__":
script_name = sys.argv[0]
try:
dxf_fname = sys.argv[1]
astm_fname = sys.argv[2]
except IndexError:
print(f"Invalid arguments.\nUsage: {script_name} <dxf_fname> <astm_fname>")
else:
convert(dxf_fname, astm_fname) I assume you are working on Windows, so the
The ASTM exporter supports only DXF R12 because I don't have any other example files but in practice it should be possible to export input documents with a newer version as a DXF R12 file by stripping all newer features and entities. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi there. I'm not a programmer or even close but I work with dxf files. I need to convert a standard dxf file from Fusion 360 to dxf aama/astm.. Is this possible? I've been through the entire internet and it doesn't seem possible but thought I'd ask you. Thanks
Beta Was this translation helpful? Give feedback.
All reactions