hi guys i have be learning ruby, after thomthom guided me to give it a try and also spent a good few days look at chris's video tuts and finally got me first script working as a compete snippet, looking to expand it
heres me first script
` module Gxm_blocktool
=begin
╔══════╗
║ MAIN ║
╚══════╝
=end
def Gxm_blocktool.main
# Input box <hope to change to mouse input
prompts = [("Width"),("Height"),("Depth")]
values = [32.inch, 32.inch, 32.inch]
results = inputbox prompts, values,("Box Dimensions")
return if not results
width, height, depth = results
model= Sketchup.active_model
model.start_operation("Create Box")
entities = model.active_entities
group = entities.add_group
entities = group.entities
pts = [[0,0,0], [width,0,0], [width,depth,0], [0,depth,0], [0,0,0]]
# add the face to a enntities in model
face = entities.add_face pts
status = face.pushpull -height, true
model.commit_operation
end
end
=begin
╔══════╗
║ MENU ║
╚══════╝
=end
unless file_loaded?(FILE)
mymenu = UI.menu('Plugins').add_submenu('GXM Plugin Collection')
mymenu.add_item('Block tool') {Gxm_blocktool.main}
end
file_loaded(FILE)`
Things i would like add to this, is mouse input data, instead of input box and try and group each cube face then extrude in and scale in egdes to form a hollow cube with no overlaying groups.
looking forward on feedback on my first script