Ich bin gerade dabei ein Makro für eine Dachgaube zu erstellen, welches dann eine Abschleppung platziert.
Grundsätzlich funktioniert die Platzierung und die Darstellung so wie gewünscht - einzig die Darstellung der Vorschau-Grafik ist nicht passend:
Die Abschleppung soll natürlich direkt an die Traufe gesetzt werden - die Vorschaugrafik wird jedoch mit einem gewissen Abstand dargestellt (siehe oben).
Wenn man dann die Gaube absetzt, dann sieht sie im Grundriss so aus:
Wie kriege ich es hin, dass die Vorschaugrafik auch gleich direkt an der Kante dargestellt wird?
Hier der Entwurf des Beschreibungssprachenmakros:
# ************************************************** # * file: schlepp.mcr # * date: Mon Dec 19 10:34:09 CET 2005 # * translated and formated with # * Bentley Speedikon MacroTranslator # ************************************************** # ##################################################################### # # # name : schlepp # # author : JS IEZ AG # # issue date : 24.11.94 # # version : 1.0 # # revision : MK 27.10.03 # # Berechnung vertauscht Ortgang und Traufe # # sinngemaess geaendert # # eaves_overhang := roof_param(4); # # verge_overhang := roof_param(3); # # function : erzeugt eine Schleppgaube # # # # ##################################################################### # _aend: 26.01.06 dr modifications for new dialogs BESCHREIBUNG def_param; UMGEBUNG dachde; roof_param(1) := 1000; roof_param(2) := 500; roof_param(26) := 0; roof_param(24) := 5.00; roof_param(3) := 100; roof_param(4) := 100; roof_param(6) := 1; roof_param(7) := 1; roof_param(15) := 50; roof_param(16) := 600; ENDE UNTERBESCHREIBUNG check_par(width, side_height, top_slope_angle, eaves_overhang, verge_overhang, opening_flag, area_calcul_flag, side_thickness, side_material, top_height, check_field, success); # --------------------------------------------------------------------- # # this macro part checks the aktuall parameters of the macro # # --------------------------------------------------------------------- UMGEBUNG dachde; KONSTANTEN macro_name := "Schleppgaube"; error_1 := "�ffnungsbreite muss >= 1 sein"; error_2 := "Seitenh�he muss => 0 sein"; error_3 := "�berstand an der Traufe ist zu klein"; error_4 := "�berstand am Ortgang ist zu klein"; error_6 := "�ffnung erzeugen muss 0 or 1 sein"; error_7 := "�ffnung mit Wohnfl�chenberechnung muss 0 oder 1 sein"; error_15 := "Dicke der Seitenteile muss => 0 sein"; error_16 := "Material der Seitenteile muss > 0 sein"; error_24 := "Neigungswinkel der Gaubendecke muss => 0 und < 90 Grad sein"; error_26 := "H�he der Gaubendecke muss => 0 sein"; ENDE VARIABLEN GANZZAHL success, opening_flag, area_calcul_flag, side_material, check_field(30); DEZIMAL width, side_height, top_slope_angle, eaves_overhang, verge_overhang, side_thickness, top_height; GANZZAHL i; ENDE # ausgabe(0,"I am in check_par"); success := 1;# no errors found SCHLEIFE FUER i := 1 SCHRITT i := i + 1 SOLANGE i <= 30; check_field(i) := 1; ENDE WENN (width < 1) DANN Box_Fehler(macro_name, 1, error_1); success := 0; check_field(1) := 0; ENDE WENN (side_height < 0) DANN Box_Fehler(macro_name, 1, error_2); success := 0; check_field(2) := 0; ENDE WENN (side_height < 1) DANN side_height := 0; ENDE WENN (top_height < 0) DANN Box_Fehler(macro_name, 1, error_26); success := 0; check_field(26) := 0; SONST WENN (top_height = 0) DANN WENN (top_slope_angle < 0.0)ODER(top_slope_angle >= 90.0) DANN Box_Fehler(macro_name, 1, error_24); success := 0; check_field(24) := 0; ENDE ENDE ENDE WENN (eaves_overhang < 0) DANN Box_Fehler(macro_name, 1, error_3); success := 0; check_field(3) := 0; ENDE WENN (eaves_overhang < 1) DANN eaves_overhang := 0; ENDE WENN (verge_overhang < 0) DANN Box_Fehler(macro_name, 1, error_4); success := 0; check_field(4) := 0; ENDE WENN (verge_overhang < 1) DANN verge_overhang := 0; ENDE WENN (opening_flag <> SCHALTER_AUS)UND(opening_flag <> SCHALTER_AN) DANN Box_Fehler(macro_name, 1, error_6); success := 0; check_field(6) := 0; ENDE WENN (area_calcul_flag <> SCHALTER_AUS)UND(area_calcul_flag <> SCHALTER_AN) DANN Box_Fehler(macro_name, 1, error_7); success := 0; check_field(7) := 0; ENDE WENN (side_thickness < 0) DANN Box_Fehler(macro_name, 1, error_15); success := 0; check_field(15) := 0; ENDE WENN (side_thickness < 1) DANN side_thickness := 0; ENDE WENN (side_material < 1) DANN Box_Fehler(macro_name, 1, error_16); success := 0; check_field(16) := 0; ENDE ENDE BESCHREIBUNG paramdial; # --------------------------------------------------------------------- # # this macro part realizies the dialog with the user, the parameters # needed by the macro can be edited within a dialog box # # --------------------------------------------------------------------- UMGEBUNG dachde; VARIABLEN GANZZAHL success, ret, opening_flag, area_calcul_flag, side_material, check_field(30), hdl; DEZIMAL width, side_height, top_slope_angle, eaves_overhang, verge_overhang, side_thickness, top_height, dbl2intBuf; ZEICHEN request(20); ENDE # ausgabe(0,"I am in paramdial"); success := 0; SCHLEIFE SOLANGE success <> 1; # hdl := OLE_CREATEOBJECT('Bentley.speedikon.Forms.Dormer.DIN.schlepp'); hdl := -1; WENN (hdl < 0) DANN request(1) := "�ffnungsbreite:"; request(2) := "Seitenh�he:"; request(3) := "H�he der Gaubendecke:"; request(4) := "Neigungswinkel der Gaubendecke:"; request(5) := "�berstand an der Traufe:"; request(6) := "�berstand am Ortgang:"; request(7) := "�ffnung erzeugen 0=N/1=J:"; request(8) := "�ffn. mit Fl�.-ber. 0=N/1=J"; request(9) := "Dicke der Seitenteile:"; request(10) := "Material der Seitenteile:"; width := roof_param(1); side_height := roof_param(2); top_height := roof_param(26); top_slope_angle := roof_param(24); eaves_overhang := roof_param(3); verge_overhang := roof_param(4); opening_flag := roof_param(6); area_calcul_flag := roof_param(7); side_thickness := roof_param(15); side_material := roof_param(16); ret := parameterbox("uuuauuiiui", request, width, side_height, top_height, top_slope_angle, eaves_overhang, verge_overhang, opening_flag, area_calcul_flag, side_thickness, side_material); SONST ole_PutProperty(hdl, "Breite", 1, roof_param(1)); ole_PutProperty(hdl, "Hoehe_Seite", 1, roof_param(2)); ole_PutProperty(hdl, "Hoehe", 1, roof_param(26)); ole_PutProperty(hdl, "Neigungswinkel", 1, roof_param(24)); ole_PutProperty(hdl, "Ueberstand_Traufe", 1, roof_param(3)); ole_PutProperty(hdl, "Ueberstand_Ortgang", 1, roof_param(4)); ole_PutProperty(hdl, "Flaechenberechnung", 1, roof_param(7)); ole_PutProperty(hdl, "Dicke_Seitenteile", 1, roof_param(15)); ole_PutProperty(hdl, "Material_Seitenteile", 1, roof_param(16)); ole_invoke(hdl, "ShowDialog", ret); WENN (ret = 1) DANN ole_GetProperty(hdl, "Breite", 1, width); ole_GetProperty(hdl, "Hoehe_Seite", 1, side_height); ole_GetProperty(hdl, "Hoehe", 1, top_height); ole_GetProperty(hdl, "Neigungswinkel", 1, top_slope_angle); ole_GetProperty(hdl, "Ueberstand_Traufe", 1, eaves_overhang); ole_GetProperty(hdl, "Ueberstand_Ortgang", 1, verge_overhang); opening_flag := 1; ole_GetProperty(hdl, "Flaechenberechnung", 1, dbl2intBuf); area_calcul_flag := dbl2intBuf; ole_GetProperty(hdl, "Dicke_Seitenteile", 1, side_thickness); ole_GetProperty(hdl, "Material_Seitenteile", 1, dbl2intBuf); side_material := dbl2intBuf; ENDE ole_releaseobject(hdl); ENDE # ok-Button pushed ? WENN (ret = 1) DANN BESCHREIBE('schlepp.check_par', width, side_height, top_slope_angle, eaves_overhang, verge_overhang, opening_flag, area_calcul_flag, side_thickness, side_material, top_height, check_field, success); WENN (check_field(1) = 1) DANN roof_param(1) := width; ENDE WENN (check_field(2) = 1) DANN roof_param(2) := side_height; ENDE WENN (check_field(26) = 1) DANN roof_param(26) := top_height; ENDE WENN (check_field(24) = 1) DANN roof_param(24) := top_slope_angle; ENDE WENN (check_field(3) = 1) DANN roof_param(3) := eaves_overhang; ENDE WENN (check_field(4) = 1) DANN roof_param(4) := verge_overhang; ENDE WENN (check_field(6) = 1) DANN roof_param(6) := opening_flag; ENDE WENN (check_field(7) = 1) DANN roof_param(7) := area_calcul_flag; ENDE WENN (check_field(15) = 1) DANN roof_param(15) := side_thickness; ENDE WENN (check_field(16) = 1) DANN roof_param(16) := side_material; ENDE SONST stop("", 1); ENDE ENDE ENDE BESCHREIBUNG place_opt; # --------------------------------------------------------------------- # # this macro part realizies the graphical dialog (without function # in this version) # # --------------------------------------------------------------------- ; ENDE BESCHREIBUNG schlepp; # --------------------------------------------------------------------- # # this macro part creates a drag dormer, roof_buffer(1) # contains the number of the panel containing the dormer # # --------------------------------------------------------------------- UMGEBUNG dachde; KONSTANTEN macro_name := "Schleppgaube"; error_1 := "Fehler beim Ausf�hren des Gaubenmakros"; ENDE VARIABLEN GANZZAHL opening_flag, area_calcul_flag, side_material, Schichten; GANZZAHL success, parent_panel, state, panel_number, opening_number, i, intersection_type, n_left_panel, check_field(30), n_right_panel, edge_number, parent_flversch, parent_flzeichn, parent_dachdeck, n_top_panel, parent_kendicke, parent_dachtyp; DEZIMAL width, side_height, top_slope_angle, eaves_overhang, verge_overhang, side_thickness, top_height; DEZIMAL first_panel_point(3), second_panel_point(3), third_panel_point(3), first_line_start(3), first_line_end(3), intersection_point(3), x_open(4), y_open(4), z_open(4), parent_slope_angle, parent_slope_direction, parent_dadicke, parent_vert_thickness, parent_hori_thickness, thickness_diff_offset, help_point(3), y_distance; DEZIMAL first_help_point(3), second_help_point(3), third_help_point(3), vert_thickness, p1(3), p2(3), p3(3), intersection_point_top(3), dy, Kantenversatz(4); GANZZAHL Schicht_ID, Schicht_Art, Schicht_Versch, Schicht_Mat, Kantenanschnitt(4); ZEICHEN Schicht_Bez, Schicht_Kat, Schicht_FW; DEZIMAL Schicht_Dicke; ENDE # ------------------------------------------------------------------- # check the actual parameters # ------------------------------------------------------------------- success := 0; SCHLEIFE SOLANGE success <> 1; width := roof_param(1); side_height := roof_param(2); top_height := roof_param(26); top_slope_angle := roof_param(24); # eaves_overhang := roof_param(3); # verge_overhang := roof_param(4); opening_flag := roof_param(6); area_calcul_flag := roof_param(7); side_thickness := roof_param(15); side_material := roof_param(16); eaves_overhang := roof_param(4); verge_overhang := roof_param(3); BESCHREIBE('schlepp.check_par', width, side_height, top_slope_angle, eaves_overhang, verge_overhang, opening_flag, area_calcul_flag, side_thickness, side_material, top_height, check_field, success); # if any errors occur ask for new parameters WENN (success = 0) DANN BESCHREIBE('schlepp.paramdial'); ENDE ENDE parent_panel := roof_buffer(1); WENN (parent_panel > 0) DANN # Get Panel Informations Dachfl_info(parent_panel, parent_flversch, parent_flzeichn, parent_dachdeck, parent_kendicke, parent_dadicke, parent_dachtyp, parent_slope_angle, parent_slope_direction, state, Schichten); SCHLEIFE FUER i := 1 SCHRITT i := i + 1 SOLANGE i <= Schichten; DACHFL_SCHICHT_INFO ( parent_panel, i, Schicht_Art, Schicht_Bez, Schicht_Versch, Schicht_Dicke, Schicht_Mat, Schicht_Kat, Schicht_FW ); ENDE WENN (parent_slope_angle < 0.1) DANN stop("", 1); ENDE WENN (parent_kendicke = SCHALTER_AUS) DANN parent_vert_thickness := parent_dadicke / SIN(90 - parent_slope_angle); SONST parent_vert_thickness := parent_dadicke; ENDE parent_hori_thickness := parent_vert_thickness / TAN(parent_slope_angle); WENN (side_height < parent_vert_thickness) DANN side_height := parent_vert_thickness; roof_param(2) := side_height; ENDE side_height := side_height + parent_vert_thickness; # y-offset in case the parent panel and the dormer # have different thickness WENN (parent_vert_thickness > dadicke) DANN thickness_diff_offset := (parent_vert_thickness - dadicke) / TAN(parent_slope_angle); SONST thickness_diff_offset := 0; ENDE # get 3 points of the panel to calculate the intersection Dachfl_pkte(parent_panel, first_panel_point, second_panel_point, third_panel_point); first_help_point(1) := first_panel_point(1); first_help_point(2) := first_panel_point(2); first_help_point(3) := first_panel_point(3); second_help_point(1) := second_panel_point(1); second_help_point(2) := second_panel_point(2); second_help_point(3) := second_panel_point(3); third_help_point(1) := third_panel_point(1); third_help_point(2) := third_panel_point(2); third_help_point(3) := third_panel_point(3); WENN (top_height > 0) DANN # front left point of the top panel help_point(1) := 0.0; help_point(2) := 0.0; help_point(3) := side_height; first_line_start(1) := help_point(1); first_line_start(2) := help_point(2); first_line_start(3) := help_point(3); first_line_end(1) := help_point(1); first_line_end(2) := help_point(2) + 100; first_line_end(3) := help_point(3); g3_schnitt_ge(first_panel_point, second_panel_point, third_panel_point, first_line_start, first_line_end, intersection_point, state); # ausgabe(0,"intersection_point(2) ",intersection_point(2)); y_distance := top_height / TAN(parent_slope_angle) + intersection_point(2) - thickness_diff_offset; # ausgabe(0,"y_distance ",y_distance); top_slope_angle := ARCTAN(top_height, y_distance); ENDE WENN (top_slope_angle >= parent_slope_angle) DANN top_slope_angle := 0; roof_param(24) := top_slope_angle; ENDE ENDE # ------------------------------------------------------------------- # calculate all coordinates of the dormer # ------------------------------------------------------------------- width := width + 2 * eaves_overhang + 2 * side_thickness; # front left point of the top panel xkoord(1) := 0.0; ykoord(1) := first_help_point(2); zkoord(1) := first_help_point(3); # front right point of the top panel xkoord(2) := roof_param(1); ykoord(2) := first_help_point(2); zkoord(2) := first_help_point(3); # we calculate the backside points of the dormer in case no panel # is given (cursor) xkoord(3) := xkoord(2); ykoord(3) := first_help_point(2) - roof_param(2); zkoord(3) := zkoord(2) + TAN(parent_slope_angle) * roof_param(2); zkoord(3) := zkoord(2); xkoord(4) := xkoord(1); ykoord(4) := first_help_point(2) - roof_param(2); zkoord(4) := zkoord(1) + TAN(parent_slope_angle) * roof_param(2); zkoord(4) := zkoord(2); # -------------------------------------------------------------------- # intersect the backside of the dormer with the panel # -------------------------------------------------------------------- WENN (parent_panel > 0) DANN WENN (kendicke = SCHALTER_AUS) DANN vert_thickness := dadicke / SIN(90 - top_slope_angle); SONST vert_thickness := dadicke; ENDE WENN thickness_diff_offset > 0 DANN # intersect the bottom edge with the bottom surface first_line_start(1) := xkoord(1); first_line_start(2) := ykoord(1); first_line_start(3) := zkoord(1); first_line_end(1) := xkoord(4); first_line_end(2) := ykoord(4); first_line_end(3) := zkoord(4); g3_schnitt_ge(first_help_point, second_help_point, third_help_point, first_line_start, first_line_end, intersection_point, state); # intersect the top edge with the top surface p1(1) := first_panel_point(1); p1(2) := first_panel_point(2); p1(3) := first_panel_point(3) + parent_vert_thickness; p2(1) := second_panel_point(1); p2(2) := second_panel_point(2); p2(3) := second_panel_point(3) + parent_vert_thickness; p3(1) := third_panel_point(1); p3(2) := third_panel_point(2); p3(3) := third_panel_point(3)+ parent_vert_thickness; first_line_start(3) := first_line_start(3) + vert_thickness; first_line_end(3) := first_line_end(3) + vert_thickness; g3_schnitt_ge(p1,p2,p3,first_line_start,first_line_end,intersection_point_top,state); dy := intersection_point(2) - intersection_point_top(2); first_line_start(1) := xkoord(2); first_line_start(2) := ykoord(2); first_line_start(3) := zkoord(2); first_line_end(1) := xkoord(3); first_line_end(2) := ykoord(3); first_line_end(3) := zkoord(3); g3_schnitt_ge(first_help_point, second_help_point, third_help_point, first_line_start, first_line_end, intersection_point, state); SONST # intersect the bottom edge with the bottom surface first_line_start(1) := xkoord(1); first_line_start(2) := ykoord(1); first_line_start(3) := zkoord(1); first_line_end(1) := xkoord(4); first_line_end(2) := ykoord(4); first_line_end(3) := zkoord(4); g3_schnitt_ge(first_help_point, second_help_point, third_help_point, first_line_start, first_line_end, intersection_point, state); first_line_start(1) := xkoord(2); first_line_start(2) := ykoord(2); first_line_start(3) := zkoord(2); first_line_end(1) := xkoord(3); first_line_end(2) := ykoord(3); first_line_end(3) := zkoord(3); g3_schnitt_ge(first_help_point, second_help_point, third_help_point, first_line_start, first_line_end, intersection_point, state); ENDE ENDE # ------------------------------------------------------------------- # transform the panels, so the origin of the opening # is in (0|0|side_height) # ------------------------------------------------------------------- # WENN (eaves_overhang > 0) ODER (side_thickness > 0) DANN # SCHLEIFE # FUER i := 1 # SCHRITT i := i + 1 # SOLANGE i <= 4; # xkoord(i) := xkoord(i) - eaves_overhang - side_thickness; # ENDE # ENDE WENN (verge_overhang > 0) DANN SCHLEIFE FUER i := 1 SCHRITT i := i + 1 SOLANGE i <= 2; ykoord(i) := ykoord(i) - verge_overhang; zkoord(i) := zkoord(i) - TAN(parent_slope_angle) * verge_overhang; ENDE ENDE # ------------------------------------------------------------------ # create the top panel # ------------------------------------------------------------------ # front left point of the top panel xkoord(1) := 0.0; ykoord(1) := first_help_point(2); zkoord(1) := first_help_point(3); # front right point of the top panel xkoord(2) := roof_param(1); ykoord(2) := first_help_point(2); zkoord(2) := first_help_point(3); # we calculate the backside points of the dormer in case no panel # is given (cursor) xkoord(3) := xkoord(2); ykoord(3) := first_help_point(2) - roof_param(2); zkoord(3) := zkoord(2) - TAN(parent_slope_angle) * roof_param(2); xkoord(4) := xkoord(1); ykoord(4) := first_help_point(2) - roof_param(2); zkoord(4) := zkoord(1) - TAN(parent_slope_angle) * roof_param(2); # dadicke := parent_dadicke; Dachflaeche(4, xkoord(1), ykoord(1), zkoord(1), flversch, flzeichn, 2, kendicke, dadicke, 600, n_top_panel); WENN (n_top_panel <= 0) DANN Box_Fehler(macro_name, 1, error_1); stop("", 1); ENDE # Gaubentraufe kanschni := LOTRECHT; kanwink := 0.0; kanttyp := 3032; edge_number := 1; Dachkante(n_top_panel, edge_number, kanttyp, kanschni, kanwink); # Gaubenortgang kanttyp := 3032; edge_number := 2; Dachkante(n_top_panel, edge_number, kanttyp, kanschni, kanwink); edge_number := 4; Dachkante(n_top_panel, edge_number, kanttyp, kanschni, kanwink); # Dachanschluss kanttyp := 3041; edge_number := 3; Dachkante(n_top_panel, edge_number, kanttyp, kanschni, kanwink); Kantenanschnitt(1) := LOTRECHT; Kantenanschnitt(2) := LOTRECHT; Kantenanschnitt(3) := LOTRECHT; Kantenanschnitt(4) := LOTRECHT; Kantenversatz(1) := 0; Kantenversatz(2) := 0; Kantenversatz(3) := 0; Kantenversatz(4) := 0; DACHFL_SCHICHT (n_top_panel, 2, 0, "Test_1", 0, 940, daDicke / 2, daDicke, Kantenversatz, Kantenanschnitt); ENDE
Answer Verified By: Sjanku
Hallo,
das ist super, freut mich, dass Sie das Problem lösen konnten.Auch vielen Dank für die Rückmeldung, dass die Arbeit nicht doppelt gemacht werden muss.
Weiterhin alles Gute und viel Erfolg mit Ihren Makros.Gruß S. Janku