0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

sketchupでruby その20

Last updated at Posted at 2022-02-11

#概要

sketchupでrubyやってみた。
練習問題やってみた。

#練習問題

お宅のぶどう園、見せて。

#写真

budo.jpg

#環境

windows vista
sketchup 8

#サンプルコード

def loadtest2
   model = Sketchup.active_model
   entities = model.active_entities
   path = Sketchup.find_support_file "ki2.skp", "Plugins/"
   definitions = model.definitions
   componentdefinition = definitions.load path
   for x in 0..5 do
     for y in 0..1 do
       point = Geom::Point3d.new 200 * x, 300 * y, 0
       transform = Geom::Transformation.new point
       instance = entities.add_instance componentdefinition, transform
     end
   end
end




#実行手順

  • pluginsにrbファイルを置く
  • 起動時に読み込む
  • rubyコンソールから呼び出す

以上。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?