AnsweredAssumed Answered

C# Select top and bottom face

Question asked by Gabriel Lorenzo Yangzon on Jul 2, 2014
Latest reply on Jul 2, 2014 by Gabriel Lorenzo Yangzon

Hi guys

 

I have some problem selecting the top and bottom face of a rectangle

Is there anyway I can select only the top and bottom face of an object ?

 

 

Capture.PNG

heres my code:

 

Is there anyway I can select only the top and bottom face of an object ?

 

ModelDoc2 swDoc = ((ModelDoc2)(swApp.ActiveDoc));
            bool boolstatus = false;
            int i = 0;
            int ctr = 0;
            Feature ft = null;

            SelectionMgr swSelmgr = swDoc.SelectionManager;
            SelectData swSelData = (SelectData)swSelmgr.CreateSelectData();
            boolstatus = swDoc.Extension.SelectByID2("Thicken1", "BODYFEATURE", 0, 0, 0, false, 0, null, 0);
            Feature feat = swSelmgr.GetSelectedObject6(1,-1);

            object[] objFace = feat.GetFaces();

            foreach (Face fce in objFace)
            {                            
                ctr++;
                Entity swEntity = (Entity)fce;
                swEntity.Select2(false, 1);
                swDoc.ViewZoomToSelection();

                ft = swDoc.FeatureManager.InsertMoveFace2(0, true, 0, 0.7, 0, 0);               
            }

 

thanks

Gab

Outcomes