Ruby Script: Datentyp Integer verwenden
#1
Hallo,

ich habe hier ein Ruby Script welches soweit auch tadellos funktioniert. Dieses Script fragt Korpusmaße ab und die Anzahl der Fronten die übereinander bzw. nebeneinander angeordnet werden sollen und wie breit die Fugen dazwischen sein sollen, bzw. ob die Fronten links oder rechts überstehen sollen.

Dabei ist die Front, wenn nicht "Sonderanfertigung" allseitig 2 mm kleiner als der Korpus, bzw. wenn die Fuge oberhalb der Front 30 mm beträgt, bekommt der Korpus eine Ausklinkung. Alles soweit gut und es funktioniert.

Ich weiß, dass der Korpus 810 mm hoch wird, wenn ich den Wert in der Abfrage nicht ändere. Wenn ich in der Korpusabfrage nun sage, dass ich zwei Fronten übereinander haben möchte, dann werden nacheinander die Fronten und Fugen abgefragt.

Ergo müsste es möglich sein bei der zweiten Front zu sagen, dass er die Korpushöhe minus der Frontfuge oben (der ersten Front) minus der Höhe der ersten Front und minus der Frontfuge unten (der ersten Front) errechnen soll und anstelle des im Script fettmarkierten Fronthöhenwertes bei der Abfrage der zweiten Front zumindest vorschlägt.

Wenn ich nun bei dem Vorschlagswert der zweiten Front anstelle der rot markierten 158 mm dort reinschreiben würde “zz(korpushöhe)-fso1(Frontspalt oben erste Front)-fh1(Frontteilhöhe erste Front)-fsu1(Frontspalte unten erste Front)“ bekomme ich einen Fließkommazahl in der Abfrage angezeigt. Wenn ich die bestätige bekomme ich zwar das gewünschte Ergebnis aber wenn ich den Wert wieder mit 158 überschreibe, dann wird die zweite Front halt nicht mehr 158 mm hoch sondern um ein x-faches höher (undefiniert und unberechenbar).

Lange Rede kurzer Sinn, wie bekomme ich es hin, dass er mit ganzen Zahlen rechnet und keine Fließkommazahlen auswirft, die nicht zuzuordnen sind?

jemand eine Idee?

Hier das Script...

