I got this far
prompts = ["x:", "y:", "z:"]
defaults = [10, 20, 100]
input = UI.inputbox prompts, defaults, "Input data"
x = input[0]
y = imput[1]
z = imput[2]
model = Sketchup.active_model
ent = model.entities
sel = model.selection
model = Sketchup.active_model
entities = model.active_entities
pts = []
pts[0] = [0, 0, 0]
pts[1] = [x, 0, 0]
pts[2] = [x, y, 0]
pts[3] = [0, y, 0]
Add the face to the entities in the model
face = entities.add_face pts
I just happen to know that the second and third entities in the
entities objects are edges.
entity1 = entities[1]
entity2 = entities[2]
edges = entity1.all_connected
if (edges)
UI.messagebox edges.to_s
else
UI.messagebox "Failure"
end
faces = []
sel.each do |e|
if e.is_a? Sketchup::Face
faces.push e
end
end
Sketchup.active_model.start_operation "Wall"
faces.each do |e|
ent.add_group e
e.pushpull (z)
end
Sketchup.active_model.commit_operation
end
if( not file_loaded?('Wall.rb') )
UI.menu('Plugins').add_item('wall') {wall }
end
file_loaded 'Wall.rb'
I think I have to create a new entety for the faces theat are created to use it in push/pull ?