This commit is contained in:
2025-06-15 23:10:17 +02:00
parent 5dd8869caf
commit 74bf60101c
16 changed files with 426 additions and 2577 deletions

View File

@@ -268,9 +268,13 @@ class exportDXF:
})
def createPolyline(self, wire):
data = getWire(wire.Shape)
lwp = self.msp.add_lwpolyline(data)
return lwp
try:
data = getWire(wire.Shape)
lwp = self.msp.add_lwpolyline(data)
return lwp
except Exception as e:
print("Error creating polyline:", e)
return None
def getWire(wire, nospline=False, width=.0):
@@ -519,7 +523,8 @@ class _PVPlantExportDXF(QtGui.QWidget):
def writeArea(self):
pol = self.exporter.createPolyline(FreeCAD.ActiveDocument.Site.Boundary)
pol.dxf.layer = "boundary"
if pol:
pol.dxf.layer = "boundary"
for area in FreeCAD.ActiveDocument.Boundaries.Group:
pol = self.exporter.createPolyline(area)