Update app.py
Browse files
app.py
CHANGED
|
@@ -78,8 +78,9 @@ def create_dxf_capacitor_bank(capacitors):
|
|
| 78 |
for idx, cap in enumerate(capacitors):
|
| 79 |
label = f"{cap} kVAR"
|
| 80 |
msp.add_lwpolyline([(x, 0), (x+10, 0), (x+10, 10), (x, 10), (x, 0)])
|
| 81 |
-
#
|
| 82 |
-
msp.add_text(label, dxfattribs={'height': 2.5})
|
|
|
|
| 83 |
x += 15
|
| 84 |
output_path = "capacitor_bank.dxf" # Changed to relative path
|
| 85 |
doc.saveas(output_path)
|
|
|
|
| 78 |
for idx, cap in enumerate(capacitors):
|
| 79 |
label = f"{cap} kVAR"
|
| 80 |
msp.add_lwpolyline([(x, 0), (x+10, 0), (x+10, 10), (x, 10), (x, 0)])
|
| 81 |
+
# Create text entity and set its properties
|
| 82 |
+
text = msp.add_text(label, dxfattribs={'height': 2.5})
|
| 83 |
+
text.dxf.insert = (x, 12) # Set the insertion point
|
| 84 |
x += 15
|
| 85 |
output_path = "capacitor_bank.dxf" # Changed to relative path
|
| 86 |
doc.saveas(output_path)
|