changes to the layer system
This commit is contained in:
@@ -136,8 +136,8 @@ class VarioFoerderer(BaseModel):
|
|||||||
block_Vario_Motorstation_500mm = "Vario_Motorstation_500mm"
|
block_Vario_Motorstation_500mm = "Vario_Motorstation_500mm"
|
||||||
plant2dxf.import_block(block_Vario_Motorstation_500mm, lib_doc, doc)
|
plant2dxf.import_block(block_Vario_Motorstation_500mm, lib_doc, doc)
|
||||||
plant2dxf.import_block(block_Vario_Umlenkstation_500mm , lib_doc, doc)
|
plant2dxf.import_block(block_Vario_Umlenkstation_500mm , lib_doc, doc)
|
||||||
block_Vario_Motorstation_500mm = plant2dxf.dreh_block(block_Vario_Motorstation_500mm,doc,math.radians(winkel_motor))
|
block_Vario_Motorstation_500mm = plant2dxf.dreh_block(block_Vario_Motorstation_500mm,doc,lib_doc,math.radians(winkel_motor))
|
||||||
block_Vario_Umlenkstation_500mm = plant2dxf.dreh_block( block_Vario_Umlenkstation_500mm, doc,math.radians(winkel_umlenk))
|
block_Vario_Umlenkstation_500mm = plant2dxf.dreh_block( block_Vario_Umlenkstation_500mm, doc,lib_doc,math.radians(winkel_umlenk))
|
||||||
if umlenk_vorhanden == True:
|
if umlenk_vorhanden == True:
|
||||||
block.add_blockref(block_Vario_Umlenkstation_500mm,(ende[0] -x,ende[1] -y + umlenk_offset_x/2,ende[2] - hoehe_vario -umlenk_offset_z/2 ),dxfattribs={"rotation": 90})
|
block.add_blockref(block_Vario_Umlenkstation_500mm,(ende[0] -x,ende[1] -y + umlenk_offset_x/2,ende[2] - hoehe_vario -umlenk_offset_z/2 ),dxfattribs={"rotation": 90})
|
||||||
ende = (ende[0] ,ende[1] + umlenk_offset_x,ende[2] - umlenk_offset_z)
|
ende = (ende[0] ,ende[1] + umlenk_offset_x,ende[2] - umlenk_offset_z)
|
||||||
@@ -154,8 +154,8 @@ class VarioFoerderer(BaseModel):
|
|||||||
|
|
||||||
auf_attrib =plant2dxf.import_block(block_Vario_Bogen_auf, lib_doc, doc)
|
auf_attrib =plant2dxf.import_block(block_Vario_Bogen_auf, lib_doc, doc)
|
||||||
ab_attrib =plant2dxf.import_block(block_Vario_Bogen_ab, lib_doc, doc)
|
ab_attrib =plant2dxf.import_block(block_Vario_Bogen_ab, lib_doc, doc)
|
||||||
block_Vario_Bogen_auf = plant2dxf.dreh_block(block_Vario_Bogen_auf, doc,math.radians(winkel_core))
|
block_Vario_Bogen_auf = plant2dxf.dreh_block(block_Vario_Bogen_auf, doc,lib_doc,math.radians(winkel_core))
|
||||||
block_Vario_Bogen_ab = plant2dxf.dreh_block(block_Vario_Bogen_ab, doc,math.radians(-winkel))
|
block_Vario_Bogen_ab = plant2dxf.dreh_block(block_Vario_Bogen_ab, doc,lib_doc,math.radians(-winkel))
|
||||||
|
|
||||||
Vario_Bogen_auf_Delta_SP_0 = list(float(att)for att in re.split(r"[;,]", auf_attrib["DELTA_SP_0"]))
|
Vario_Bogen_auf_Delta_SP_0 = list(float(att)for att in re.split(r"[;,]", auf_attrib["DELTA_SP_0"]))
|
||||||
Vario_Bogen_auf_Delta_SP_1 = list(float(att) for att in re.split(r"[;,]", auf_attrib["DELTA_SP_1"]))
|
Vario_Bogen_auf_Delta_SP_1 = list(float(att) for att in re.split(r"[;,]", auf_attrib["DELTA_SP_1"]))
|
||||||
@@ -224,8 +224,8 @@ class VarioFoerderer(BaseModel):
|
|||||||
block_Vario_Bogen_ab_3 = str(config.get("ILS 2.0 Variofoerderer_Bogen_block_namen","bogen_3_ab"))
|
block_Vario_Bogen_ab_3 = str(config.get("ILS 2.0 Variofoerderer_Bogen_block_namen","bogen_3_ab"))
|
||||||
auf_3_attrib =plant2dxf.import_block(block_Vario_Bogen_auf_3, lib_doc, doc)
|
auf_3_attrib =plant2dxf.import_block(block_Vario_Bogen_auf_3, lib_doc, doc)
|
||||||
ab_3_attrib = plant2dxf.import_block(block_Vario_Bogen_ab_3, lib_doc, doc)
|
ab_3_attrib = plant2dxf.import_block(block_Vario_Bogen_ab_3, lib_doc, doc)
|
||||||
block_Vario_Bogen_auf_3= plant2dxf.dreh_block(block_Vario_Bogen_auf_3, doc,math.radians(3))
|
block_Vario_Bogen_auf_3= plant2dxf.dreh_block(block_Vario_Bogen_auf_3, doc,lib_doc,math.radians(3))
|
||||||
block_Vario_Bogen_ab_3 = plant2dxf.dreh_block(block_Vario_Bogen_ab_3, doc,math.radians(0))
|
block_Vario_Bogen_ab_3 = plant2dxf.dreh_block(block_Vario_Bogen_ab_3, doc,lib_doc,math.radians(0))
|
||||||
Vario_Bogen_auf_3_Delta_SP_0 = list(float(att)for att in re.split(r"[;,]", auf_3_attrib["DELTA_SP_0"]))
|
Vario_Bogen_auf_3_Delta_SP_0 = list(float(att)for att in re.split(r"[;,]", auf_3_attrib["DELTA_SP_0"]))
|
||||||
Vario_Bogen_auf_3_Delta_SP_1 = list(float(att) for att in re.split(r"[;,]", auf_3_attrib["DELTA_SP_1"]))
|
Vario_Bogen_auf_3_Delta_SP_1 = list(float(att) for att in re.split(r"[;,]", auf_3_attrib["DELTA_SP_1"]))
|
||||||
Vario_Bogen_ab_3_Delta_SP_0 = list(float(att) for att in re.split(r"[;,]", ab_3_attrib["DELTA_SP_0"]))
|
Vario_Bogen_ab_3_Delta_SP_0 = list(float(att) for att in re.split(r"[;,]", ab_3_attrib["DELTA_SP_0"]))
|
||||||
@@ -336,8 +336,8 @@ class VarioFoerderer(BaseModel):
|
|||||||
block_Vario_Motorstation_500mm = "Vario_Motorstation_500mm"
|
block_Vario_Motorstation_500mm = "Vario_Motorstation_500mm"
|
||||||
plant2dxf.import_block( block_Vario_Motorstation_500mm, lib_doc, doc)
|
plant2dxf.import_block( block_Vario_Motorstation_500mm, lib_doc, doc)
|
||||||
plant2dxf.import_block( block_Vario_Umlenkstation_500mm , lib_doc, doc)
|
plant2dxf.import_block( block_Vario_Umlenkstation_500mm , lib_doc, doc)
|
||||||
block_Vario_Motorstation_500mm = plant2dxf.dreh_block( block_Vario_Motorstation_500mm, doc,math.radians(winkel_motor))
|
block_Vario_Motorstation_500mm = plant2dxf.dreh_block( block_Vario_Motorstation_500mm, doc,lib_doc,math.radians(winkel_motor))
|
||||||
block_Vario_Umlenkstation_500mm = plant2dxf.dreh_block( block_Vario_Umlenkstation_500mm , doc,math.radians(winkel_umlenk))
|
block_Vario_Umlenkstation_500mm = plant2dxf.dreh_block( block_Vario_Umlenkstation_500mm , doc,lib_doc,math.radians(winkel_umlenk))
|
||||||
if umlenk_vorhanden == True:
|
if umlenk_vorhanden == True:
|
||||||
block.add_blockref(block_Vario_Umlenkstation_500mm,(start[0] -x,start[1] -y - umlenk_offset_x/2, start[2] - hoehe_vario -umlenk_offset_z/2 ),dxfattribs={"rotation": 270})
|
block.add_blockref(block_Vario_Umlenkstation_500mm,(start[0] -x,start[1] -y - umlenk_offset_x/2, start[2] - hoehe_vario -umlenk_offset_z/2 ),dxfattribs={"rotation": 270})
|
||||||
start_Umlenkstation_VP = start[0] - vario_abstand, start[1] -500 *math.cos(math.radians(-winkel_umlenk))+ math.sin(math.radians(-winkel_umlenk))* -45,start[2] + math.sin(math.radians(-winkel_umlenk))*500+ math.cos(math.radians(-winkel_umlenk))*-45
|
start_Umlenkstation_VP = start[0] - vario_abstand, start[1] -500 *math.cos(math.radians(-winkel_umlenk))+ math.sin(math.radians(-winkel_umlenk))* -45,start[2] + math.sin(math.radians(-winkel_umlenk))*500+ math.cos(math.radians(-winkel_umlenk))*-45
|
||||||
@@ -359,8 +359,8 @@ class VarioFoerderer(BaseModel):
|
|||||||
block_Vario_Bogen_ab = (f"Vario_Bogen_ab_{winkel_minus}°")
|
block_Vario_Bogen_ab = (f"Vario_Bogen_ab_{winkel_minus}°")
|
||||||
ab_attrib =plant2dxf.import_block( block_Vario_Bogen_ab , lib_doc, doc)
|
ab_attrib =plant2dxf.import_block( block_Vario_Bogen_ab , lib_doc, doc)
|
||||||
auf_attrib =plant2dxf.import_block( block_Vario_Bogen_auf, lib_doc, doc)
|
auf_attrib =plant2dxf.import_block( block_Vario_Bogen_auf, lib_doc, doc)
|
||||||
block_Vario_Bogen_ab = plant2dxf.dreh_block( block_Vario_Bogen_ab, doc, math.radians(winkel_core))
|
block_Vario_Bogen_ab = plant2dxf.dreh_block( block_Vario_Bogen_ab, doc,lib_doc, math.radians(winkel_core))
|
||||||
block_Vario_Bogen_auf= plant2dxf.dreh_block( block_Vario_Bogen_auf, doc, math.radians(winkel))
|
block_Vario_Bogen_auf= plant2dxf.dreh_block( block_Vario_Bogen_auf, doc,lib_doc, math.radians(winkel))
|
||||||
Vario_Bogen_auf_Delta_SP_0 = list(float(att)for att in re.split(r"[;,]", auf_attrib["DELTA_SP_0"]))
|
Vario_Bogen_auf_Delta_SP_0 = list(float(att)for att in re.split(r"[;,]", auf_attrib["DELTA_SP_0"]))
|
||||||
Vario_Bogen_auf_Delta_SP_1 = list(float(att) for att in re.split(r"[;,]", auf_attrib["DELTA_SP_1"]))
|
Vario_Bogen_auf_Delta_SP_1 = list(float(att) for att in re.split(r"[;,]", auf_attrib["DELTA_SP_1"]))
|
||||||
Vario_Bogen_ab_Delta_SP_0 = list(float(att) for att in re.split(r"[;,]", ab_attrib["DELTA_SP_0"]))
|
Vario_Bogen_ab_Delta_SP_0 = list(float(att) for att in re.split(r"[;,]", ab_attrib["DELTA_SP_0"]))
|
||||||
|
|||||||
+60
-55
@@ -20,33 +20,37 @@ def erstellung_gefaelle_block_verbunenden_am_einen(msp,x, y, doc, lib_doc, upper
|
|||||||
(vario_richtung == "Ab" and verbungden_höher == True and drehung0 == "GUZS")or (vario_richtung == "Horizontal" and drehung0 == "GUZS" and (mit_horizontal_verbunden == "unten_drehung_0_or_-90" or mit_horizontal_verbunden == "oben_drehung_-180_or_-270"))):
|
(vario_richtung == "Ab" and verbungden_höher == True and drehung0 == "GUZS")or (vario_richtung == "Horizontal" and drehung0 == "GUZS" and (mit_horizontal_verbunden == "unten_drehung_0_or_-90" or mit_horizontal_verbunden == "oben_drehung_-180_or_-270"))):
|
||||||
block_as = "200000241_AS-Element_90_rechts"
|
block_as = "200000241_AS-Element_90_rechts"
|
||||||
plant2dxf.import_block(block_as,lib_doc,doc)
|
plant2dxf.import_block(block_as,lib_doc,doc)
|
||||||
|
layer, color = plant2dxf.get_insert_color_layer(lib_doc, block_as)
|
||||||
|
|
||||||
elif ((hight == "lower" and drehung0 == "GUZS") or (vario_richtung == "Auf"and verbungden_höher == True and drehung0 == "GUZS") or
|
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"))):
|
(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"
|
block_es = "200000146_ES-Element_90_rechts"
|
||||||
plant2dxf.import_block(block_es,lib_doc,doc)
|
plant2dxf.import_block(block_es,lib_doc,doc)
|
||||||
|
layer, color = plant2dxf.get_insert_color_layer(lib_doc, block_es)
|
||||||
|
|
||||||
elif ((hight == "higher" and drehung0 == "UZS")or (vario_richtung == "Auf"and verbungden_höher == False and drehung0 == "UZS") or
|
elif ((hight == "higher" and drehung0 == "UZS")or (vario_richtung == "Auf"and verbungden_höher == False and drehung0 == "UZS") or
|
||||||
(vario_richtung == "Ab" and verbungden_höher == True and drehung0 == "UZS")or (vario_richtung == "Horizontal" and drehung0 == "UZS" and (mit_horizontal_verbunden == "unten_drehung_0_or_-90" or mit_horizontal_verbunden == "oben_drehung_-180_or_-270"))):
|
(vario_richtung == "Ab" and verbungden_höher == True and drehung0 == "UZS")or (vario_richtung == "Horizontal" and drehung0 == "UZS" and (mit_horizontal_verbunden == "unten_drehung_0_or_-90" or mit_horizontal_verbunden == "oben_drehung_-180_or_-270"))):
|
||||||
block_as = "200000217_AS-Element_90_links"
|
block_as = "200000217_AS-Element_90_links"
|
||||||
plant2dxf.import_block(block_as,lib_doc,doc)
|
plant2dxf.import_block(block_as,lib_doc,doc)
|
||||||
|
layer, color = plant2dxf.get_insert_color_layer(lib_doc, block_as)
|
||||||
|
|
||||||
elif (( hight == "lower" and drehung0 == "UZS") or (vario_richtung == "Auf" and verbungden_höher == True and drehung0 == "UZS") or
|
elif (( hight == "lower" and drehung0 == "UZS") or (vario_richtung == "Auf" and verbungden_höher == True and drehung0 == "UZS") or
|
||||||
(vario_richtung == "Ab" and verbungden_höher == False and drehung0 == "UZS")or (vario_richtung == "Horizontal" and drehung0 == "UZS" and (mit_horizontal_verbunden == "oben_drehung_0_or_-90" or mit_horizontal_verbunden == "unten_drehung_-180_or_-270"))):
|
(vario_richtung == "Ab" and verbungden_höher == False and drehung0 == "UZS")or (vario_richtung == "Horizontal" and drehung0 == "UZS" and (mit_horizontal_verbunden == "oben_drehung_0_or_-90" or mit_horizontal_verbunden == "unten_drehung_-180_or_-270"))):
|
||||||
block_es = "400102632_ES-Element_90_links"
|
block_es = "400102632_ES-Element_90_links"
|
||||||
plant2dxf.import_block(block_es,lib_doc,doc)
|
plant2dxf.import_block(block_es,lib_doc,doc)
|
||||||
|
layer, color = plant2dxf.get_insert_color_layer(lib_doc, block_es)
|
||||||
|
|
||||||
if block_as != None:
|
if block_as != None:
|
||||||
block_as = plant2dxf.dreh_block(block_as,doc,math.radians(winkel_as))
|
block_as = plant2dxf.dreh_block(block_as,doc,lib_doc,math.radians(winkel_as))
|
||||||
if vario_richtung == "Auf" or vario_richtung =="Horizontal":
|
if vario_richtung == "Auf" or vario_richtung =="Horizontal":
|
||||||
start = (x , y + dy ,upper_hoehe_gefaehlle)
|
start = (x , y + dy ,upper_hoehe_gefaehlle)
|
||||||
ende = (x , y - dy + asoffset_y ,lower_hoehe_gefaehlle - asoffset_z)
|
ende = (x , y - dy + asoffset_y ,lower_hoehe_gefaehlle - asoffset_z)
|
||||||
block_vario.add_blockref(block_as,(ende[0]-x ,ende[1]-asoffset_y -y,ende[2] -hoehe_gefaehlle + asoffset_z),dxfattribs={"rotation": 180})
|
block_vario.add_blockref(block_as,(ende[0]-x ,ende[1]-asoffset_y -y,ende[2] -hoehe_gefaehlle + asoffset_z),dxfattribs={"rotation": 180,"layer":layer,"color":color})
|
||||||
return start, ende
|
return start, ende
|
||||||
elif vario_richtung == "Ab":
|
elif vario_richtung == "Ab":
|
||||||
start = (x , y + dy - asoffset_y,upper_hoehe_gefaehlle - asoffset_z)
|
start = (x , y + dy - asoffset_y,upper_hoehe_gefaehlle - asoffset_z)
|
||||||
ende = (x , y - dy ,lower_hoehe_gefaehlle)
|
ende = (x , y - dy ,lower_hoehe_gefaehlle)
|
||||||
block_vario.add_blockref(block_as,(start[0]-x ,start[1]+asoffset_y -y,start[2] -hoehe_gefaehlle + asoffset_z))
|
block_vario.add_blockref(block_as,(start[0]-x ,start[1]+asoffset_y -y,start[2] -hoehe_gefaehlle + asoffset_z),dxfattribs={"layer":layer,"color":color})
|
||||||
return start,ende
|
return start,ende
|
||||||
|
|
||||||
if laenge > asoffset:
|
if laenge > asoffset:
|
||||||
@@ -57,22 +61,22 @@ def erstellung_gefaelle_block_verbunenden_am_einen(msp,x, y, doc, lib_doc, upper
|
|||||||
copy= line.copy()
|
copy= line.copy()
|
||||||
copy.translate(-x,-y,-hoehe_gefaehlle)
|
copy.translate(-x,-y,-hoehe_gefaehlle)
|
||||||
gefaelle_block.add_entity(copy)
|
gefaelle_block.add_entity(copy)
|
||||||
gefaelle_block.add_blockref(block_as,(start[0]-x ,start[1]+asoffset_y -y,start[2] -hoehe_gefaehlle + asoffset_z))
|
gefaelle_block.add_blockref(block_as,(start[0]-x ,start[1]+asoffset_y -y,start[2] -hoehe_gefaehlle + asoffset_z),dxfattribs={"layer":layer,"color":color})
|
||||||
return False
|
return False
|
||||||
else:
|
else:
|
||||||
msp.add_blockref(block_as,(x,y,upper_hoehe_gefaehlle))
|
msp.add_blockref(block_as,(x,y,upper_hoehe_gefaehlle),dxfattribs={"layer":layer,"color":color})
|
||||||
return True
|
return True
|
||||||
elif block_es != None:
|
elif block_es != None:
|
||||||
block_es = plant2dxf.dreh_block(block_es,doc,math.radians(winkel_es))
|
block_es = plant2dxf.dreh_block(block_es,doc,lib_doc,math.radians(winkel_es))
|
||||||
if vario_richtung == "Auf" or vario_richtung =="Horizontal":
|
if vario_richtung == "Auf" or vario_richtung =="Horizontal":
|
||||||
start = (x , y + dy-esoffset_y ,upper_hoehe_gefaehlle + esoffset_z)
|
start = (x , y + dy-esoffset_y ,upper_hoehe_gefaehlle + esoffset_z)
|
||||||
ende = (x , y - dy,lower_hoehe_gefaehlle)
|
ende = (x , y - dy,lower_hoehe_gefaehlle)
|
||||||
block_vario.add_blockref(block_es, (start[0]-x ,start[1]+esoffset_y -y,start[2] - hoehe_gefaehlle - esoffset_z),dxfattribs={"rotation": 180})
|
block_vario.add_blockref(block_es, (start[0]-x ,start[1]+esoffset_y -y,start[2] - hoehe_gefaehlle - esoffset_z),dxfattribs={"rotation": 180,"layer":layer,"color":color})
|
||||||
return start, ende
|
return start, ende
|
||||||
elif vario_richtung == "Ab":
|
elif vario_richtung == "Ab":
|
||||||
start = (x , y + dy ,upper_hoehe_gefaehlle)
|
start = (x , y + dy ,upper_hoehe_gefaehlle)
|
||||||
ende = (x , y - dy + esoffset_y,lower_hoehe_gefaehlle + esoffset_z)
|
ende = (x , y - dy + esoffset_y,lower_hoehe_gefaehlle + esoffset_z)
|
||||||
block_vario.add_blockref(block_es, (ende[0]-x ,ende[1]-esoffset_y -y,ende[2] - hoehe_gefaehlle -esoffset_z))
|
block_vario.add_blockref(block_es, (ende[0]-x ,ende[1]-esoffset_y -y,ende[2] - hoehe_gefaehlle -esoffset_z),dxfattribs={"layer":layer,"color":color})
|
||||||
return start,ende
|
return start,ende
|
||||||
|
|
||||||
if laenge > esoffset:
|
if laenge > esoffset:
|
||||||
@@ -83,10 +87,10 @@ def erstellung_gefaelle_block_verbunenden_am_einen(msp,x, y, doc, lib_doc, upper
|
|||||||
copy= line.copy()
|
copy= line.copy()
|
||||||
copy.translate(-x ,-y,-hoehe_gefaehlle)
|
copy.translate(-x ,-y,-hoehe_gefaehlle)
|
||||||
gefaelle_block.add_entity(copy)
|
gefaelle_block.add_entity(copy)
|
||||||
gefaelle_block.add_blockref(block_es, (ende[0]-x ,ende[1]-esoffset_y -y,ende[2] - hoehe_gefaehlle -esoffset_z))
|
gefaelle_block.add_blockref(block_es, (ende[0]-x ,ende[1]-esoffset_y -y,ende[2] - hoehe_gefaehlle -esoffset_z),dxfattribs={"layer":layer,"color":color})
|
||||||
return False
|
return False
|
||||||
else:
|
else:
|
||||||
msp.add_blockref(block_es,(x,y,lower_hoehe_gefaehlle))
|
msp.add_blockref(block_es,(x,y,lower_hoehe_gefaehlle),dxfattribs={"layer":layer,"color":color})
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def gefaellegerade_erstellung(x, y, doc, lib_doc, upper_hoehe_gefaehlle, lower_hoehe_gefaehlle, hoehe_gefaehlle,richtung2, drehung0, drehung1, laenge, hight_position, blockname,config, block_vario = None,voerder_richtung = None, am_kreisel = None, erster_kreisel_höher = None,y1=None,z1 =None):
|
def gefaellegerade_erstellung(x, y, doc, lib_doc, upper_hoehe_gefaehlle, lower_hoehe_gefaehlle, hoehe_gefaehlle,richtung2, drehung0, drehung1, laenge, hight_position, blockname,config, block_vario = None,voerder_richtung = None, am_kreisel = None, erster_kreisel_höher = None,y1=None,z1 =None):
|
||||||
@@ -110,66 +114,62 @@ def gefaellegerade_erstellung(x, y, doc, lib_doc, upper_hoehe_gefaehlle, lower_h
|
|||||||
lower_hoehe_gefaehlle = middle_hoehe
|
lower_hoehe_gefaehlle = middle_hoehe
|
||||||
|
|
||||||
if richtung2!= "DEFAULT" or am_kreisel != None:
|
if richtung2!= "DEFAULT" or am_kreisel != None:
|
||||||
|
# Schaut bei gleicher Orentierung
|
||||||
if ((drehung0 == "GUZS" and drehung1 == "GUZS" and hight_position == "higher") or
|
if ((drehung0 == "GUZS" and drehung1 == "GUZS" and hight_position == "higher") or
|
||||||
(voerder_richtung == "Auf" and((am_kreisel == 1 and erster_kreisel_höher == False)or (am_kreisel== 2 and erster_kreisel_höher == True)) and drehung0 == "GUZS" and drehung1== "GUZS") or
|
(voerder_richtung == "Auf" and((am_kreisel == 1 and erster_kreisel_höher == False)or (am_kreisel== 2 and erster_kreisel_höher == True)) and drehung0 == "GUZS" and drehung1== "GUZS") or
|
||||||
(voerder_richtung == "Ab"and ((am_kreisel == 1 and erster_kreisel_höher == True)or (am_kreisel== 2 and erster_kreisel_höher == False)) and drehung0 == "GUZS" and drehung1== "GUZS")):
|
(voerder_richtung == "Ab"and ((am_kreisel == 1 and erster_kreisel_höher == True)or (am_kreisel== 2 and erster_kreisel_höher == False)) and drehung0 == "GUZS" and drehung1== "GUZS") or
|
||||||
|
# Schaut bei ungleicher Orentierung
|
||||||
|
((drehung0 == "UZS" and drehung1 == "GUZS" and hight_position== "higher"))or
|
||||||
|
(voerder_richtung == "Auf"and ((am_kreisel == 1 and erster_kreisel_höher == False) or (am_kreisel ==2 and erster_kreisel_höher ==True))and (drehung0 == "GUZS" and drehung1 == "UZS")) or
|
||||||
|
(voerder_richtung == "Ab" and((am_kreisel == 1 and erster_kreisel_höher == True)or (am_kreisel == 2 and erster_kreisel_höher == False))and (drehung0 == "UZS" and drehung1 == "GUZS"))):
|
||||||
block_es = "200000146_ES-Element_90_rechts"
|
block_es = "200000146_ES-Element_90_rechts"
|
||||||
plant2dxf.import_block(block_es,lib_doc,doc)
|
plant2dxf.import_block(block_es,lib_doc,doc)
|
||||||
|
layer, color = plant2dxf.get_insert_color_layer(lib_doc,block_es)
|
||||||
|
|
||||||
elif ((drehung0 == "GUZS" and drehung1 == "GUZS") or
|
elif ((drehung0 == "GUZS" and drehung1 == "GUZS") or
|
||||||
(am_kreisel != None and drehung0 == "GUZS" and drehung1 == "GUZS")):
|
(am_kreisel != None and drehung0 == "GUZS" and drehung1 == "GUZS") or
|
||||||
|
(drehung0 == "UZS" and drehung1 == "GUZS" and hight_position == "lower")or
|
||||||
|
(voerder_richtung == "Auf" and((am_kreisel == 1 and erster_kreisel_höher == True)or (am_kreisel == 2 and erster_kreisel_höher == False))and (drehung0 == "UZS" and drehung1 == "GUZS")) or
|
||||||
|
(voerder_richtung == "Ab"and ((am_kreisel == 1 and erster_kreisel_höher == False)or (am_kreisel == 2 and erster_kreisel_höher == True))and (drehung0 == "GUZS" and drehung1 == "UZS"))):
|
||||||
block_as = "200000241_AS-Element_90_rechts"
|
block_as = "200000241_AS-Element_90_rechts"
|
||||||
plant2dxf.import_block(block_as,lib_doc,doc)
|
plant2dxf.import_block(block_as,lib_doc,doc)
|
||||||
|
layer, color = plant2dxf.get_insert_color_layer(lib_doc,block_as)
|
||||||
|
|
||||||
elif (( drehung0 == "GUZS" and drehung1 == "UZS" and hight_position == "higher")or
|
elif ((drehung0 == "UZS" and drehung1 == "UZS" and hight_position == "higher")or
|
||||||
|
(voerder_richtung == "Auf" and((am_kreisel == 1 and erster_kreisel_höher == False)or (am_kreisel== 2 and erster_kreisel_höher == True)) and drehung0 == "UZS" and drehung1== "UZS")or
|
||||||
|
(voerder_richtung == "Ab" and((am_kreisel == 1 and erster_kreisel_höher == True)or (am_kreisel== 2 and erster_kreisel_höher == False)) and drehung0 == "UZS" and drehung1== "UZS") or
|
||||||
|
|
||||||
|
(drehung0 == "GUZS" and drehung1 == "UZS" and hight_position == "higher")or
|
||||||
(voerder_richtung == "Auf" and((am_kreisel == 1 and erster_kreisel_höher == False)or (am_kreisel == 2 and erster_kreisel_höher == True))and (drehung0 == "UZS" and drehung1 == "GUZS")) or
|
(voerder_richtung == "Auf" and((am_kreisel == 1 and erster_kreisel_höher == False)or (am_kreisel == 2 and erster_kreisel_höher == True))and (drehung0 == "UZS" and drehung1 == "GUZS")) or
|
||||||
(voerder_richtung == "Ab" and((am_kreisel == 1 and erster_kreisel_höher == True) or (am_kreisel ==2 and erster_kreisel_höher ==False))and (drehung0 == "GUZS" and drehung1 == "UZS"))):
|
(voerder_richtung == "Ab" and((am_kreisel == 1 and erster_kreisel_höher == True) or (am_kreisel ==2 and erster_kreisel_höher ==False))and (drehung0 == "GUZS" and drehung1 == "UZS"))):
|
||||||
|
|
||||||
block_es = "400102632_ES-Element_90_links"
|
block_es = "400102632_ES-Element_90_links"
|
||||||
plant2dxf.import_block(block_es,lib_doc,doc)
|
plant2dxf.import_block(block_es,lib_doc,doc)
|
||||||
|
layer, color = plant2dxf.get_insert_color_layer(lib_doc,block_es)
|
||||||
|
|
||||||
elif ((drehung0 == "UZS" and drehung1 == "GUZS" and hight_position == "lower")or
|
|
||||||
(voerder_richtung == "Auf" and((am_kreisel == 1 and erster_kreisel_höher == True)or (am_kreisel == 2 and erster_kreisel_höher == False))and (drehung0 == "UZS" and drehung1 == "GUZS")) or
|
|
||||||
(voerder_richtung == "Ab"and ((am_kreisel == 1 and erster_kreisel_höher == False)or (am_kreisel == 2 and erster_kreisel_höher == True))and (drehung0 == "GUZS" and drehung1 == "UZS"))):
|
|
||||||
|
|
||||||
block_as = "200000241_AS-Element_90_rechts"
|
|
||||||
plant2dxf.import_block(block_as,lib_doc,doc)
|
|
||||||
|
|
||||||
elif ((drehung0 == "UZS" and drehung1 == "UZS" and hight_position == "higher")or
|
|
||||||
(voerder_richtung == "Auf" and((am_kreisel == 1 and erster_kreisel_höher == False)or (am_kreisel== 2 and erster_kreisel_höher == True)) and drehung0 == "UZS" and drehung1== "UZS")or
|
|
||||||
(voerder_richtung == "Ab" and((am_kreisel == 1 and erster_kreisel_höher == True)or (am_kreisel== 2 and erster_kreisel_höher == False)) and drehung0 == "UZS" and drehung1== "UZS")):
|
|
||||||
|
|
||||||
block_es = "400102632_ES-Element_90_links"
|
|
||||||
plant2dxf.import_block(block_es,lib_doc,doc)
|
|
||||||
|
|
||||||
elif (((drehung0 == "UZS" and drehung1 == "UZS")or
|
elif (((drehung0 == "UZS" and drehung1 == "UZS")or
|
||||||
(am_kreisel!= None and drehung0 == "UZS" and drehung1 == "UZS"))):
|
(am_kreisel!= None and drehung0 == "UZS" and drehung1 == "UZS")) or
|
||||||
block_as = "200000217_AS-Element_90_links"
|
(drehung0 == "GUZS" and drehung1 == "UZS" and hight_position == "lower")or
|
||||||
plant2dxf.import_block(block_as,lib_doc,doc)
|
|
||||||
|
|
||||||
elif (((drehung0 == "UZS" and drehung1 == "GUZS" and hight_position== "higher"))or
|
|
||||||
(voerder_richtung == "Auf"and ((am_kreisel == 1 and erster_kreisel_höher == False) or (am_kreisel ==2 and erster_kreisel_höher ==True))and (drehung0 == "GUZS" and drehung1 == "UZS")) or
|
|
||||||
(voerder_richtung == "Ab" and((am_kreisel == 1 and erster_kreisel_höher == True)or (am_kreisel == 2 and erster_kreisel_höher == False))and (drehung0 == "UZS" and drehung1 == "GUZS"))):
|
|
||||||
block_es = "200000146_ES-Element_90_rechts"
|
|
||||||
plant2dxf.import_block(block_es,lib_doc,doc)
|
|
||||||
|
|
||||||
elif ((drehung0 == "GUZS" and drehung1 == "UZS" and hight_position == "lower")or
|
|
||||||
(voerder_richtung == "Auf"and((am_kreisel == 1 and erster_kreisel_höher == True)or (am_kreisel == 2 and erster_kreisel_höher == False))and (drehung0 == "GUZS" and drehung1 == "UZS")) or
|
(voerder_richtung == "Auf"and((am_kreisel == 1 and erster_kreisel_höher == True)or (am_kreisel == 2 and erster_kreisel_höher == False))and (drehung0 == "GUZS" and drehung1 == "UZS")) or
|
||||||
(voerder_richtung == "Ab" and((am_kreisel == 1 and erster_kreisel_höher == False)or (am_kreisel == 2 and erster_kreisel_höher == True))and (drehung0 == "UZS" and drehung1 == "GUZS"))):
|
(voerder_richtung == "Ab" and((am_kreisel == 1 and erster_kreisel_höher == False)or (am_kreisel == 2 and erster_kreisel_höher == True))and (drehung0 == "UZS" and drehung1 == "GUZS"))):
|
||||||
block_as = "200000217_AS-Element_90_links"
|
block_as = "200000217_AS-Element_90_links"
|
||||||
plant2dxf.import_block(block_as,lib_doc,doc)
|
plant2dxf.import_block(block_as,lib_doc,doc)
|
||||||
|
layer, color = plant2dxf.get_insert_color_layer(lib_doc,block_as)
|
||||||
|
|
||||||
|
|
||||||
if block_es != None:
|
if block_es != None:
|
||||||
block_es = plant2dxf.dreh_block(block_es,doc,math.radians(winkel_es))
|
block_es = plant2dxf.dreh_block(block_es,doc,lib_doc,math.radians(winkel_es))
|
||||||
if voerder_richtung == "Auf":
|
if voerder_richtung == "Auf":
|
||||||
start = (x , y+ dy - esoffset_y,upper_hoehe_gefaehlle + esoffset_z)
|
start = (x , y+ dy - esoffset_y,upper_hoehe_gefaehlle + esoffset_z)
|
||||||
ende = (x , y1 ,z1)
|
ende = (x , y1 ,z1)
|
||||||
block_vario.add_blockref(block_es, (start[0]-x ,start[1]+esoffset_y-y ,start[2] - esoffset_z-hoehe_gefaehlle),dxfattribs={"rotation": 180})
|
block_vario.add_blockref(block_es, (start[0]-x ,start[1]+esoffset_y-y ,start[2] - esoffset_z-hoehe_gefaehlle),dxfattribs={"rotation": 180,"layer": layer,"color": color})
|
||||||
return start,ende
|
return start,ende
|
||||||
elif(voerder_richtung == "Ab"):
|
elif(voerder_richtung == "Ab"):
|
||||||
start = (x , y1 ,z1)
|
start = (x , y1 ,z1)
|
||||||
ende = (x , y - dy + esoffset_y,lower_hoehe_gefaehlle + esoffset_z)
|
ende = (x , y - dy + esoffset_y,lower_hoehe_gefaehlle + esoffset_z)
|
||||||
block_vario.add_blockref(block_es, (ende[0]-x ,ende[1]-esoffset_y-y ,ende[2] - esoffset_z -hoehe_gefaehlle))
|
block_vario.add_blockref(block_es, (ende[0]-x ,ende[1]-esoffset_y-y ,ende[2] - esoffset_z -hoehe_gefaehlle),dxfattribs={"layer": layer,"color": color})
|
||||||
return start, ende
|
return start, ende
|
||||||
elif am_kreisel == None and blockname not in doc.blocks:
|
elif am_kreisel == None and blockname not in doc.blocks:
|
||||||
block = doc.blocks.new(name=blockname, base_point=(0,0,0))
|
block = doc.blocks.new(name=blockname, base_point=(0,0,0))
|
||||||
@@ -180,18 +180,18 @@ def gefaellegerade_erstellung(x, y, doc, lib_doc, upper_hoehe_gefaehlle, lower_h
|
|||||||
copy= line.copy()
|
copy= line.copy()
|
||||||
copy.translate(-x,-y,-hoehe_gefaehlle)
|
copy.translate(-x,-y,-hoehe_gefaehlle)
|
||||||
block.add_entity(copy)
|
block.add_entity(copy)
|
||||||
block.add_blockref(block_es, (ende[0]-x ,ende[1]- esoffset_y -y ,ende[2] -hoehe_gefaehlle ))
|
block.add_blockref(block_es, (ende[0]-x ,ende[1]- esoffset_y -y ,ende[2] -hoehe_gefaehlle ),dxfattribs={"layer": layer,"color": color})
|
||||||
if block_as != None:
|
if block_as != None:
|
||||||
block_as = plant2dxf.dreh_block(block_as,doc,math.radians(winkel_as))
|
block_as = plant2dxf.dreh_block(block_as,doc,lib_doc,math.radians(winkel_as))
|
||||||
if voerder_richtung == "Auf":
|
if voerder_richtung == "Auf":
|
||||||
start = (x , y1,z1)
|
start = (x , y1,z1)
|
||||||
ende = (x , y - dy + asoffset_y ,lower_hoehe_gefaehlle)
|
ende = (x , y - dy + asoffset_y ,lower_hoehe_gefaehlle)
|
||||||
block_vario.add_blockref(block_as,(ende[0]-x ,ende[1]-asoffset_y -y,ende[2] - esoffset_z - hoehe_gefaehlle ),dxfattribs={"rotation": 180})
|
block_vario.add_blockref(block_as,(ende[0]-x ,ende[1]-asoffset_y -y,ende[2] - esoffset_z - hoehe_gefaehlle ),dxfattribs={"rotation": 180,"layer": layer,"color": color})
|
||||||
return start, ende
|
return start, ende
|
||||||
elif voerder_richtung == "Ab":
|
elif voerder_richtung == "Ab":
|
||||||
start = (x , y +dy - asoffset_y,upper_hoehe_gefaehlle - asoffset_z)
|
start = (x , y +dy - asoffset_y,upper_hoehe_gefaehlle - asoffset_z)
|
||||||
ende = (x , y1 ,z1)
|
ende = (x , y1 ,z1)
|
||||||
block_vario.add_blockref(block_as,(start[0]-x ,start[1]+asoffset_y -y,start[2] + asoffset_z - hoehe_gefaehlle))
|
block_vario.add_blockref(block_as,(start[0]-x ,start[1]+asoffset_y -y,start[2] + asoffset_z - hoehe_gefaehlle),dxfattribs={"layer": layer,"color": color})
|
||||||
return start,ende
|
return start,ende
|
||||||
elif am_kreisel == None and blockname not in doc.blocks:
|
elif am_kreisel == None and blockname not in doc.blocks:
|
||||||
block = doc.blocks.new(name=blockname, base_point=(0,0,0))
|
block = doc.blocks.new(name=blockname, base_point=(0,0,0))
|
||||||
@@ -211,7 +211,8 @@ def gefaellegerade_erstellung(x, y, doc, lib_doc, upper_hoehe_gefaehlle, lower_h
|
|||||||
plant2dxf.import_block(block_as,lib_doc,doc)
|
plant2dxf.import_block(block_as,lib_doc,doc)
|
||||||
block_es = "200000146_ES-Element_90_rechts"
|
block_es = "200000146_ES-Element_90_rechts"
|
||||||
plant2dxf.import_block(block_es,lib_doc,doc)
|
plant2dxf.import_block(block_es,lib_doc,doc)
|
||||||
|
as_layer, as_color = plant2dxf.get_insert_color_layer(lib_doc,block_as)
|
||||||
|
es_layer, es_color = plant2dxf.get_insert_color_layer(lib_doc,block_es)
|
||||||
elif (((drehung0 == "GUZS" and drehung1 == "UZS" and hight_position == "higher")or (drehung0 == "UZS" and drehung1 == "GUZS" and hight_position == "lower")) or
|
elif (((drehung0 == "GUZS" and drehung1 == "UZS" and hight_position == "higher")or (drehung0 == "UZS" and drehung1 == "GUZS" and hight_position == "lower")) or
|
||||||
(voerder_richtung == "Auf" and drehung0 == "UZS"and drehung1 == "GUZS") or
|
(voerder_richtung == "Auf" and drehung0 == "UZS"and drehung1 == "GUZS") or
|
||||||
(voerder_richtung == "Ab" and drehung0 == "GUZS" and drehung1 == "UZS")) :
|
(voerder_richtung == "Ab" and drehung0 == "GUZS" and drehung1 == "UZS")) :
|
||||||
@@ -219,13 +220,15 @@ def gefaellegerade_erstellung(x, y, doc, lib_doc, upper_hoehe_gefaehlle, lower_h
|
|||||||
plant2dxf.import_block(block_as,lib_doc,doc)
|
plant2dxf.import_block(block_as,lib_doc,doc)
|
||||||
block_es = "400102632_ES-Element_90_links"
|
block_es = "400102632_ES-Element_90_links"
|
||||||
plant2dxf.import_block(block_es,lib_doc,doc)
|
plant2dxf.import_block(block_es,lib_doc,doc)
|
||||||
|
as_layer, as_color = plant2dxf.get_insert_color_layer(lib_doc,block_as)
|
||||||
|
es_layer, es_color = plant2dxf.get_insert_color_layer(lib_doc,block_es)
|
||||||
elif (( drehung0 == "UZS" and drehung1 == "UZS") or (voerder_richtung != None and drehung0 == "UZS" and drehung1 == "UZS")):
|
elif (( drehung0 == "UZS" and drehung1 == "UZS") or (voerder_richtung != None and drehung0 == "UZS" and drehung1 == "UZS")):
|
||||||
block_as = "200000217_AS-Element_90_links"
|
block_as = "200000217_AS-Element_90_links"
|
||||||
plant2dxf.import_block(block_as,lib_doc,doc)
|
plant2dxf.import_block(block_as,lib_doc,doc)
|
||||||
block_es = "400102632_ES-Element_90_links"
|
block_es = "400102632_ES-Element_90_links"
|
||||||
plant2dxf.import_block(block_es,lib_doc,doc)
|
plant2dxf.import_block(block_es,lib_doc,doc)
|
||||||
|
as_layer, as_color = plant2dxf.get_insert_color_layer(lib_doc,block_as)
|
||||||
|
es_layer, es_color = plant2dxf.get_insert_color_layer(lib_doc,block_es)
|
||||||
elif ((((drehung0 == "UZS" and drehung1 == "GUZS" and hight_position== "higher")or (drehung0 == "GUZS" and drehung1 == "UZS" and hight_position == "lower")))or
|
elif ((((drehung0 == "UZS" and drehung1 == "GUZS" and hight_position== "higher")or (drehung0 == "GUZS" and drehung1 == "UZS" and hight_position == "lower")))or
|
||||||
(voerder_richtung == "Auf" and drehung0 == "GUZS" and drehung1 == "UZS") or
|
(voerder_richtung == "Auf" and drehung0 == "GUZS" and drehung1 == "UZS") or
|
||||||
(voerder_richtung == "Ab" and drehung0 == "UZS"and drehung1 == "GUZS")) :
|
(voerder_richtung == "Ab" and drehung0 == "UZS"and drehung1 == "GUZS")) :
|
||||||
@@ -234,8 +237,10 @@ def gefaellegerade_erstellung(x, y, doc, lib_doc, upper_hoehe_gefaehlle, lower_h
|
|||||||
plant2dxf.import_block(block_as,lib_doc,doc)
|
plant2dxf.import_block(block_as,lib_doc,doc)
|
||||||
block_es = "200000146_ES-Element_90_rechts"
|
block_es = "200000146_ES-Element_90_rechts"
|
||||||
plant2dxf.import_block(block_es,lib_doc,doc)
|
plant2dxf.import_block(block_es,lib_doc,doc)
|
||||||
block_as = plant2dxf.dreh_block(block_as,doc,math.radians(winkel_as))
|
as_layer, as_color = plant2dxf.get_insert_color_layer(lib_doc,block_as)
|
||||||
block_es = plant2dxf.dreh_block(block_es,doc,math.radians(winkel_es))
|
es_layer, es_color = plant2dxf.get_insert_color_layer(lib_doc,block_es)
|
||||||
|
block_as = plant2dxf.dreh_block(block_as,doc,lib_doc,math.radians(winkel_as))
|
||||||
|
block_es = plant2dxf.dreh_block(block_es,doc,lib_doc,math.radians(winkel_es))
|
||||||
halbe_laenge = laenge / 2
|
halbe_laenge = laenge / 2
|
||||||
|
|
||||||
dy = halbe_laenge * math.cos(0)
|
dy = halbe_laenge * math.cos(0)
|
||||||
@@ -250,22 +255,22 @@ def gefaellegerade_erstellung(x, y, doc, lib_doc, upper_hoehe_gefaehlle, lower_h
|
|||||||
|
|
||||||
copy.translate(-x ,-y,-hoehe_gefaehlle)
|
copy.translate(-x ,-y,-hoehe_gefaehlle)
|
||||||
block.add_entity(copy)
|
block.add_entity(copy)
|
||||||
block.add_blockref(block_as,(start[0]-x ,start[1]+asoffset_y -y,start[2] + asoffset_z - hoehe_gefaehlle ))
|
block.add_blockref(block_as,(start[0]-x ,start[1]+asoffset_y -y,start[2] + asoffset_z - hoehe_gefaehlle),dxfattribs={"layer": as_layer,"color": as_color})
|
||||||
block.add_blockref(block_es, (ende[0]-x ,ende[1]-esoffset_y -y,ende[2] - esoffset_z - hoehe_gefaehlle ))
|
block.add_blockref(block_es, (ende[0]-x ,ende[1]-esoffset_y -y,ende[2] - esoffset_z - hoehe_gefaehlle ),dxfattribs={"layer": es_layer,"color": es_color})
|
||||||
return
|
return
|
||||||
if voerder_richtung == "Auf":
|
if voerder_richtung == "Auf":
|
||||||
start = (x , y + dy - esoffset_y,upper_hoehe_gefaehlle + esoffset_z)
|
start = (x , y + dy - esoffset_y,upper_hoehe_gefaehlle + esoffset_z)
|
||||||
ende = (x , y - dy + asoffset,lower_hoehe_gefaehlle -asoffset_z)
|
ende = (x , y - dy + asoffset,lower_hoehe_gefaehlle -asoffset_z)
|
||||||
|
|
||||||
block_vario.add_blockref(block_es,(start[0]-x ,start[1]+esoffset_y -y,start[2] - esoffset_z - hoehe_gefaehlle ),dxfattribs={"rotation": 180})
|
block_vario.add_blockref(block_es,(start[0]-x ,start[1]+esoffset_y -y,start[2] - esoffset_z - hoehe_gefaehlle ),dxfattribs={"rotation": 180,"layer": as_layer,"color": as_color})
|
||||||
block_vario.add_blockref(block_as, (ende[0]-x ,ende[1]-asoffset_y -y,ende[2] + asoffset_z - hoehe_gefaehlle ),dxfattribs={"rotation": 180})
|
block_vario.add_blockref(block_as, (ende[0]-x ,ende[1]-asoffset_y -y,ende[2] + asoffset_z - hoehe_gefaehlle ),dxfattribs={"rotation": 180,"layer": es_layer,"color": es_color})
|
||||||
return start,ende
|
return start,ende
|
||||||
elif voerder_richtung == "Ab":
|
elif voerder_richtung == "Ab":
|
||||||
start = (x , y + dy - asoffset_y,upper_hoehe_gefaehlle - asoffset_z)
|
start = (x , y + dy - asoffset_y,upper_hoehe_gefaehlle - asoffset_z)
|
||||||
ende = (x , y - dy + esoffset_y,lower_hoehe_gefaehlle + esoffset_z)
|
ende = (x , y - dy + esoffset_y,lower_hoehe_gefaehlle + esoffset_z)
|
||||||
|
|
||||||
block_vario.add_blockref(block_as,(start[0]-x ,start[1]+asoffset_y -y,start[2] + asoffset_z - hoehe_gefaehlle ))
|
block_vario.add_blockref(block_as,(start[0]-x ,start[1]+asoffset_y -y,start[2] + asoffset_z - hoehe_gefaehlle),dxfattribs={"layer": as_layer,"color": as_color})
|
||||||
block_vario.add_blockref(block_es, (ende[0]-x ,ende[1]-esoffset_y -y,ende[2] - esoffset_z - hoehe_gefaehlle))
|
block_vario.add_blockref(block_es, (ende[0]-x ,ende[1]-esoffset_y -y,ende[2] - esoffset_z - hoehe_gefaehlle),dxfattribs={"layer": es_layer,"color": es_color})
|
||||||
return start,ende
|
return start,ende
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+11
-11
@@ -183,11 +183,12 @@ def import_block(block_name: str, from_doc, to_doc, winkel = None) -> None:
|
|||||||
if att_def != {}:
|
if att_def != {}:
|
||||||
return att_def
|
return att_def
|
||||||
|
|
||||||
def dreh_block(block_name: str, to_doc, winkel) :
|
def dreh_block(block_name: str, to_doc,lib_doc, winkel) :
|
||||||
"""Nimmt ein schon importierten Block und erstellt einen neuen der an der y_axis gedreht wird
|
"""Nimmt ein schon importierten Block und erstellt einen neuen der an der y_axis gedreht wird
|
||||||
hauptsächlich für vario Bogen aktuell verwendet
|
hauptsächlich für vario Bogen aktuell verwendet
|
||||||
"""
|
"""
|
||||||
dreh_block_name = block_name +f"_{math.degrees(winkel)}"
|
dreh_block_name = block_name +f"_{math.degrees(winkel)}"
|
||||||
|
layer, color = get_insert_color_layer(lib_doc,block_name)
|
||||||
if (dreh_block_name in to_doc.blocks):
|
if (dreh_block_name in to_doc.blocks):
|
||||||
return dreh_block_name
|
return dreh_block_name
|
||||||
block_zwischen = to_doc.blocks.new(name=block_name + f"zwischenschrit_{winkel}", base_point=(0,0,0))
|
block_zwischen = to_doc.blocks.new(name=block_name + f"zwischenschrit_{winkel}", base_point=(0,0,0))
|
||||||
@@ -197,7 +198,7 @@ def dreh_block(block_name: str, to_doc, winkel) :
|
|||||||
else:
|
else:
|
||||||
rotation_matrix = Matrix44.axis_rotate(Y_AXIS, winkel)
|
rotation_matrix = Matrix44.axis_rotate(Y_AXIS, winkel)
|
||||||
|
|
||||||
block_zwischen.add_blockref(block_name,(0,0,0))
|
block_zwischen.add_blockref(block_name,(0,0,0),dxfattribs={"layer":layer,"color": color})
|
||||||
for e in block_zwischen:
|
for e in block_zwischen:
|
||||||
copy = e.copy()
|
copy = e.copy()
|
||||||
copy.transform(rotation_matrix)
|
copy.transform(rotation_matrix)
|
||||||
@@ -292,6 +293,7 @@ def handle_ils_2_0_gefaellestrecke(msp, teileid, merkmale, x, y, doc, lib_doc, v
|
|||||||
start = x +dx, y + dy,upper_hoehe_gefaehlle
|
start = x +dx, y + dy,upper_hoehe_gefaehlle
|
||||||
if "6-SP" not in doc.layers:
|
if "6-SP" not in doc.layers:
|
||||||
doc.layers.add(name="6-SP", color=7)
|
doc.layers.add(name="6-SP", color=7)
|
||||||
|
gefaelle_layer = "6-SP"
|
||||||
verbunden_am_einen = False
|
verbunden_am_einen = False
|
||||||
|
|
||||||
richtung2 ="DEFAULT"
|
richtung2 ="DEFAULT"
|
||||||
@@ -400,7 +402,7 @@ def handle_ils_2_0_gefaellestrecke(msp, teileid, merkmale, x, y, doc, lib_doc, v
|
|||||||
line = Line.new(dxfattribs={"start":start,"end":ende})
|
line = Line.new(dxfattribs={"start":start,"end":ende})
|
||||||
line.translate(-x,-y,-hoehe_gefaehlle)
|
line.translate(-x,-y,-hoehe_gefaehlle)
|
||||||
block.add_entity(line)
|
block.add_entity(line)
|
||||||
msp.add_blockref(blockname,(x,y,hoehe_gefaehlle),dxfattribs={"rotation": rotation})
|
msp.add_blockref(blockname,(x,y,hoehe_gefaehlle),dxfattribs={"rotation": rotation,"layer": gefaelle_layer})
|
||||||
return
|
return
|
||||||
if upper_hoehe_gefaehlle == hoehe0:
|
if upper_hoehe_gefaehlle == hoehe0:
|
||||||
hight ="higher"
|
hight ="higher"
|
||||||
@@ -412,7 +414,7 @@ def handle_ils_2_0_gefaellestrecke(msp, teileid, merkmale, x, y, doc, lib_doc, v
|
|||||||
blockname = f"Ils_2.0_Gefaellestrecke_{laenge}_{drehung0}_{hoehe_gefaehlle}_{verbunden_am_einen}_{hight}_{hat_umlenk_0}_{hat_motor_0}_{tefkurve_0}"
|
blockname = f"Ils_2.0_Gefaellestrecke_{laenge}_{drehung0}_{hoehe_gefaehlle}_{verbunden_am_einen}_{hight}_{hat_umlenk_0}_{hat_motor_0}_{tefkurve_0}"
|
||||||
|
|
||||||
if blockname in doc.blocks:
|
if blockname in doc.blocks:
|
||||||
bref =msp.add_blockref(blockname,(x,y,hoehe_gefaehlle),dxfattribs={"rotation": rotation})
|
bref =msp.add_blockref(blockname,(x,y,hoehe_gefaehlle),dxfattribs={"rotation": rotation,"layer": gefaelle_layer})
|
||||||
a =bref.add_attrib(
|
a =bref.add_attrib(
|
||||||
tag= "NAME",
|
tag= "NAME",
|
||||||
text= merkmale.get("bezeichner"),
|
text= merkmale.get("bezeichner"),
|
||||||
@@ -448,7 +450,7 @@ def handle_ils_2_0_gefaellestrecke(msp, teileid, merkmale, x, y, doc, lib_doc, v
|
|||||||
only_es_or_as = as_es_methoden.erstellung_gefaelle_block_verbunenden_am_einen(msp,x, y, doc, lib_doc, upper_hoehe_gefaehlle, lower_hoehe_gefaehlle, hoehe_gefaehlle, drehung0, laenge, blockname,config,hight,None,None,None,block,start,ende)
|
only_es_or_as = as_es_methoden.erstellung_gefaelle_block_verbunenden_am_einen(msp,x, y, doc, lib_doc, upper_hoehe_gefaehlle, lower_hoehe_gefaehlle, hoehe_gefaehlle, drehung0, laenge, blockname,config,hight,None,None,None,block,start,ende)
|
||||||
|
|
||||||
if only_es_or_as == False:
|
if only_es_or_as == False:
|
||||||
bref =msp.add_blockref(blockname,(x,y,hoehe_gefaehlle),dxfattribs={"rotation": rotation})
|
bref =msp.add_blockref(blockname,(x,y,hoehe_gefaehlle),dxfattribs={"rotation": rotation,"layer": gefaelle_layer})
|
||||||
a =bref.add_attrib(
|
a =bref.add_attrib(
|
||||||
tag= "NAME",
|
tag= "NAME",
|
||||||
text= merkmale.get("bezeichner"),
|
text= merkmale.get("bezeichner"),
|
||||||
@@ -594,9 +596,7 @@ def handle_ils_2_0_gefaellestrecke(msp, teileid, merkmale, x, y, doc, lib_doc, v
|
|||||||
else:
|
else:
|
||||||
blockname = f"Ils_2.0_Gefaellestrecke_{laenge}_{hoehe_gefaehlle}_{drehung0}_{drehung1}_{hight_position}_{unterschiedlich}_{richtung2}_{verbunden_am_einen}"
|
blockname = f"Ils_2.0_Gefaellestrecke_{laenge}_{hoehe_gefaehlle}_{drehung0}_{drehung1}_{hight_position}_{unterschiedlich}_{richtung2}_{verbunden_am_einen}"
|
||||||
as_es_methoden.gefaellegerade_erstellung(x, y, doc, lib_doc, upper_hoehe_gefaehlle, lower_hoehe_gefaehlle, hoehe_gefaehlle,richtung2,drehung0, drehung1, laenge, hight_position,blockname,config)
|
as_es_methoden.gefaellegerade_erstellung(x, y, doc, lib_doc, upper_hoehe_gefaehlle, lower_hoehe_gefaehlle, hoehe_gefaehlle,richtung2,drehung0, drehung1, laenge, hight_position,blockname,config)
|
||||||
blockref_layer, color = get_insert_color_layer(lib_doc, blockname)
|
bref =msp.add_blockref(blockname,(x,y,hoehe_gefaehlle),dxfattribs={"rotation": rotation, "layer": gefaelle_layer})
|
||||||
|
|
||||||
bref =msp.add_blockref(blockname,(x,y,hoehe_gefaehlle),dxfattribs={"rotation": rotation, "layer": blockref_layer })
|
|
||||||
a = bref.add_attrib(
|
a = bref.add_attrib(
|
||||||
tag= "NAME",
|
tag= "NAME",
|
||||||
text= merkmale.get("bezeichner"),
|
text= merkmale.get("bezeichner"),
|
||||||
@@ -640,7 +640,7 @@ def handle_ils_2_0_gefaellestrecke(msp, teileid, merkmale, x, y, doc, lib_doc, v
|
|||||||
line = Line.new(dxfattribs={"start":start,"end":ende})
|
line = Line.new(dxfattribs={"start":start,"end":ende})
|
||||||
line.translate(-x,-y,-hoehe_gefaehlle)
|
line.translate(-x,-y,-hoehe_gefaehlle)
|
||||||
block.add_entity(line)
|
block.add_entity(line)
|
||||||
msp.add_blockref(blockname,(x,y,hoehe_gefaehlle),dxfattribs={"rotation": rotation})
|
msp.add_blockref(blockname,(x,y,hoehe_gefaehlle),dxfattribs={"rotation": rotation,"layer": gefaelle_layer})
|
||||||
elif hat_motor_0 == None and hat_umlenk_0 == True and tefkurve_1 == None:
|
elif hat_motor_0 == None and hat_umlenk_0 == True and tefkurve_1 == None:
|
||||||
if blockname not in doc.blocks:
|
if blockname not in doc.blocks:
|
||||||
block = doc.blocks.new(name=blockname,base_point = (0,0,0))
|
block = doc.blocks.new(name=blockname,base_point = (0,0,0))
|
||||||
@@ -652,7 +652,7 @@ def handle_ils_2_0_gefaellestrecke(msp, teileid, merkmale, x, y, doc, lib_doc, v
|
|||||||
line = Line.new(dxfattribs={"start":start,"end":ende})
|
line = Line.new(dxfattribs={"start":start,"end":ende})
|
||||||
line.translate(-x,-y,-hoehe_gefaehlle)
|
line.translate(-x,-y,-hoehe_gefaehlle)
|
||||||
block.add_entity(line)
|
block.add_entity(line)
|
||||||
msp.add_blockref(blockname,(x,y,hoehe_gefaehlle),dxfattribs={"rotation": rotation})
|
msp.add_blockref(blockname,(x,y,hoehe_gefaehlle),dxfattribs={"rotation": rotation,"layer": gefaelle_layer})
|
||||||
else:
|
else:
|
||||||
if blockname not in doc.blocks:
|
if blockname not in doc.blocks:
|
||||||
block = doc.blocks.new(name=blockname,base_point = (0,0,0))
|
block = doc.blocks.new(name=blockname,base_point = (0,0,0))
|
||||||
@@ -669,7 +669,7 @@ def handle_ils_2_0_gefaellestrecke(msp, teileid, merkmale, x, y, doc, lib_doc, v
|
|||||||
line = Line.new(dxfattribs={"start":start,"end":ende})
|
line = Line.new(dxfattribs={"start":start,"end":ende})
|
||||||
line.translate(-x,-y,-hoehe_gefaehlle)
|
line.translate(-x,-y,-hoehe_gefaehlle)
|
||||||
block.add_entity(line)
|
block.add_entity(line)
|
||||||
msp.add_blockref(blockname,(x,y,hoehe_gefaehlle),dxfattribs={"rotation": rotation})
|
msp.add_blockref(blockname,(x,y,hoehe_gefaehlle),dxfattribs={"rotation": rotation,"layer": gefaelle_layer})
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user