- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am having problem understanding creation of sketches with extrusions using different Faces.
I have a simple cuboid part where there are several rectangle extrusions on the left face and there are several circular extrusions on the front face. Rectangle cutouts are created first and circular cutouts are created after the last rectangular cutout (bottom one):
As you can see the circular sketches are located outside of the front face.
If I don't create the bottom rectangle cutout - the circular sketches are created in the right place:
My suspicion is that the bottom rectangular cutout somehow modifies the front face.
But I don't understand why or how.
Before creating any cutouts I create a map of all faces and their respective internal names like so:
var faceNamesToInternalNames = new Dictionary < FaceName, string >
{
{ FaceName.Front, itemDefinition.SurfaceBodies[1].Faces[2].InternalName },
{ FaceName.Back, itemDefinition.SurfaceBodies[1].Faces[4].InternalName },
{ FaceName.Top, itemDefinition.SurfaceBodies[1].Faces[5].InternalName },
{ FaceName.Bottom, itemDefinition.SurfaceBodies[1].Faces[6].InternalName },
{ FaceName.Left, itemDefinition.SurfaceBodies[1].Faces[3].InternalName },
{ FaceName.Right, itemDefinition.SurfaceBodies[1].Faces[1].InternalName }
};
then I find the needed face like so:
var face = GetFaceById(partComponentDefinition, faceNamesToInternalNames[FaceName.FRONT]);
public Face GetFaceById(PartComponentDefinition itemDefinition, string faceName)
{
return itemDefinition.SurfaceBodies[1].Faces.Cast<Face>().First(face => face.InternalName.Equals(faceName));
}
then I create a sketch on the selected Face like so:
var sketch = partComponentDefinition.Sketches.Add(face);
var center = GetCenterPoint(FaceName.FRONT, _tg);
sketch.SketchCircles.AddByCenterRadius(center, diameter);
Can somebody please explain what I am doing wrong and how to fix this.
The solution of creating circular cutouts first doesn't fit as I have no control over the order of cutouts (they come in a JSON format from the server).
Solved! Go to Solution.