Assuming you wrap all of your code in a method inside your own module...
@x = 1.m unless @x @y = 1.m unless @y @z = 0.m unless @z results = inputbox(['X: ', 'Y: ', 'Z: '], [@x, @y, @z], 'Slicing Rectangle Dims') return nil unless results @x, @y, @z = results
BUT then you need to decide the values for each point...
If all of the slices are in plan then only the Z value is important.
Can I suggest you use:
bb = model.bounds min = bb.min max = bb.max
then a single input for the Z thus:
@z = 0.m unless @z results = inputbox(['Z: '], [@z], 'Slicing Height') return nil unless results @z = results[0]
Extract the x/y/z values from min and max and make the points for the face from those...
p1 = [min.x, min.y, @z] p2 = [max.x, min.y, @z] p3 = [max.x, max.y, @z] p4 = [min.x, max.y, @z]
later
entities_b.add_face(p1, p2, p3, p4)
Note how whe adding a face you only need the points for each vertex, if you were adding edges you need to add the extra 'p5' to close the loop.