How i can do this in Ruby?

ruby

#1

Hello I have a example on Youtube. I tried to perform it but cant. How i can do it?
MyCodes;

model = Sketchup.active_model
entities = model.entities
(1…52).each { |i|
group = model.active_entities.add_group
yk = i5
yk2 = yk-5
orjin = Geom::Point3d.new(1, 1, yk2.cm)
orjin1 = Geom::Point3d.new(1, 1, yk.cm)
cember = group.entities.add_circle(orjin, Z_AXIS, (75-i+10).cm, 6)
#Baslangıc,Boyut,Yarıcap,Kacge7
cember1 = group.entities.add_circle(orjin1, Z_AXIS, (75-i+10).cm, 6)
face = group.entities.add_face(cember)
path = group.entities.add_edges(orjin,orjin1)
face.back_material = [(157),(163),(13)]
face.followme(path)
rot_angle = (i
4).degrees
rot_transformation = Geom::Transformation.rotation(ORIGIN,Z_AXIS,rot_angle)
group.transform!(rot_transformation)

}

Youtube Link: https://www.youtube.com/watch?v=OOGhTMeoufI


#2

Please edit your post so that it is within a ‘code’ block - 'backticks [`].
As it is currently formatted [as a quote?] some characters are missing in the published version, and others are affected in other ways.
Like yk = i5 generates an error.
I expect you mean yk = i*5 ?
The rogue * makes the characters in between it into ‘italics
There’s a similar issue with the later i4 which as you i*4 it’s read as the closing code for the ‘italics’…
I’ve had to ‘escape’ them here using \*

Once we have the intended code we can test it an advise you properly…