概要
windows11に、sketchup6を入れてみた。
rubyで、3Dを書く。
UI.start_timer使ってみた。
写真
サンプルコード
$n = -10
def run
model = Sketchup.active_model
entities = model.active_entities
group = entities.add_group
entitie = group.entities
$n += 1
x = $n
z = 0
y = 0
pts = []
pts[0] = [x * 10 + 5, y * 10 + 5, z * 10 + 5]
pts[1] = [x * 10 + 10, y * 10 + 5, z * 10 + 5]
pts[2] = [x * 10 + 10, y * 10 + 10, z * 10 + 5]
pts[3] = [x * 10 + 5, y * 10 + 10, z * 10 + 5]
base = entitie.add_face pts
base.pushpull 5
puts $n
end
def start1
id = UI.start_timer(3, true) {
run
}
end
以上。