geändert wie ich den vorderen block layer definiere
This commit is contained in:
@@ -3,7 +3,7 @@ from ezdxf.entities import Line
|
||||
import math
|
||||
from pydantic import BaseModel, Field, field_validator
|
||||
from typing import Optional
|
||||
from plant2dxf import import_block, get_layer
|
||||
import plant2dxf
|
||||
|
||||
|
||||
ATTR_TAG = "TeileId" # Attributtag im Block
|
||||
@@ -218,8 +218,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
|
||||
import_block("Richtungspfeil", lib_doc, doc)
|
||||
blockref_layer = get_layer(doc, lib_doc, "Richtungspfeil")
|
||||
plant2dxf.import_block("Richtungspfeil", lib_doc, doc)
|
||||
blockref_layer, color = plant2dxf.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 +231,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
|
||||
import_block("Richtungspfeil", lib_doc, doc)
|
||||
blockref_layer = get_layer(doc, lib_doc, "Richtungspfeil")
|
||||
plant2dxf.import_block("Richtungspfeil", lib_doc, doc)
|
||||
blockref_layer, color = plant2dxf.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