admin管理员组

文章数量:1397166

In SOLIDWORKS, for a hole drawn by the wizardHole, it can be easily obtained through the hole feature in SOLIDWORKS, and its diameter and hole type can be obtained, but the hole drawn by extrusion cut, how to identify that the feature of the extruded cut is a hole? And to get information about its size, etc.?

  while ((swFeat != null))
            {
                Debug.Print(swFeat.Name.ToString());
                switch (swFeat.GetTypeName())
                {
                   

                    case "SM3dBend":

                        break;

                    case "SMMiteredFlange":

                        break;

                    case "Cut":

                        Body2 body = (Body2)swFeat.GetBody();
                        if (body != null)
                        {
                            Face2[] faces = body.GetFaces() as Face2[];
                            if (faces != null)
                            {
                                foreach (Face2 face in faces)
                                {
                                    Surface surf = (Surface)face.GetSurface();
                                    if (surf.IsCylinder()) 
                                    {
                                        Console.WriteLine(swFeat.Name);
                                    }
                                }
                            }
                        } 
                        break;

                    case "HoleWzd":

                        GetWizardHoleInfo(swFeat);

                        break;

                    case "FlatPattern":

                        GetFlatPatternLength(swFeat, swModel,partFile);

                        break;

                    }

                swFeat = (Feature)swFeat.GetNextFeature();
           
            }

本文标签: solidworksHow to distinguish holes drawn using extrude cutStack Overflow