Creating a cylinder?

I think it’s because the face is already created when you created the circle. Create a circle with a face and add a circle, you automatically get two nested faces. Trying to add another face is redundant and you get a nil.

If you create the larger circle first, then the smaller circle, then the face for the larger circle, and then the face for the smaller circle, you will get the result that you expect. Deleting the smaller face and extruding the larger face gives this:

  model = Sketchup.active_model
  entities = model.active_entities
  center = [0,0,0]
  vector = [0,0,1]
  radius = 2.0
  big_edges = entities.add_circle center, vector, radius
  small_edges = entities.add_circle center, vector, radius / 2.0
  big_face = entities.add_face(big_edges) 
  small_face = entities.add_face(small_edges)
  small_face.erase!
  big_face.reverse!
  big_face.pushpull 5.0

BTW, I’ve found Ruby to be more friendly if I use something like “diameter / 2.0” to force non-integer activity.

[added later]

If you want to add the circle to an existing face and delete the center of the washer, you might try something like this:

  model = Sketchup.active_model
  entities = model.active_entities
  center = [0,0,0]
  vector = [0,0,1]
  radius = 2.0
  big_edges = entities.add_circle center, vector, radius
  big_face = entities.add_face(big_edges) 
  small_edges = entities.add_circle center, vector, radius / 2.0
  faces = small_edges[0].faces
  faces[0].erase!
  big_face.reverse!
  big_face.pushpull 5.0

[added much later]

An alternate method to deleting the center face … since the addition of the smaller circle intersects the larger face and, as a result, adds another face to the entities, you can simply erase the last item added instead of using an edge to find the adjacent faces:

  model = Sketchup.active_model
  entities = model.active_entities
  center = [0,0,0]
  vector = [0,0,1]
  radius = 2.0
  height = 5.0
  big_edges = entities.add_circle center, vector, radius
  big_face = entities.add_face(big_edges) 
  entities.add_circle center, vector, radius / 2.0
  entities[-1].erase!
  big_face.reverse!
  big_face.pushpull height

An observation:

The API documentation says that the “add_face” command returns “a Face object if successful.” In the context of your particular use, the face is not created and the command returns nil. While this might be unexpected behavior, it doesn’t conflict with the description of the function.

[one more thing (my co-workers groan and roll their eyes when they hear me say this)]

Back to your original code … I modified it slightly to work around the nil issue:

  model = Sketchup.active_model
  entities = model.active_entities
  current_edges = entities.add_circle [0,0,0], [0,0,1], 2.0
  current_face = entities.add_face(current_edges)
  diameter = 2.0
#--------
  vector = current_face.normal
#  vector2 = vector.normalize!
#  entities = model.entities
  edgearray = entities.add_circle current_face.bounds.center, vector, diameter / 2.0
  face = entities.add_face(edgearray)
  if(face == nil)
    face = entities[-1]
  end
  face.pushpull 5.0