gefaellegerade sonderfall
This commit is contained in:
+249
-34
@@ -283,6 +283,8 @@ def handle_standard(msp, blocknames, teileid, x, y, lib_doc, doc, verbose):
|
|||||||
|
|
||||||
def handle_ils_2_0_gefaellestrecke(msp, teileid, merkmale, x, y, doc, lib_doc, verbose, symbols, gefaellestrecken_nachbarn,config):
|
def handle_ils_2_0_gefaellestrecke(msp, teileid, merkmale, x, y, doc, lib_doc, verbose, symbols, gefaellestrecken_nachbarn,config):
|
||||||
#Vorbereitung der attributen
|
#Vorbereitung der attributen
|
||||||
|
am_kreisel = 0
|
||||||
|
richtung2 ="DEFAULT"
|
||||||
unterschiedlich = False
|
unterschiedlich = False
|
||||||
asoffset = float(config.get("ILS 2.0 Gefällestrecke", "asoffset"))
|
asoffset = float(config.get("ILS 2.0 Gefällestrecke", "asoffset"))
|
||||||
esoffset = float(config.get("ILS 2.0 Gefällestrecke", "esoffset"))
|
esoffset = float(config.get("ILS 2.0 Gefällestrecke", "esoffset"))
|
||||||
@@ -303,10 +305,11 @@ def handle_ils_2_0_gefaellestrecke(msp, teileid, merkmale, x, y, doc, lib_doc, v
|
|||||||
y1_kreisel = float(gefaellestrecke_nachbarn.get("y1"))
|
y1_kreisel = float(gefaellestrecke_nachbarn.get("y1"))
|
||||||
richtung0 = float(gefaellestrecke_nachbarn.get("rotation0"))
|
richtung0 = float(gefaellestrecke_nachbarn.get("rotation0"))
|
||||||
richtung1 = float(gefaellestrecke_nachbarn.get("rotation1"))
|
richtung1 = float(gefaellestrecke_nachbarn.get("rotation1"))
|
||||||
|
richtung2 ="DEFAULT"
|
||||||
richtung_rad0= math.radians(richtung0)
|
richtung_rad0= math.radians(richtung0)
|
||||||
richtung_rad1 = math.radians(richtung1)
|
richtung_rad1 = math.radians(richtung1)
|
||||||
abstand0 = float(gefaellestrecke_nachbarn.get("abstand0"))
|
abstand0 = float(gefaellestrecke_nachbarn.get("abstand0")) * 1000
|
||||||
abstand1 = float(gefaellestrecke_nachbarn.get("abstand1"))
|
abstand1 = float(gefaellestrecke_nachbarn.get("abstand1")) * 1000
|
||||||
kreisel_verbunden = 0
|
kreisel_verbunden = 0
|
||||||
laenge_m = merkmale.get("Länge in Meter", "10").replace(",", ".")
|
laenge_m = merkmale.get("Länge in Meter", "10").replace(",", ".")
|
||||||
try:
|
try:
|
||||||
@@ -319,45 +322,75 @@ def handle_ils_2_0_gefaellestrecke(msp, teileid, merkmale, x, y, doc, lib_doc, v
|
|||||||
halbabstand0 = abstand0 / 2
|
halbabstand0 = abstand0 / 2
|
||||||
dx0 = halbabstand0 * math.cos(richtung_rad0)
|
dx0 = halbabstand0 * math.cos(richtung_rad0)
|
||||||
dy0 = halbabstand0 * math.sin(richtung_rad0)
|
dy0 = halbabstand0 * math.sin(richtung_rad0)
|
||||||
pos0_0 = (round(x0_kreisel - dx0),round( y0_kreisel - dy0),hoehe0)
|
pos0_0 = (round(x0_kreisel + dx0),round( y0_kreisel + dy0),hoehe0)
|
||||||
pos0_1 = (round(x0_kreisel+ dx0),round( y0_kreisel+ dy0), hoehe0)
|
pos0_1 = (round(x0_kreisel- dx0),round( y0_kreisel- dy0), hoehe0)
|
||||||
|
|
||||||
halbabstand1 = abstand1 / 2
|
halbabstand1 = abstand1 / 2
|
||||||
dx1 = halbabstand1 * math.cos(richtung_rad1)
|
dx1 = halbabstand1 * math.cos(richtung_rad1 )
|
||||||
dy1 = halbabstand1 * math.sin(richtung_rad1)
|
dy1 = halbabstand1 * math.sin(richtung_rad1)
|
||||||
pos1_0 = (round(x1_kreisel - dx1), round(y1_kreisel - dy1), hoehe1)
|
pos1_0 = (round(x1_kreisel + dx1), round(y1_kreisel + dy1), hoehe1)
|
||||||
pos1_1 = (round(x1_kreisel + dx1), round(y1_kreisel + dy1), hoehe1)
|
pos1_1 = (round(x1_kreisel - dx1), round(y1_kreisel - dy1), hoehe1)
|
||||||
winkel = math.radians(float(merkmale.get("Drehung")))
|
winkel = math.radians(float(merkmale.get("Drehung")))
|
||||||
|
|
||||||
halbe_laenge = laenge / 2
|
halbe_laenge = laenge / 2
|
||||||
dx = halbe_laenge *math.sin(winkel * -1)
|
dx = halbe_laenge *math.sin(winkel * -1)
|
||||||
dy = halbe_laenge * math.cos(winkel)
|
dy = halbe_laenge * math.cos(winkel)
|
||||||
start = (x +dx , y + dy ,upper_hoehe_gefaehlle)
|
start = (round(x +dx ), round(y + dy ),upper_hoehe_gefaehlle)
|
||||||
ende = (x -dx, y - dy ,lower_hoehe_gefaehlle)
|
ende = (round(x -dx), round(y - dy ) ,lower_hoehe_gefaehlle)
|
||||||
abstand_fuer_kreis_start = round(start[0] +RADIUS),round( start[1] + RADIUS)
|
abstand_fuer_kreis_start_x = start[0] +RADIUS, start[1]
|
||||||
abstand_gegen_kreis_start = round(start[0] - RADIUS), round(start[1] - RADIUS)
|
abstand_gegen_kreis_start_x = start[0] -RADIUS, start[1]
|
||||||
abstand_fuer_kreis_ende = round(ende[0] + RADIUS), round(ende[1] + RADIUS)
|
abstand_fuer_kreis_start_y = start[0], start[1] + RADIUS
|
||||||
abstand_gegen_kreis_ende = round(ende[0] - RADIUS), round(ende[1] - RADIUS)
|
abstand_gegen_kreis_start_y = start[0], start[1] - RADIUS
|
||||||
|
abstand_fuer_kreis_ende_x= ende[0] + RADIUS, ende[1]
|
||||||
|
abstand_gegen_kreis_ende_x= ende[0] - RADIUS, ende[1]
|
||||||
if( abstand_fuer_kreis_start[0] == pos0_0[0] or abstand_fuer_kreis_start[0] == pos0_1[0] or
|
abstand_fuer_kreis_ende_y = ende[0] , ende[1] + RADIUS
|
||||||
abstand_fuer_kreis_start[1] == pos0_0[1] or abstand_fuer_kreis_start[1] == pos0_1[1] or
|
abstand_gegen_kreis_ende_y = ende[0] , ende[1] - RADIUS
|
||||||
abstand_gegen_kreis_ende[0] == pos0_0[0] or abstand_gegen_kreis_ende[0] == pos0_1[0] or
|
|
||||||
abstand_gegen_kreis_ende[1] == pos0_0[1] or abstand_gegen_kreis_ende[1] == pos0_1[1]
|
|
||||||
|
|
||||||
|
|
||||||
|
if( (abstand_fuer_kreis_start_x[0] == pos0_0[0] and abstand_fuer_kreis_start_x[1] == pos0_0[1] )or
|
||||||
|
( abstand_fuer_kreis_start_x[0] == pos0_1[0] and abstand_fuer_kreis_start_x[1] == pos0_1[1]) or
|
||||||
|
( abstand_gegen_kreis_start_x[0] == pos0_0[0] and abstand_gegen_kreis_start_x[1] == pos0_0[1]) or
|
||||||
|
( abstand_gegen_kreis_start_x[0] == pos0_1[0] and abstand_gegen_kreis_start_x[1] == pos0_1[1]) or
|
||||||
|
(abstand_fuer_kreis_ende_x[0] == pos0_0[0] and abstand_fuer_kreis_ende_x[1] == pos0_0[1] )or
|
||||||
|
( abstand_fuer_kreis_ende_x[0] == pos0_1[0] and abstand_fuer_kreis_ende_x[1] == pos0_1[1]) or
|
||||||
|
( abstand_gegen_kreis_ende_x[0] == pos0_0[0] and abstand_gegen_kreis_ende_x[1] == pos0_0[1]) or
|
||||||
|
( abstand_gegen_kreis_ende_x[0] == pos0_1[0] and abstand_gegen_kreis_ende_x[1] == pos0_1[1]) or
|
||||||
|
|
||||||
|
(abstand_fuer_kreis_start_y[0] == pos0_0[0] and abstand_fuer_kreis_start_y[1] == pos0_0[1] )or
|
||||||
|
( abstand_fuer_kreis_start_y[0] == pos0_1[0] and abstand_fuer_kreis_start_y[1] == pos0_1[1]) or
|
||||||
|
( abstand_gegen_kreis_start_y[0] == pos0_0[0] and abstand_gegen_kreis_start_y[1] == pos0_0[1]) or
|
||||||
|
( abstand_gegen_kreis_start_y[0] == pos0_1[0] and abstand_gegen_kreis_start_y[1] == pos0_1[1]) or
|
||||||
|
(abstand_fuer_kreis_ende_y[0] == pos0_0[0] and abstand_fuer_kreis_ende_y[1] == pos0_0[1] )or
|
||||||
|
( abstand_fuer_kreis_ende_y[0] == pos0_1[0] and abstand_fuer_kreis_ende_y[1] == pos0_1[1]) or
|
||||||
|
( abstand_gegen_kreis_ende_y[0] == pos0_0[0] and abstand_gegen_kreis_ende_y[1] == pos0_0[1]) or
|
||||||
|
( abstand_gegen_kreis_ende_y[0] == pos0_1[0] and abstand_gegen_kreis_ende_y[1] == pos0_1[1])
|
||||||
):
|
):
|
||||||
kreisel_verbunden = kreisel_verbunden +1
|
kreisel_verbunden = kreisel_verbunden +1
|
||||||
|
am_kreisel = 1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if ( abstand_gegen_kreis_start[0] == pos1_0[0] or abstand_gegen_kreis_start[0] == pos1_1[0] or
|
if( (abstand_fuer_kreis_start_x[0] == pos1_0[0] and abstand_fuer_kreis_start_x[1] == pos1_0[1] )or
|
||||||
abstand_gegen_kreis_start[1] == pos1_0[1] or abstand_gegen_kreis_start[1] == pos1_1[1]or
|
( abstand_fuer_kreis_start_x[0] == pos1_1[0] and abstand_fuer_kreis_start_x[1] == pos1_1[1]) or
|
||||||
abstand_fuer_kreis_ende[0] == pos1_0[0] or abstand_fuer_kreis_ende[0] == pos1_1[0] or
|
( abstand_gegen_kreis_start_x[0] == pos1_0[0] and abstand_gegen_kreis_start_x[1] == pos1_0[1]) or
|
||||||
abstand_fuer_kreis_ende[1] == pos1_0[1] or abstand_fuer_kreis_ende[1] == pos1_1[1]
|
( abstand_gegen_kreis_start_x[0] == pos1_1[0] and abstand_gegen_kreis_start_x[1] == pos1_1[1]) or
|
||||||
|
(abstand_fuer_kreis_ende_x[0] == pos1_0[0] and abstand_fuer_kreis_ende_x[1] == pos1_0[1] )or
|
||||||
|
( abstand_fuer_kreis_ende_x[0] == pos1_1[0] and abstand_fuer_kreis_ende_x[1] == pos1_1[1]) or
|
||||||
|
( abstand_gegen_kreis_ende_x[0] == pos1_0[0] and abstand_gegen_kreis_ende_x[1] == pos1_0[1]) or
|
||||||
|
( abstand_gegen_kreis_ende_x[0] == pos1_1[0] and abstand_gegen_kreis_ende_x[1] == pos1_1[1]) or
|
||||||
|
|
||||||
|
(abstand_fuer_kreis_start_y[0] == pos1_0[0] and abstand_fuer_kreis_start_y[1] == pos1_0[1] )or
|
||||||
|
( abstand_fuer_kreis_start_y[0] == pos1_1[0] and abstand_fuer_kreis_start_y[1] == pos1_1[1]) or
|
||||||
|
( abstand_gegen_kreis_start_y[0] == pos1_0[0] and abstand_gegen_kreis_start_y[1] == pos1_0[1]) or
|
||||||
|
( abstand_gegen_kreis_start_y[0] == pos1_1[0] and abstand_gegen_kreis_start_y[1] == pos1_1[1]) or
|
||||||
|
(abstand_fuer_kreis_ende_y[0] == pos1_0[0] and abstand_fuer_kreis_ende_y[1] == pos1_0[1] )or
|
||||||
|
( abstand_fuer_kreis_ende_y[0] == pos1_1[0] and abstand_fuer_kreis_ende_y[1] == pos1_1[1]) or
|
||||||
|
( abstand_gegen_kreis_ende_y[0] == pos1_0[0] and abstand_gegen_kreis_ende_y[1] == pos1_0[1]) or
|
||||||
|
( abstand_gegen_kreis_ende_y[0] == pos1_1[0] and abstand_gegen_kreis_ende_y[1] == pos1_1[1])
|
||||||
):
|
):
|
||||||
kreisel_verbunden = kreisel_verbunden +1
|
kreisel_verbunden = kreisel_verbunden +1
|
||||||
|
am_kreisel = 2
|
||||||
|
|
||||||
|
|
||||||
if kreisel_verbunden == 2:
|
if kreisel_verbunden == 2:
|
||||||
msp.add_line(start,ende)
|
msp.add_line(start,ende)
|
||||||
@@ -377,17 +410,18 @@ def handle_ils_2_0_gefaellestrecke(msp, teileid, merkmale, x, y, doc, lib_doc, v
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (richtung0 != richtung1):
|
if (richtung0 != richtung1 and kreisel_verbunden ==1):
|
||||||
if x-RADIUS == x0_kreisel or x+RADIUS == x0_kreisel or x-RADIUS == x1_kreisel or x+ RADIUS == x1_kreisel:
|
if x-RADIUS == x0_kreisel or x+RADIUS == x0_kreisel or x-RADIUS == x1_kreisel or x+ RADIUS == x1_kreisel:
|
||||||
richtung0= "Horinzontal"
|
richtung2= "Horinzontal"
|
||||||
else:
|
else:
|
||||||
richtung1 = "Vertikal"
|
richtung2 = "Vertikal"
|
||||||
unterschiedlich = True
|
unterschiedlich = True
|
||||||
#Berechnung des Gefälles
|
#Berechnung des Gefälles
|
||||||
if hoehe0 > hoehe1:
|
if hoehe0 > hoehe1:
|
||||||
hight_position = "higher"
|
hight_position = "higher"
|
||||||
else:
|
else:
|
||||||
hight_position = "lower"
|
hight_position = "lower"
|
||||||
|
if richtung2 == "DEFAULT":
|
||||||
if richtung0 == "Vertikal":
|
if richtung0 == "Vertikal":
|
||||||
if x0_kreisel < x1_kreisel:
|
if x0_kreisel < x1_kreisel:
|
||||||
position = hight_position + "_links"
|
position = hight_position + "_links"
|
||||||
@@ -410,9 +444,44 @@ def handle_ils_2_0_gefaellestrecke(msp, teileid, merkmale, x, y, doc, lib_doc, v
|
|||||||
else:
|
else:
|
||||||
gefaelle = "unten"
|
gefaelle = "unten"
|
||||||
|
|
||||||
#Wechsel das die Drehung des obersten oder des Linkens Kreisels immer als erstes steht für die Bennenung des Blockes und dem entsprchend
|
|
||||||
#wird auch getauscht in welcher hohen position es ist
|
|
||||||
if (position == "higher_rechts" or position == "lower_rechts" or position=="higher_lower" or position== "lower_lower") and drehung0 != drehung1:
|
if (position == "higher_rechts" or position == "lower_rechts" or position=="higher_lower" or position== "lower_lower") and drehung0 != drehung1:
|
||||||
|
|
||||||
|
drehung_2 = drehung0
|
||||||
|
drehung0 = drehung1
|
||||||
|
drehung1= drehung_2
|
||||||
|
if hight_position == "higher":
|
||||||
|
hight_position = "lower"
|
||||||
|
else:
|
||||||
|
hight_position = "higher"
|
||||||
|
|
||||||
|
else:
|
||||||
|
if richtung2 == "Vertikal":
|
||||||
|
if x0_kreisel < x1_kreisel:
|
||||||
|
position = hight_position + "_links"
|
||||||
|
else:
|
||||||
|
position = hight_position + "_rechts"
|
||||||
|
else:
|
||||||
|
if y0_kreisel > y1_kreisel:
|
||||||
|
position = hight_position + "_higher"
|
||||||
|
else:
|
||||||
|
position = hight_position + "_lower"
|
||||||
|
|
||||||
|
if richtung2 == "Vertikal":
|
||||||
|
if position == "lower_rechts" or position == "higher_links":
|
||||||
|
gefaelle = "links"
|
||||||
|
else:
|
||||||
|
gefaelle = "rechts"
|
||||||
|
elif richtung2 == "Horinzontal":
|
||||||
|
if position == "lower_lower" or position == "higher_higher":
|
||||||
|
gefaelle = "oben"
|
||||||
|
else:
|
||||||
|
gefaelle = "unten"
|
||||||
|
|
||||||
|
if am_kreisel == 2:
|
||||||
|
if am_kreisel == 1:
|
||||||
|
am_kreisel =2
|
||||||
|
elif am_kreisel ==2:
|
||||||
|
am_kreisel = 1
|
||||||
drehung_2 = drehung0
|
drehung_2 = drehung0
|
||||||
drehung0 = drehung1
|
drehung0 = drehung1
|
||||||
drehung1= drehung_2
|
drehung1= drehung_2
|
||||||
@@ -422,7 +491,7 @@ def handle_ils_2_0_gefaellestrecke(msp, teileid, merkmale, x, y, doc, lib_doc, v
|
|||||||
hight_position = "higher"
|
hight_position = "higher"
|
||||||
|
|
||||||
#
|
#
|
||||||
blockname = f"Ils_2.0_Gefaellestrecke_{laenge}_{hoehe_gefaehlle}_{drehung0}_{drehung1}_{hight_position}"
|
blockname = f"Ils_2.0_Gefaellestrecke_{laenge}_{hoehe_gefaehlle}_{drehung0}_{drehung1}_{hight_position}_{unterschiedlich}_{teileid}"
|
||||||
if gefaelle == "oben":
|
if gefaelle == "oben":
|
||||||
rotation = 0
|
rotation = 0
|
||||||
elif gefaelle == "unten" :
|
elif gefaelle == "unten" :
|
||||||
@@ -431,7 +500,7 @@ def handle_ils_2_0_gefaellestrecke(msp, teileid, merkmale, x, y, doc, lib_doc, v
|
|||||||
rotation = 90
|
rotation = 90
|
||||||
elif gefaelle == "rechts" :
|
elif gefaelle == "rechts" :
|
||||||
rotation = 270
|
rotation = 270
|
||||||
gefaellegerade_erstellung(x, y, doc, lib_doc, asoffset, esoffset, upper_hoehe_gefaehlle, lower_hoehe_gefaehlle, hoehe_gefaehlle, drehung0, drehung1, laenge, hight_position, blockname)
|
gefaellegerade_erstellung(x, y, doc, lib_doc, asoffset, esoffset, upper_hoehe_gefaehlle, lower_hoehe_gefaehlle, hoehe_gefaehlle,richtung0,richtung1,richtung2, am_kreisel,drehung0, drehung1, laenge, hight_position, blockname)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@@ -445,7 +514,153 @@ def handle_ils_2_0_gefaellestrecke(msp, teileid, merkmale, x, y, doc, lib_doc, v
|
|||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def gefaellegerade_erstellung(x, y, doc, lib_doc, asoffset, esoffset, upper_hoehe_gefaehlle, lower_hoehe_gefaehlle, hoehe_gefaehlle, drehung0, drehung1, laenge, hight_position, blockname):
|
def gefaellegerade_erstellung(x, y, doc, lib_doc, asoffset, esoffset, upper_hoehe_gefaehlle, lower_hoehe_gefaehlle, hoehe_gefaehlle,richtung0,richtun1,richtung2,am_kreisel, drehung0, drehung1, laenge, hight_position, blockname):
|
||||||
|
if richtung2!= "DEFAULT":
|
||||||
|
if blockname not in doc.blocks and drehung0 == "GUZS" and drehung1 == "GUZS" and hight_position == "higher" :
|
||||||
|
|
||||||
|
block = doc.blocks.new(name=blockname, base_point=(0,0,0))
|
||||||
|
halbe_laenge = laenge / 2
|
||||||
|
|
||||||
|
dy = halbe_laenge * math.cos(0)
|
||||||
|
start = (x , y + dy,upper_hoehe_gefaehlle)
|
||||||
|
ende = (x , y - dy + esoffset,lower_hoehe_gefaehlle)
|
||||||
|
line = Line.new(dxfattribs={"start": start, "end": ende})
|
||||||
|
copy= line.copy()
|
||||||
|
|
||||||
|
copy.translate(-x,-y,-hoehe_gefaehlle)
|
||||||
|
block.add_entity(copy)
|
||||||
|
block_es = "200000146_ES-Element_90_rechts"
|
||||||
|
import_block(block_es,lib_doc,doc)
|
||||||
|
|
||||||
|
block.add_blockref(block_es, (ende[0]-x ,ende[1]-esoffset-y ,ende[2] -hoehe_gefaehlle))
|
||||||
|
elif blockname not in doc.blocks and drehung0 == "GUZS" and drehung1 == "GUZS":
|
||||||
|
block = doc.blocks.new(name=blockname, base_point=(0,0,0))
|
||||||
|
halbe_laenge = laenge / 2
|
||||||
|
|
||||||
|
dy = halbe_laenge * math.cos(0)
|
||||||
|
start = (x , y + dy - asoffset,upper_hoehe_gefaehlle)
|
||||||
|
ende = (x , y - dy ,lower_hoehe_gefaehlle)
|
||||||
|
line = Line.new(dxfattribs={"start": start, "end": ende})
|
||||||
|
copy= line.copy()
|
||||||
|
|
||||||
|
copy.translate(-x,-y,-hoehe_gefaehlle)
|
||||||
|
block.add_entity(copy)
|
||||||
|
block_as = "200000241_AS-Element_90_rechts"
|
||||||
|
import_block(block_as,lib_doc,doc)
|
||||||
|
|
||||||
|
block.add_blockref(block_as,(start[0]-x ,start[1]+asoffset -y,start[2] -hoehe_gefaehlle))
|
||||||
|
elif blockname not in doc.blocks and ((drehung0 == "GUZS" and drehung1 == "UZS" and hight_position == "higher")):
|
||||||
|
block = doc.blocks.new(name=blockname, base_point=(0,0,0))
|
||||||
|
halbe_laenge = laenge / 2
|
||||||
|
|
||||||
|
dy = halbe_laenge * math.cos(0)
|
||||||
|
start = (x , y + dy ,upper_hoehe_gefaehlle)
|
||||||
|
ende = (x , y - dy + esoffset,lower_hoehe_gefaehlle)
|
||||||
|
line = Line.new(dxfattribs={"start": start, "end": ende})
|
||||||
|
copy= line.copy()
|
||||||
|
|
||||||
|
copy.translate(-x,-y,-hoehe_gefaehlle)
|
||||||
|
block.add_entity(copy)
|
||||||
|
|
||||||
|
block_es = "400102632_ES-Element_90_links"
|
||||||
|
import_block(block_es,lib_doc,doc)
|
||||||
|
block.add_blockref(block_as,(start[0]-x ,start[1]+asoffset -y,start[2]))
|
||||||
|
elif blockname not in doc.blocks and (drehung0 == "UZS" and drehung1 == "GUZS" and hight_position == "lower"):
|
||||||
|
block = doc.blocks.new(name=blockname, base_point=(0,0,0))
|
||||||
|
halbe_laenge = laenge / 2
|
||||||
|
|
||||||
|
dy = halbe_laenge * math.cos(0)
|
||||||
|
start = (x , y + dy - asoffset,upper_hoehe_gefaehlle)
|
||||||
|
ende = (x , y - dy + esoffset,lower_hoehe_gefaehlle)
|
||||||
|
line = Line.new(dxfattribs={"start": start, "end": ende})
|
||||||
|
copy= line.copy()
|
||||||
|
|
||||||
|
copy.translate(-x,-y,-hoehe_gefaehlle)
|
||||||
|
block.add_entity(copy)
|
||||||
|
block_as = "200000241_AS-Element_90_rechts"
|
||||||
|
|
||||||
|
import_block(block_es,lib_doc,doc)
|
||||||
|
block.add_blockref(block_as,(start[0]-x ,start[1]+asoffset -y,start[2]))
|
||||||
|
elif blockname not in doc.blocks and drehung0 == "UZS" and drehung1 == "UZS" and hight_position == "higher":
|
||||||
|
block = doc.blocks.new(name=blockname, base_point=(0,0,0))
|
||||||
|
halbe_laenge = laenge / 2
|
||||||
|
|
||||||
|
dy = halbe_laenge * math.cos(0)
|
||||||
|
start = (x , y + dy - asoffset,upper_hoehe_gefaehlle)
|
||||||
|
ende = (x , y - dy + esoffset,lower_hoehe_gefaehlle)
|
||||||
|
line = Line.new(dxfattribs={"start": start, "end": ende})
|
||||||
|
copy= line.copy()
|
||||||
|
|
||||||
|
copy.translate(-x ,-y,-hoehe_gefaehlle)
|
||||||
|
block.add_entity(copy)
|
||||||
|
|
||||||
|
block_es = "400102632_ES-Element_90_links"
|
||||||
|
import_block(block_es,lib_doc,doc)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
block.add_blockref(block_es, (ende[0]-x ,ende[1]-esoffset -y,ende[2]),dxfattribs={"rotation": 180})
|
||||||
|
|
||||||
|
elif blockname not in doc.blocks and drehung0 == "UZS" and drehung1 == "UZS":
|
||||||
|
block = doc.blocks.new(name=blockname, base_point=(0,0,0))
|
||||||
|
halbe_laenge = laenge / 2
|
||||||
|
|
||||||
|
dy = halbe_laenge * math.cos(0)
|
||||||
|
start = (x , y + dy - asoffset,upper_hoehe_gefaehlle)
|
||||||
|
ende = (x , y - dy + esoffset,lower_hoehe_gefaehlle)
|
||||||
|
line = Line.new(dxfattribs={"start": start, "end": ende})
|
||||||
|
copy= line.copy()
|
||||||
|
|
||||||
|
copy.translate(-x ,-y,-hoehe_gefaehlle)
|
||||||
|
block.add_entity(copy)
|
||||||
|
block_as = "200000217_AS-Element_90_links"
|
||||||
|
import_block(block_as,lib_doc,doc)
|
||||||
|
block.add_blockref(block_as,(start[0]-x ,start[1]+asoffset -y,start[2]),dxfattribs={"rotation": 180})
|
||||||
|
elif blockname not in doc.blocks and ((drehung0 == "UZS" and drehung1 == "GUZS" and hight_position== "higher")):
|
||||||
|
block = doc.blocks.new(name=blockname, base_point=(0,0,0))
|
||||||
|
halbe_laenge = laenge / 2
|
||||||
|
|
||||||
|
dy = halbe_laenge * math.cos(0)
|
||||||
|
start = (x , y + dy - asoffset,upper_hoehe_gefaehlle)
|
||||||
|
ende = (x , y - dy + esoffset,lower_hoehe_gefaehlle)
|
||||||
|
line = Line.new(dxfattribs={"start": start, "end": ende})
|
||||||
|
copy= line.copy()
|
||||||
|
|
||||||
|
copy.translate(-x ,-y,-hoehe_gefaehlle)
|
||||||
|
block.add_entity(copy)
|
||||||
|
|
||||||
|
block_es = "200000146_ES-Element_90_rechts"
|
||||||
|
import_block(block_es,lib_doc,doc)
|
||||||
|
|
||||||
|
block.add_blockref(block_es, (ende[0]-x ,ende[1]-esoffset -y,ende[2]))
|
||||||
|
elif blockname not in doc.blocks and (drehung0 == "GUZS" and drehung1 == "UZS" and hight_position == "lower"):
|
||||||
|
block = doc.blocks.new(name=blockname, base_point=(0,0,0))
|
||||||
|
halbe_laenge = laenge / 2
|
||||||
|
|
||||||
|
dy = halbe_laenge * math.cos(0)
|
||||||
|
start = (x , y + dy - asoffset,upper_hoehe_gefaehlle)
|
||||||
|
ende = (x , y - dy + esoffset,lower_hoehe_gefaehlle)
|
||||||
|
line = Line.new(dxfattribs={"start": start, "end": ende})
|
||||||
|
copy= line.copy()
|
||||||
|
|
||||||
|
copy.translate(-x ,-y,-hoehe_gefaehlle)
|
||||||
|
block.add_entity(copy)
|
||||||
|
block_as = "200000217_AS-Element_90_links"
|
||||||
|
import_block(block_as,lib_doc,doc)
|
||||||
|
|
||||||
|
block.add_blockref(block_as,(start[0]-x ,start[1]+asoffset -y,start[2]),dxfattribs={"rotation": 180})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
else:
|
||||||
if blockname not in doc.blocks and drehung0 == "GUZS" and drehung1 == "GUZS" :
|
if blockname not in doc.blocks and drehung0 == "GUZS" and drehung1 == "GUZS" :
|
||||||
block = doc.blocks.new(name=blockname, base_point=(0,0,0))
|
block = doc.blocks.new(name=blockname, base_point=(0,0,0))
|
||||||
halbe_laenge = laenge / 2
|
halbe_laenge = laenge / 2
|
||||||
@@ -465,7 +680,7 @@ def gefaellegerade_erstellung(x, y, doc, lib_doc, asoffset, esoffset, upper_hoeh
|
|||||||
block.add_blockref(block_as,(start[0]-x ,start[1]+asoffset -y,start[2] -hoehe_gefaehlle))
|
block.add_blockref(block_as,(start[0]-x ,start[1]+asoffset -y,start[2] -hoehe_gefaehlle))
|
||||||
block.add_blockref(block_es, (ende[0]-x ,ende[1]-esoffset-y ,ende[2] -hoehe_gefaehlle))
|
block.add_blockref(block_es, (ende[0]-x ,ende[1]-esoffset-y ,ende[2] -hoehe_gefaehlle))
|
||||||
|
|
||||||
if blockname not in doc.blocks and ((drehung0 == "GUZS" and drehung1 == "UZS" and hight_position == "higher")or (drehung0 == "UZS" and drehung1 == "GUZS" and hight_position == "lower")):
|
elif blockname not in doc.blocks and ((drehung0 == "GUZS" and drehung1 == "UZS" and hight_position == "higher")or (drehung0 == "UZS" and drehung1 == "GUZS" and hight_position == "lower")):
|
||||||
block = doc.blocks.new(name=blockname, base_point=(0,0,0))
|
block = doc.blocks.new(name=blockname, base_point=(0,0,0))
|
||||||
halbe_laenge = laenge / 2
|
halbe_laenge = laenge / 2
|
||||||
|
|
||||||
@@ -485,7 +700,7 @@ def gefaellegerade_erstellung(x, y, doc, lib_doc, asoffset, esoffset, upper_hoeh
|
|||||||
block.add_blockref(block_es, (ende[0]-x ,ende[1]- esoffset-y,ende[2]),dxfattribs={"rotation": 180})
|
block.add_blockref(block_es, (ende[0]-x ,ende[1]- esoffset-y,ende[2]),dxfattribs={"rotation": 180})
|
||||||
|
|
||||||
|
|
||||||
if blockname not in doc.blocks and drehung0 == "UZS" and drehung1 == "UZS":
|
elif blockname not in doc.blocks and drehung0 == "UZS" and drehung1 == "UZS":
|
||||||
block = doc.blocks.new(name=blockname, base_point=(0,0,0))
|
block = doc.blocks.new(name=blockname, base_point=(0,0,0))
|
||||||
halbe_laenge = laenge / 2
|
halbe_laenge = laenge / 2
|
||||||
|
|
||||||
@@ -507,7 +722,7 @@ def gefaellegerade_erstellung(x, y, doc, lib_doc, asoffset, esoffset, upper_hoeh
|
|||||||
block.add_blockref(block_es, (ende[0]-x ,ende[1]-esoffset -y,ende[2]),dxfattribs={"rotation": 180})
|
block.add_blockref(block_es, (ende[0]-x ,ende[1]-esoffset -y,ende[2]),dxfattribs={"rotation": 180})
|
||||||
|
|
||||||
|
|
||||||
if blockname not in doc.blocks and ((drehung0 == "UZS" and drehung1 == "GUZS" and hight_position== "higher")or (drehung0 == "GUZS" and drehung1 == "UZS" and hight_position == "lower")):
|
elif blockname not in doc.blocks and ((drehung0 == "UZS" and drehung1 == "GUZS" and hight_position== "higher")or (drehung0 == "GUZS" and drehung1 == "UZS" and hight_position == "lower")):
|
||||||
block = doc.blocks.new(name=blockname, base_point=(0,0,0))
|
block = doc.blocks.new(name=blockname, base_point=(0,0,0))
|
||||||
halbe_laenge = laenge / 2
|
halbe_laenge = laenge / 2
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user