In the first case, you should should create a curve instead of an array of Edges. Replace
edges = entities.add_edges([0, 560.mm, 0],[600.mm,560.mm,0],[600.mm,560.mm,720.mm],[0, 560.mm, 720.mm],[0, 560.mm, 0])
with
edges = entities.add_curve([0, 560.mm, 0],[600.mm,560.mm,0],[600.mm,560.mm,720.mm],[0, 560.mm, 720.mm],[0, 560.mm, 0])
In the second case, it looks like you want the base to be a semi-circle instead of a circle. You should replace
circle = entities.add_circle([0,ancho/2,0], X_AXIS, r, n)
base = entities.add_face(circle)
with
arc = entities.add_arc([0,ancho/2,0], [0, 0, 1], X_AXIS, r, 0.degrees, 180.degrees, n)
arc << entities.add_line(arc[arc.length-1].end, arc[0].start)
base = entities.add_face(arc)
Hope this at least gets you closer to solving your problems.
Matt