Create a polygon in Spaceclaim / Discovery
![Gabriel Messager](https://us.v-cdn.net/6037473/uploads/avatarstock/nXPEHISZX7D4V.png)
Gabriel Messager
Member, Employee Posts: 54
✭✭✭✭
![Ansys Employee](https://us.v-cdn.net/6037473/uploads/badges/RVRDV39KPJ91.png)
Comments
-
ClearAll() # Define the parameters innerRadius = MM(1) numSides = 6 extrusionHeight = MM(3) # Create the frame for the polygon frame = Frame.World # Create the polygon face poly = Polygon.Create(frame, innerRadius, numSides) segments = CurveSegment.Create(poly) design_curve = DesignCurve.Create(GetRootPart(),segments) result = Fill.Execute(Selection.Create(design_curve)) surface = Selection.Create(result.CreatedFaces[0]) options = ExtrudeFaceOptions() options.ExtrudeType = ExtrudeType.Add ExtrudeFaces.Execute(surface, extrusionHeight,options) design_curve.Delete() Selection.Empty().SetActive()
0