- Code: Select all
l=96
w=60
h=60
heel=8
slope=4
clr='Gray'
rfClr='blue'
ent = Sketchup.active_model.entities
#---------Clear All
Sketchup.active_model.entities.clear!
#----------------
model = Sketchup.active_model
model.start_operation "Create Box"
#-----------------------------------------------------------------------------
entities = model.active_entities
group = entities.add_group
entities = group.entities
group.name="Box"
@pt0 = [0, 0, 0]
@pt1 = [0, l*12, 0]
@pt2 = [w*12.0, l*12, 0]
@pt3 = [w*12, 0, 0]
newface = entities.add_face(@pt0, @pt1, @pt2, @pt3)
newface.material=Sketchup::Color.new clr
newface.reverse!
newface.pushpull h*12
group = entities.add_group
entities = group.entities
group.name="Top"
#-----------Top----------------
@pt0 = [0, 0, h*12]
@pt1 = [0, 0, h*12+heel]
@pt2 = [w*12/2, 0, 12*h+heel+(w/2)*slope]
@pt3 = [w*12, 0, 12*h+heel]
@pt4 = [w*12, 0, 12*h]
newface = entities.add_face(@pt0, @pt1, @pt2, @pt3, @pt4)
newface.material=Sketchup::Color.new rfClr
newface.pushpull l*12
Two different colors to the same shape
2 posts
• Page 1 of 1
Two different colors to the same shapeRe: Two different colors to the same shape
Please use 'code' blocks to format long Ruby extracts.
I've fixed your post for you this time... You need to find all 'vertical' faces in the group named 'Top'. After the last part of the code add this...
TIG
2 posts
• Page 1 of 1
|