InsertDome Not working

Hi,

I am trying to insert a dome on a face by selecting it using the Select4() method. However, this does not create the dome when the InsertDome call is made.

PartDoc part = (PartDoc)swModel;

            object[] arrBody = (object[])part.GetBodies2((int)swBodyType_e.swSolidBody, false);

            if (arrBody.Length > 0)

            {

                int i = 0;

                int currTopFace = 1;

                foreach (Body2 body in arrBody)

                {               

                    object[] faces = (object[])body.GetFaces();                                

                    foreach (Face2 f in faces)

                    {

//only faces 1,4,7,10,13..... must be used for the domes

                        part.SetEntityName(f, "face" + (i++));

                        if ((i - 1) == currTopFace)

                        {                                                       

                            ((Entity)f).Select4(true, swSelData);

                            swModel.InsertDome(0.00365, false, false);

                            swModel.EditRebuild3();

                            swModel.ClearSelection2(true);

                            currTopFace += 3;

                        }                       

                    }

                }

            }

Please advice.

SolidworksApi macros