[Inventor API] Problem with Thicken Command
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all
I am facing a problem with Thicken Command
Here is the code I use. It just normal is for each face of Solid [1], I will create the Thicken Feature. But when it run I just can create the thicken for the first Face, for the Second face of solid, it will be an error to access that face for Thicken Feature. So it means the problem is can not define the face after the first Thicken, I also tried to get the InternalName of Face after the first Thicken, the same error show.
SurfaceBody sb = partDef.SurfaceBodies[1];
sb.Name = "Panel";
foreach (Face face in sb. Faces)
{
FaceCollection FacesCol = default(FaceCollection);
FacesCol = _invApp.TransientObjects.CreateFaceCollection();
ThickenFeature oThickFeat = default(ThickenFeature);
FacesCol.Clear();
FacesCol.Add(face);
try
{
oThickFeat = partDef.Features.ThickenFeatures.Add(FacesCol, "1", PartFeatureExtentDirectionEnum.kNegativeExtentDirection, PartFeatureOperationEnum.kNewBodyOperation, false);
}
catch
{
MessageBox.Show("Error");
}
}
The error like the picture I attached
Have anybody met the same problem before, if someone knows it, please help me. Thank you so much.