Code:
#------------------------------------------------------------------------------- require 'sketchup.rb' require 'new2/nmat1.rb' def new2_xu     prompts = [hs, os, us, breite, hoehe, tiefe, fanzahlv, fanzahlh, rwstaerke]     values = [0, 0, 1, 600.mm, 810.mm, 625.mm, 1, 1, 8.mm]       results = inputbox prompts, values, nav120       return if not results       hs, os, us, xx, zz, yy, fav, fah, r1 = results         d1 = 19.mm         z1 = 19.mm   fah = 2 if fah>2 if yy<=525.mm rws = 25.mm else rws = 48.mm end if fav>=1 prompts = [spaltoben1, fhoehe1, spaltunten1, fbreite1, fstaerke1, fabstand1, fueberstandl1, fueberstandr1, fueberstandu1]   values = [30.mm, 158.mm, 30.mm, xx, 19.mm, 3.mm, -2.mm, -2.mm, 0.mm]       results = inputbox prompts, values, nav111       return if not results     fso1, fh1, fsu1, fbr1, fst1, fab1, ful1, fur1, fuu1 = results model = Sketchup.active_model     model.start_operation "1.Front"   entities = model.active_entities group = entities.add_group entities = group.entities   pts = [] pts[0] = [0.mm-ful1, 0.mm-fst1-fab1, zz-fso1-fh1] pts[1] = [0.mm-ful1, 0.mm-fab1, zz-fso1-fh1] pts[2] = [0.mm-ful1, 0.mm-fab1, zz-fso1] pts[3] = [0.mm-ful1, 0.mm-fst1-fab1, zz-fso1]             base = entities.add_face pts       base.pushpull fbr1+ful1+fur1             model.commit_operation         group.name = "Front1" if fso1>29.mm tra = 49.mm end if fso1<29.mm tra = 0.mm end end if fav>=2 prompts = [spaltoben2, fhoehe2, spaltunten2, fbreite2, fstaerke2, fabstand2, fueberstandl2, fueberstandr2, fueberstandu2]   values = [fsu1, [color=#C14700][b]158.mm[/b][/color], 30.mm, xx, 19.mm, 3.mm, -2.mm, -2.mm, 0.mm]       results = inputbox prompts, values, nav112       return if not results     fso2, fh2, fsu2, fbr2, fst2, fab2, ful2, fur2, fuu2 = results model = Sketchup.active_model     model.start_operation "2.Front"   entities = model.active_entities group = entities.add_group entities = group.entities   pts = [] pts[0] = [0.mm-ful2, 0.mm-fst2-fab2, zz-fso1-fh1-fso2-fh2] pts[1] = [0.mm-ful2, 0.mm-fab2, zz-fso1-fh1-fso2-fh2] pts[2] = [0.mm-ful2, 0.mm-fab2, zz-fso1-fh1-fso2] pts[3] = [0.mm-ful2, 0.mm-fst2-fab2, zz-fso1-fh1-fso2]             base = entities.add_face pts       base.pushpull fbr2+ful2+fur2, true             model.commit_operation         group.name = "Front2" else fso2=0 end if fav>=3 prompts = [fhoehe3, spaltoben3, fbreite3, fstaerke3, fabstand3, fueberstandl3, fueberstandr3, fueberstandu3]   values = [158.mm, fsu2, xx, 19.mm, 3.mm, -2.mm, -2.mm, 0.mm]       results = inputbox prompts, values, nav113       return if not results     fh3, fso3, fbr3, fst3, fab3, ful3, fur3, fuu3 = results model = Sketchup.active_model     model.start_operation "3.Front"   entities = model.active_entities group = entities.add_group entities = group.entities   pts = [] pts[0] = [0.mm-ful3, 0.mm-fst3-fab3, zz-fso1-fh1-fso2-fh2-fso3-fh3] pts[1] = [0.mm-ful3, 0.mm-fab3, zz-fso1-fh1-fso2-fh2-fso3-fh3] pts[2] = [0.mm-ful3, 0.mm-fab3, zz-fso1-fh1-fso2-fh2-fso3] pts[3] = [0.mm-ful3, 0.mm-fst3-fab3, zz-fso1-fh1-fso2-fh2-fso3]             base = entities.add_face pts       base.pushpull fbr3+ful3+fur3             model.commit_operation         group.name = "Front3" else fso3=0 end if fav>=4 prompts = [fhoehe4, spaltoben4, fbreite4, fstaerke4, fabstand4, fueberstandl4, fueberstandr4, fueberstandu4]   values = [778.mm, 30.mm, xx, 19.mm, 3.mm, -2.mm, -2.mm, 0.mm]       results = inputbox prompts, values, nav114       return if not results     fh4, fso4, fbr4, fst4, fab4, ful4, fur4, fuu4 = results model = Sketchup.active_model     model.start_operation "4.Front"   entities = model.active_entities group = entities.add_group entities = group.entities   pts = [] pts[0] = [0.mm-ful4, 0.mm-fst4-fab4, zz-fso1-fh1-fso2-fh2-fso3-fh3-fso4-fh4] pts[1] = [0.mm-ful4, 0.mm-fab4, zz-fso1-fh1-fso2-fh2-fso3-fh3-fso4-fh4] pts[2] = [0.mm-ful4, 0.mm-fab4, zz-fso1-fh1-fso2-fh2-fso3-fh3-fso4] pts[3] = [0.mm-ful4, 0.mm-fst4-fab4, zz-fso1-fh1-fso2-fh2-fso3-fh3-fso4]             base = entities.add_face pts       base.pushpull fbr4+ful4+fur4             model.commit_operation         group.name = "Front4" else fso4=0 end if fav>=5 prompts = [fhoehe5, spaltoben5, fbreite5, fstaerke5, fabstand5, fueberstandl5, fueberstandr5, fueberstandu5]   values = [778.mm, 30.mm, xx, 19.mm, 3.mm, -2.mm, -2.mm, 0.mm]       results = inputbox prompts, values, nav115       return if not results     fh5, fso5, fbr5, fst5, fab5, ful5, fur5, fuu5 = results model = Sketchup.active_model     model.start_operation "5.Front"   entities = model.active_entities group = entities.add_group entities = group.entities   pts = [] pts[0] = [0.mm-ful5, 0.mm-fst5-fab5, zz-fso1-fh1-fso2-fh2-fso3-fh3-fso4-fh4-fso5-fh5] pts[1] = [0.mm-ful5, 0.mm-fab5, zz-fso1-fh1-fso2-fh2-fso3-fh3-fso4-fh4-fso5-fh5] pts[2] = [0.mm-ful5, 0.mm-fab5, zz-fso1-fh1-fso2-fh2-fso3-fh3-fso4-fh4-fso5] pts[3] = [0.mm-ful5, 0.mm-fst5-fab5, zz-fso1-fh1-fso2-fh2-fso3-fh3-fso4-fh4-fso5]             base = entities.add_face pts       base.pushpull fbr5+ful5+fur5             model.commit_operation         group.name = "Front5" else fso5=0 end if fav>=6 prompts = [fhoehe6, spaltoben6, fbreite6, fstaerke6, fabstand6, fueberstandl6, fueberstandr6, fueberstandu6]   values = [778.mm, 30.mm, xx, 19.mm, 3.mm, -2.mm, -2.mm, 0.mm]       results = inputbox prompts, values, nav116       return if not results     fh6, fso6, fbr6, fst6, fab6, ful6, fur6, fuu6 = results model = Sketchup.active_model     model.start_operation "6.Front"   entities = model.active_entities group = entities.add_group entities = group.entities   pts = [] pts[0] = [0.mm-ful6, 0.mm-fst6-fab6, zz-fso1-fh1-fso2-fh2-fso3-fh3-fso4-fh4-fso5-fh5-fso6-fh6] pts[1] = [0.mm-ful6, 0.mm-fab6, zz-fso1-fh1-fso2-fh2-fso3-fh3-fso4-fh4-fso5-fh5-fso6-fh6] pts[2] = [0.mm-ful6, 0.mm-fab6, zz-fso1-fh1-fso2-fh2-fso3-fh3-fso4-fh4-fso5-fh5-fso6] pts[3] = [0.mm-ful6, 0.mm-fst6-fab6, zz-fso1-fh1-fso2-fh2-fso3-fh3-fso4-fh4-fso5-fh5-fso6]             base = entities.add_face pts       base.pushpull fbr6+ful6+fur6             model.commit_operation         group.name = "Front6" else fso6=0 end if fav>=7 prompts = [fhoehe7, spaltoben7, fbreite7, fstaerke7, fabstand7, fueberstandl7, fueberstandr7, fueberstandu7]   values = [778.mm, 30.mm, xx, 19.mm, 3.mm, -2.mm, -2.mm, 0.mm]       results = inputbox prompts, values, nav117       return if not results     fh7, fso7, fbr7, fst7, fab7, ful7, fur7, fuu7 = results model = Sketchup.active_model     model.start_operation "7.Front"   entities = model.active_entities group = entities.add_group entities = group.entities   pts = [] pts[0] = [0.mm-ful7, 0.mm-fst7-fab7, zz-fso1-fh1-fso2-fh2-fso3-fh3-fso4-fh4-fso5-fh5-fso6-fh6-fso7-fh7] pts[1] = [0.mm-ful7, 0.mm-fab7, zz-fso1-fh1-fso2-fh2-fso3-fh3-fso4-fh4-fso5-fh5-fso6-fh6-fso7-fh7] pts[2] = [0.mm-ful7, 0.mm-fab7, zz-fso1-fh1-fso2-fh2-fso3-fh3-fso4-fh4-fso5-fh5-fso6-fh6-fso7] pts[3] = [0.mm-ful7, 0.mm-fst7-fab7, zz-fso1-fh1-fso2-fh2-fso3-fh3-fso4-fh4-fso5-fh5-fso6-fh6-fso7]             base = entities.add_face pts       base.pushpull fbr7+ful7+fur7             model.commit_operation         group.name = "Front7" else fso7=0 end if fav>=8 prompts = [fhoehe8, spaltoben8, fbreite8, fstaerke8, fabstand8, fueberstandl8, fueberstandr8, fueberstandu8]   values = [778.mm, 30.mm, xx, 19.mm, 3.mm, -2.mm, -2.mm, 0.mm]       results = inputbox prompts, values, nav118       return if not results     fh8, fso8, fbr8, fst8, fab8, ful8, fur8, fuu8 = results model = Sketchup.active_model     model.start_operation "8.Front"   entities = model.active_entities group = entities.add_group entities = group.entities   pts = [] pts[0] = [0.mm-ful8, 0.mm-fst8-fab8, zz-fso1-fh1-fso2-fh2-fso3-fh3-fso4-fh4-fso5-fh5-fso6-fh6-fso7-fh7-fso8-fh8] pts[1] = [0.mm-ful8, 0.mm-fab8, zz-fso1-fh1-fso2-fh2-fso3-fh3-fso4-fh4-fso5-fh5-fso6-fh6-fso7-fh7-fso8-fh8] pts[2] = [0.mm-ful8, 0.mm-fab8, zz-fso1-fh1-fso2-fh2-fso3-fh3-fso4-fh4-fso5-fh5-fso6-fh6-fso7-fh7-fso8] pts[3] = [0.mm-ful8, 0.mm-fst8-fab8, zz-fso1-fh1-fso2-fh2-fso3-fh3-fso4-fh4-fso5-fh5-fso6-fh6-fso7-fh7-fso8]             base = entities.add_face pts       base.pushpull fbr8+ful8+fur8             model.commit_operation         group.name = "Front8" else fso8=0 end if fah>=2 if fav>=1 prompts = [fhoehe9, spaltoben9, fbreite9, fstaerke9, fabstand9, fueberstandl9, fueberstandr9, fueberstandu9]   values = [778.mm, 30.mm, xx, 19.mm, 3.mm, -2.mm, -2.mm, 0.mm]       results = inputbox prompts, values, nav119       return if not results     fh9, fso9, fbr9, fst9, fab9, ful9, fur9, fuu9 = results model = Sketchup.active_model       model.start_operation "1.Frontrechts"       entities = model.active_entities       group = entities.add_group       entities = group.entities         pts = []     pts[0] = [fbr1-ful9, -fab9, zz-fso9]     pts[1] = [fbr1+fbr9+fur9, -fab9, zz-fso9]     pts[2] = [fbr1+fbr9+fur9, -fst9-fab9, zz-fso9]     pts[3] = [fbr1-ful9, -fst9-fab9, zz-fso9]       base = entities.add_face pts         base.pushpull fh9             model.commit_operation         group.name = "Frontrechts1" end if fav>=2 prompts = [fhoehe10, spaltoben10, fbreite10, fstaerke10, fabstand10, fueberstandl10, fueberstandr10, fueberstandu10]   values = [778.mm, 30.mm, xx, 19.mm, 3.mm, -2.mm, -2.mm, 0.mm]       results = inputbox prompts, values, nav121       return if not results     fh10, fso10, fbr10, fst10, fab10, ful10, fur10, fuu10 = results model = Sketchup.active_model     model.start_operation "2.Frontrechts"   entities = model.active_entities group = entities.add_group entities = group.entities   pts = [] pts[0] = [fbr2-ful10, 0.mm-fst10-fab10, zz-fso9-fh9-fso10-fh10] pts[1] = [fbr2-ful10, 0.mm-fab10, zz-fso1-fh9-fso10-fh10] pts[2] = [fbr2-ful10, 0.mm-fab10, zz-fso1-fh9-fso10] pts[3] = [fbr2-ful10, 0.mm-fst10-fab10, zz-fso9-fh9-fso10]             base = entities.add_face pts       base.pushpull fbr10+ful10+fur10, true             model.commit_operation         group.name = "Frontrechts2" end end ## model = Sketchup.active_model       model.start_operation "korpus"       entities = model.active_entities       group = entities.add_group       entities = group.entities #seite links         pts = []     pts[0] = [0.mm, 0.mm, 0.mm]     pts[1] = [0.mm, 0.mm, zz]     pts[2] = [0.mm, yy, zz]     pts[3] = [0.mm, yy, 0.mm]             face = entities.add_face pts         status = face.pushpull -d1, true if fso1>29.mm         pts = []     pts[0] = [0.mm, 0.mm, zz-64.mm]     pts[1] = [0.mm, 0.mm, zz]     pts[2] = [0.mm, +49.mm, zz]     pts[3] = [0.mm, +49.mm, zz-64.mm]             face = entities.add_face pts         status = face.pushpull +d1, false end if fso2>29.mm         pts = []     pts[0] = [0.mm, 0.mm, zz-fso1-fh1+fuu1]     pts[1] = [0.mm, 0.mm, zz-fso1-fh1-64.mm]     pts[2] = [0.mm, +49.mm, zz-fso1-fh1-64.mm]     pts[3] = [0.mm, +49.mm, zz-fso1-fh1+fuu1]             face = entities.add_face pts         status = face.pushpull +d1, false end if fso3>29.mm         pts = []     pts[0] = [0.mm, 0.mm, zz-fso1-fh1-fso2-fh2+fuu2]     pts[1] = [0.mm, 0.mm, zz-fso1-fh1-fso2-fh2-64.mm]     pts[2] = [0.mm, +49.mm, zz-fso1-fh1-fso2-fh2-64.mm]     pts[3] = [0.mm, +49.mm, zz-fso1-fh1-fso2-fh2+fuu2]             face = entities.add_face pts         status = face.pushpull +d1, false end if fso4>29.mm         pts = []     pts[0] = [0.mm, 0.mm, zz-fso1-fh1-fso2-fh2-fso3-fh3+fuu3]     pts[1] = [0.mm, 0.mm, zz-fso1-fh1-fso2-fh2-fso3-fh3-64.mm]     pts[2] = [0.mm, +49.mm, zz-fso1-fh1-fso2-fh2-fso3-fh3-64.mm]     pts[3] = [0.mm, +49.mm, zz-fso1-fh1-fso2-fh2-fso3-fh3+fuu3]             face = entities.add_face pts         status = face.pushpull +d1, false end if fso5>29.mm         pts = []     pts[0] = [0.mm, 0.mm, zz-fso1-fh1-fso2-fh2-fso3-fh3-fso4-fh4+fuu4]     pts[1] = [0.mm, 0.mm, zz-fso1-fh1-fso2-fh2-fso3-fh3-fso4-fh4-64.mm]     pts[2] = [0.mm, +49.mm, zz-fso1-fh1-fso2-fh2-fso3-fh3-fso4-fh4-64.mm]     pts[3] = [0.mm, +49.mm, zz-fso1-fh1-fso2-fh2-fso3-fh3-fso4-fh4+fuu4]             face = entities.add_face pts         status = face.pushpull +d1, false end if fso6>29.mm         pts = []     pts[0] = [0.mm, 0.mm, zz-fso1-fh1-fso2-fh2-fso3-fh3-fso4-fh4-fso5-fh5+fuu5]     pts[1] = [0.mm, 0.mm, zz-fso1-fh1-fso2-fh2-fso3-fh3-fso4-fh4-fso5-fh5-64.mm]     pts[2] = [0.mm, +49.mm, zz-fso1-fh1-fso2-fh2-fso3-fh3-fso4-fh4-fso5-fh5-64.mm]     pts[3] = [0.mm, +49.mm, zz-fso1-fh1-fso2-fh2-fso3-fh3-fso4-fh4-fso5-fh5+fuu5]             face = entities.add_face pts         status = face.pushpull +d1, false end if fso7>29.mm         pts = []     pts[0] = [0.mm, 0.mm, zz-fso1-fh1-fso2-fh2-fso3-fh3-fso4-fh4-fso5-fh5-fso6-fh6+fuu6]     pts[1] = [0.mm, 0.mm, zz-fso1-fh1-fso2-fh2-fso3-fh3-fso4-fh4-fso5-fh5-fso6-fh6-64.mm]     pts[2] = [0.mm, +49.mm, zz-fso1-fh1-fso2-fh2-fso3-fh3-fso4-fh4-fso5-fh5-fso6-fh6-64.mm]     pts[3] = [0.mm, +49.mm, zz-fso1-fh1-fso2-fh2-fso3-fh3-fso4-fh4-fso5-fh5-fso6-fh6+fuu6]             face = entities.add_face pts         status = face.pushpull +d1, false end if fso8>29.mm         pts = []     pts[0] = [0.mm, 0.mm, zz-fso1-fh1-fso2-fh2-fso3-fh3-fso4-fh4-fso5-fh5-fso6-fh6-fso7-fh7+fuu7]     pts[1] = [0.mm, 0.mm, zz-fso1-fh1-fso2-fh2-fso3-fh3-fso4-fh4-fso5-fh5-fso6-fh6-fso7-fh7-64.mm]     pts[2] = [0.mm, +49.mm, zz-fso1-fh1-fso2-fh2-fso3-fh3-fso4-fh4-fso5-fh5-fso6-fh6-fso7-fh7-64.mm]     pts[3] = [0.mm, +49.mm, zz-fso1-fh1-fso2-fh2-fso3-fh3-fso4-fh4-fso5-fh5-fso6-fh6-fso7-fh7+fuu7]             face = entities.add_face pts         status = face.pushpull +d1, false end #seite rechts         pts = []     pts[0] = [xx-d1, 0.mm, 0.mm]     pts[1] = [xx-d1, 0.mm, zz]     pts[2] = [xx-d1, yy, zz]     pts[3] = [xx-d1, yy, 0.mm]             face = entities.add_face pts         status = face.pushpull -d1, true if fso1>29.mm         pts = []     pts[0] = [xx-d1, 0.mm, zz-64.mm]     pts[1] = [xx-d1, 0.mm, zz]     pts[2] = [xx-d1, +49.mm, zz]     pts[3] = [xx-d1, +49.mm, zz-64.mm]             face = entities.add_face pts         status = face.pushpull +d1, false end if fso2>29.mm         pts = []     pts[0] = [xx-d1, 0.mm, zz-fso1-fh1+fuu1]     pts[1] = [xx-d1, 0.mm, zz-fso1-fh1-64.mm]     pts[2] = [xx-d1, +49.mm, zz-fso1-fh1-64.mm]     pts[3] = [xx-d1, +49.mm, zz-fso1-fh1+fuu1]             face = entities.add_face pts         status = face.pushpull +d1, false end if fso3>29.mm         pts = []     pts[0] = [xx-d1, 0.mm, zz-fso1-fh1-fso2-fh2+fuu2]     pts[1] = [xx-d1, 0.mm, zz-fso1-fh1-fso2-fh2-64.mm]     pts[2] = [xx-d1, +49.mm, zz-fso1-fh1-fso2-fh2-64.mm]     pts[3] = [xx-d1, +49.mm, zz-fso1-fh1-fso2-fh2+fuu2]             face = entities.add_face pts         status = face.pushpull +d1, false end if fso4>29.mm         pts = []     pts[0] = [xx-d1, 0.mm, zz-fso1-fh1-fso2-fh2-fso3-fh3+fuu3]     pts[1] = [xx-d1, 0.mm, zz-fso1-fh1-fso2-fh2-fso3-fh3-64.mm]     pts[2] = [xx-d1, +49.mm, zz-fso1-fh1-fso2-fh2-fso3-fh3-64.mm]     pts[3] = [xx-d1, +49.mm, zz-fso1-fh1-fso2-fh2-fso3-fh3+fuu3]             face = entities.add_face pts         status = face.pushpull +d1, false end if fso5>29.mm         pts = []     pts[0] = [xx-d1, 0.mm, zz-fso1-fh1-fso2-fh2-fso3-fh3-fso4-fh4+fuu4]     pts[1] = [xx-d1, 0.mm, zz-fso1-fh1-fso2-fh2-fso3-fh3-fso4-fh4-64.mm]     pts[2] = [xx-d1, +49.mm, zz-fso1-fh1-fso2-fh2-fso3-fh3-fso4-fh4-64.mm]     pts[3] = [xx-d1, +49.mm, zz-fso1-fh1-fso2-fh2-fso3-fh3-fso4-fh4+fuu4]             face = entities.add_face pts         status = face.pushpull +d1, false end if fso6>29.mm         pts = []     pts[0] = [xx-d1, 0.mm, zz-fso1-fh1-fso2-fh2-fso3-fh3-fso4-fh4-fso5-fh5+fuu5]     pts[1] = [xx-d1, 0.mm, zz-fso1-fh1-fso2-fh2-fso3-fh3-fso4-fh4-fso5-fh5-64.mm]     pts[2] = [xx-d1, +49.mm, zz-fso1-fh1-fso2-fh2-fso3-fh3-fso4-fh4-fso5-fh5-64.mm]     pts[3] = [xx-d1, +49.mm, zz-fso1-fh1-fso2-fh2-fso3-fh3-fso4-fh4-fso5-fh5+fuu5]             face = entities.add_face pts         status = face.pushpull +d1, false end if fso7>29.mm         pts = []     pts[0] = [xx-d1, 0.mm, zz-fso1-fh1-fso2-fh2-fso3-fh3-fso4-fh4-fso5-fh5-fso6-fh6+fuu6]     pts[1] = [xx-d1, 0.mm, zz-fso1-fh1-fso2-fh2-fso3-fh3-fso4-fh4-fso5-fh5-fso6-fh6-64.mm]     pts[2] = [xx-d1, +49.mm, zz-fso1-fh1-fso2-fh2-fso3-fh3-fso4-fh4-fso5-fh5-fso6-fh6-64.mm]     pts[3] = [xx-d1, +49.mm, zz-fso1-fh1-fso2-fh2-fso3-fh3-fso4-fh4-fso5-fh5-fso6-fh6+fuu6]             face = entities.add_face pts         status = face.pushpull +d1, false end if fso8>29.mm         pts = []     pts[0] = [xx-d1, 0.mm, zz-fso1-fh1-fso2-fh2-fso3-fh3-fso4-fh4-fso5-fh5-fso6-fh6-fso7-fh7+fuu7]     pts[1] = [xx-d1, 0.mm, zz-fso1-fh1-fso2-fh2-fso3-fh3-fso4-fh4-fso5-fh5-fso6-fh6-fso7-fh7-64.mm]     pts[2] = [xx-d1, +49.mm, zz-fso1-fh1-fso2-fh2-fso3-fh3-fso4-fh4-fso5-fh5-fso6-fh6-fso7-fh7-64.mm]     pts[3] = [xx-d1, +49.mm, zz-fso1-fh1-fso2-fh2-fso3-fh3-fso4-fh4-fso5-fh5-fso6-fh6-fso7-fh7+fuu7]             face = entities.add_face pts         status = face.pushpull +d1, false end #boden if us > 0         pts = []     pts[0] = [0.mm+d1, 0.mm, 0.mm]     pts[1] = [xx-d1, 0.mm,  0.mm]     pts[2] = [xx-d1, yy-rws,  0.mm]     pts[3] = [0.mm+d1, yy-rws,  0.mm]           face = entities.add_face pts         status = face.pushpull -z1, true end if os > 0         pts = []     pts[0] = [0.mm+d1, 0.mm, 0.mm]     pts[1] = [xx-d1, 0.mm,  0.mm]     pts[2] = [xx-d1, yy,  0.mm]     pts[3] = [0.mm+d1, yy,  0.mm]           face = entities.add_face pts         status = face.pushpull -z1, true end if hs > 0         pts = []     pts[0] = [0.mm+d1, 0.mm, 0.mm]     pts[1] = [xx-d1, 0.mm,  0.mm]     pts[2] = [xx-d1, yy-rws,  0.mm]     pts[3] = [0.mm+d1, yy-rws,  0.mm]           face = entities.add_face pts         status = face.pushpull -z1, true end #traverse1 if us > 0 # #        pts = [] #    pts[0] = [0.mm+d1, 0.mm+yy-48.mm-56.mm, 0.mm+zz] #    pts[1] = [0.mm+xx-d1, 0.mm+yy-48.mm-56.mm, 0.mm+zz] #    pts[2] = [0.mm+xx-d1, yy-48.mm, 0.mm+zz] #    pts[3] = [0.mm+d1, yy-48.mm, 0.mm+zz] # #            face = entities.add_face pts #        status = face.pushpull -z1, true #traverse2 #        pts = [] #    pts[0] = [0.mm+d1, tra, 0.mm+zz] #    pts[1] = [0.mm+xx-d1, tra, 0.mm+zz] #    pts[2] = [0.mm+xx-d1, yy-48.mm, 0.mm+zz] #    pts[3] = [0.mm+d1, yy-48.mm, 0.mm+zz] # #            face = entities.add_face pts #        status = face.pushpull -z1, true end #boden2 if us > 0         pts = []     pts[0] = [0.mm+d1, tra, 0.mm+zz]     pts[1] = [0.mm+xx-d1, tra, 0.mm+zz]     pts[2] = [0.mm+xx-d1, yy-rws, 0.mm+zz]     pts[3] = [0.mm+d1, yy-rws, 0.mm+zz]             face = entities.add_face pts         status = face.pushpull -z1, true end if hs > 0         pts = []     pts[0] = [0.mm+d1, tra, 0.mm+zz]     pts[1] = [0.mm+xx-d1, tra, 0.mm+zz]     pts[2] = [0.mm+xx-d1, yy-rws, 0.mm+zz]     pts[3] = [0.mm+d1, yy-rws, 0.mm+zz]             face = entities.add_face pts         status = face.pushpull -z1, true end if os > 0         pts = []     pts[0] = [0.mm+d1, 0.mm, 0.mm+zz]     pts[1] = [0.mm+xx-d1, 0.mm, 0.mm+zz]     pts[2] = [0.mm+xx-d1, yy, 0.mm+zz]     pts[3] = [0.mm+d1, yy, 0.mm+zz]             face = entities.add_face pts         status = face.pushpull -z1, true end #ruecken if us > 0         pts = []     pts[0] = [d1, 0.mm+yy-rws, zz]     pts[1] = [xx-d1, 0.mm+yy-rws, zz]     pts[2] = [xx-d1, 0.mm+yy+r1-rws, zz]     pts[3] = [d1, 0.mm+yy+r1-rws, zz]         base = entities.add_face pts         base.pushpull +zz, true end if os > 0         pts = []     pts[0] = [d1, 0.mm+yy-rws, zz-19.mm]     pts[1] = [xx-d1, 0.mm+yy-rws, zz-19.mm]     pts[2] = [xx-d1, 0.mm+yy+r1-rws, zz-19.mm]     pts[3] = [d1, 0.mm+yy+r1-rws, zz-19.mm]         base = entities.add_face pts         base.pushpull +zz-38.mm, true end if hs > 0         pts = []     pts[0] = [d1, 0.mm+yy-rws, zz]     pts[1] = [xx-d1, 0.mm+yy-rws, zz]     pts[2] = [xx-d1, 0.mm+yy+r1-rws, zz]     pts[3] = [d1, 0.mm+yy+r1-rws, zz]         base = entities.add_face pts         base.pushpull +zz, true end         model.commit_operation         group.name = "korpus" ## end if( not file_loaded?("new2_xu.rb") ) end #----------------------------------------------------------------------------- file_loaded("new2_xu.rb")
Zitieren
#2
Viele Ruby-Fragen wurde hier noch nicht gestellt, ich vermute, dass die Programmierer-Dichte im englischen Forum deutlich höher ist, ich würde auch eine parallele Frage dort empfehlen.
Zitieren
#3
Hallo,

danke für die Antwort, eigentlich schade, dass das so ist, Ruby erweitert die Möglichkeiten von Sketchup enorm. Schade dass es so wenig deutschsprachige Personen gibt, die ein Interesse daran haben, sich damit zu beschäftigen.

Ein englischsprachiges Forum dürfte dann doch vom Verständnis eher schwieriger werden, es reicht für normale Kommunikation und ein wenig Business Englisch, dann ist aber auch schnell ein Ende erreicht.

Danke dennoch für den Tipp

Gruß

Jörg
Zitieren
#4
das zugehörige Unterforum des Hersteller-Forums hier.


Norbert
Zitieren


Möglicherweise verwandte Themen…
Thema Verfasser Antworten Ansichten Letzter Beitrag
  Ruby TMIX Ulrich Wolf 4 12.726 08.04.2014 - 12:49
Letzter Beitrag: Ulrich Wolf
Question Plug in / ruby Programmierung Matthias 2 9.443 11.12.2013 - 09:06
Letzter Beitrag: netfeed

Gehe zu:


Benutzer, die gerade dieses Thema anschauen: 1 Gast/Gäste