diff --git a/lib/plant2dxf.py b/lib/plant2dxf.py index 041f680..73e30df 100644 --- a/lib/plant2dxf.py +++ b/lib/plant2dxf.py @@ -1519,14 +1519,51 @@ def handle_ils_2_0_kurve_angetrieben(msp, teileid, merkmale, x, y, doc, lib_doc, def handle_ils_2_0_kurve(msp, teileid, merkmale, x, y, doc, lib_doc, verbose, symbols, strecken_nachbarn,config,config_allgemein): + rotation= float(merkmale.get("Drehung")) + h0 = float(merkmale.get("Höhe Anfang")) * 1000 + h1 = float(merkmale.get("Höhe Ende")) * 1000 + hz = (h0 + h1)/2 + kurvenrichtung = merkmale.get("Kurvenrichtung") + kurvenwinkel = merkmale.get("Kurvenwinkel") + blockname = (f"") import_block("AN8",lib_doc,doc) - msp.add_blockref("AN8",(x,y)) + msp.add_blockref("AN8",(x,y,hz),dxfattribs={"rotation": rotation}) + def handle_bt___beladung(msp, teileid, merkmale, x, y, doc, lib_doc, verbose, symbols, strecken_nachbarn,config,config_allgemein): + rotation = None + hight = None + if "Drehung" in merkmale: + rotation= float(merkmale.get("Drehung")) + if "Höhe in M" in merkmale: + hight = float(merkmale.get("Höhe in M")) * 1000 import_block("AN8",lib_doc,doc) - msp.add_blockref("AN8",(x,y)) + if hight == None and rotation == None: + msp.add_blockref("AN8",(x,y)) + elif hight != None and rotation == None: + msp.add_blockref("AN8",(x,y,hight)) + elif hight == None and rotation != None: + msp.add_blockref("AN8",(x,y),dxfattribute={"rotation": rotation}) + else: + msp.add_blockref("AN8",(x,y,hight),dxfattribute={"rotation": rotation}) + def handle_bt___entladung(msp, teileid, merkmale, x, y, doc, lib_doc, verbose, symbols, strecken_nachbarn,config,config_allgemein): + rotation = None + hight = None + if "Drehung" in merkmale: + rotation= float(merkmale.get("Drehung")) + if "Höhe in M" in merkmale: + hight = float(merkmale.get("Höhe in M")) * 1000 import_block("AN8",lib_doc,doc) - msp.add_blockref("AN8",(x,y)) + if hight == None and rotation == None: + msp.add_blockref("AN8",(x,y)) + elif hight != None and rotation == None: + msp.add_blockref("AN8",(x,y,hight)) + elif hight == None and rotation != None: + msp.add_blockref("AN8",(x,y),dxfattribute={"rotation": rotation}) + else: + msp.add_blockref("AN8",(x,y,hight),dxfattribute={"rotation": rotation}) + + def handle_omniflo(msp, teileid, merkmale, x, y, doc, lib_doc, verbose, symbols, strecken_nachbarn,config,config_allgemein): """ Für Omniflo Gerade: zeichnet eine Linie (Mitte = Koordinate, Länge und Winkel aus Merkmale). @@ -1633,7 +1670,7 @@ def erstellung_gefaelle_block_verbunenden_am_einen(msp,x, y, doc, lib_doc, upper block_as = "200000241_AS-Element_90_rechts" import_block(block_as,lib_doc,doc) block_as = dreh_block(block_as,doc,math.radians(winkel_as)) - + elif ((hight == "lower" and drehung0 == "GUZS") or (vario_richtung == "Auf"and verbungden_höher == True and drehung0 == "GUZS") or (vario_richtung == "Ab" and verbungden_höher == False and drehung0 == "GUZS")or (vario_richtung == "Horizontal" and drehung0 == "GUZS" and (mit_horizontal_verbunden == "oben_drehung_0_or_-90" or mit_horizontal_verbunden == "unten_drehung_-180_or_-270"))): block_es = "200000146_ES-Element_90_rechts"