Testing ruby code

Ruby code highlight

model = Sketchup.active_model
model.active_entities.clear!

texture_path = Sketchup.find_support_file('/Materials/Brick, Cladding and Siding/Brick Colored Blue.skm')
material = model.materials.load(texture_path)

points = [ # World space coordinates
  Geom::Point3d.new(  0,   0, 0),
  Geom::Point3d.new(1.m,   0, 0),
  Geom::Point3d.new(1.m, 1.m, 0),
  Geom::Point3d.new(  0, 1.m, 0),
]
face = model.active_entities.add_face(points)
face.reverse! unless face.normal.samedirection?(Z_AXIS)

Rb code highlight

model = Sketchup.active_model
model.active_entities.clear!

texture_path = Sketchup.find_support_file('/Materials/Brick, Cladding and Siding/Brick Colored Blue.skm')
material = model.materials.load(texture_path)

points = [ # World space coordinates
  Geom::Point3d.new(  0,   0, 0),
  Geom::Point3d.new(1.m,   0, 0),
  Geom::Point3d.new(1.m, 1.m, 0),
  Geom::Point3d.new(  0, 1.m, 0),
]
face = model.active_entities.add_face(points)
face.reverse! unless face.normal.samedirection?(Z_AXIS)