Block_methoden in einen eigen File refactored
This commit is contained in:
@@ -4,6 +4,7 @@ import math
|
||||
from pydantic import BaseModel, Field, field_validator
|
||||
from typing import Optional
|
||||
import plant2dxf
|
||||
import block_methoden
|
||||
|
||||
|
||||
ATTR_TAG = "TeileId" # Attributtag im Block
|
||||
@@ -218,8 +219,8 @@ class Kreisel(BaseModel):
|
||||
rotation = math.degrees(math.atan2(p2_oben[1] - p1_oben[1], p2_oben[0] - p1_oben[0]))
|
||||
if drehrichtung == "GUZS":
|
||||
rotation += 180
|
||||
plant2dxf.import_block("Richtungspfeil", lib_doc, doc)
|
||||
blockref_layer, color = plant2dxf.get_insert_color_layer(lib_doc, "Richtungspfeil")
|
||||
block_methoden.import_block("Richtungspfeil", lib_doc, doc)
|
||||
blockref_layer, color = block_methoden.get_insert_color_layer(lib_doc, "Richtungspfeil")
|
||||
bref = msp.add_blockref("Richtungspfeil", (px, py,z1), dxfattribs={"rotation": rotation,"layer": blockref_layer})
|
||||
if verbose:
|
||||
print(f"[INFO] Drehrichtung '{drehrichtung}': Richtungspfeil oben bei ({px:.1f}, {py:.1f}), rot={rotation:.1f}")
|
||||
@@ -231,8 +232,8 @@ class Kreisel(BaseModel):
|
||||
rotation = math.degrees(math.atan2(p2_unten[1] - p1_unten[1], p2_unten[0] - p1_unten[0]))
|
||||
if drehrichtung == "UZS":
|
||||
rotation += 180
|
||||
plant2dxf.import_block("Richtungspfeil", lib_doc, doc)
|
||||
blockref_layer, color = plant2dxf.get_insert_color_layer( lib_doc, "Richtungspfeil")
|
||||
block_methoden.import_block("Richtungspfeil", lib_doc, doc)
|
||||
blockref_layer, color = block_methoden.get_insert_color_layer( lib_doc, "Richtungspfeil")
|
||||
bref = msp.add_blockref("Richtungspfeil", (px, py, z1), dxfattribs={"rotation": rotation , "layer": blockref_layer})
|
||||
if verbose:
|
||||
print(f"[INFO] Drehrichtung '{drehrichtung}':Richtungspfeil unten bei ({px:.1f}, {py:.1f}), rot={rotation:.1f}")
|
||||
Reference in New Issue
Block a user