Accessing Bodies in Body Folders
The IBodyFolder
interface lets you access bodies in solid, surface, and various weldment
body folders.
If traversing the FeatureManager design tree,
then use IFeature::GetTypeName
to determine the type of feature. If the feature is any of the following
types, then you have a body folder feature:
SolidBodyFolder
SurfaceBodyFolder
CutListFolder
SubWeldFolder
SubAtomFolder
- or -
If you selected a folder and it is any of
the following types of folders, then you have a body folder feature:
swSelBODYFOLDER
swSelSUBATOMFOLDER
swSelSUBWELDFOLDER
NOTE:
A top-level folder feature named Cut
list is identified as SolidBodyFolder, a solid body folder feature.
Any subfolder feature named Cut-List-Item
is identified CutListFolder, a cut list subfolder feature.
Use IFeature::GetSpecificFeature2
to get the BodyFolder interface.
Use IBodyFolder::Type
to get the type of body folder.
Use these IBodyFolder methods to get the number
of bodies and the bodies in the folder: IBodyFolder::GetBodyCount
and IBodyFolder::GetBodies.
NOTE: These methods deal only with the bodies in the folder;
they do not include the bodies within any subfolders. You must use IFeature::GetFirstSubFeature
and IFeature::GetNextSubFeature
to traverse through the subfolders.
To get the feature for a body, use IBodyFolder::GetFeature.