- added the posibility to export the Geometry in different DXF formats (previously it was hard coded to the AutoCAD 2010): R12, R2000, R2004, R2007, R2010, R2013, R2018 - fixed the camlib.Geometry.bounds() method such that it is calculated correctly for Geometry objects created in the Geometry Editor
46 lines
1.5 KiB
Python
46 lines
1.5 KiB
Python
from PyQt5 import QtWidgets, QtCore
|
|
|
|
from appGUI.GUIElements import FCLabel, FCComboBox
|
|
from appGUI.preferences.OptionsGroupUI import OptionsGroupUI
|
|
import gettext
|
|
import appTranslation as fcTranslate
|
|
import builtins
|
|
|
|
fcTranslate.apply_language('strings')
|
|
if '_' not in builtins.__dict__:
|
|
_ = gettext.gettext
|
|
|
|
|
|
class GeometryExpPrefGroupUI(OptionsGroupUI):
|
|
|
|
def __init__(self, decimals=4, parent=None):
|
|
super(GeometryExpPrefGroupUI, self).__init__(self, parent=parent)
|
|
|
|
self.setTitle(str(_("Geometry Export")))
|
|
self.decimals = decimals
|
|
|
|
# Plot options
|
|
self.export_options_label = FCLabel("<b>%s:</b>" % _("Export Options"))
|
|
self.export_options_label.setToolTip(
|
|
_("The parameters set here are used in the file exported\n"
|
|
"when using the File -> Export -> Export DXF menu entry.")
|
|
)
|
|
self.layout.addWidget(self.export_options_label)
|
|
|
|
grid0 = QtWidgets.QGridLayout()
|
|
grid0.setColumnStretch(0, 0)
|
|
grid0.setColumnStretch(1, 1)
|
|
self.layout.addLayout(grid0)
|
|
|
|
# Excellon non-decimal format
|
|
self.dxf_format_label = FCLabel("%s:" % _("Format"))
|
|
self.dxf_format_label.setToolTip(
|
|
_("Autodesk DXF Format used when exporting Geometry as DXF.")
|
|
)
|
|
|
|
self.dxf_format_combo = FCComboBox()
|
|
self.dxf_format_combo.addItems(['R12', 'R2000', 'R2004', 'R2007', 'R2010', 'R2013', 'R2018'])
|
|
|
|
grid0.addWidget(self.dxf_format_label, 0, 0)
|
|
grid0.addWidget(self.dxf_format_combo, 0, 1)
|