extract mid surface of a sheet/solid body

i have a assembly structure .i need to generate mid surface for each component and then translate the assy FILE into a parasolid at run time.

What NX command do you currently use to create the midsurfaces?

i am using builder class for mid surface.i have a assy file and need to collect all the solid bodies of each component and extract their mid surface by using builder class.builder class need a body tyoe arguments and i have full components list so for now i need to collect the solid bodies of each child part in assy and then extract a mid surface for each

Dim midSurfaceByFacePairsBuilder1 As NXOpen.Features.MidSurfaceByFacePairsBuilder

midSurfaceByFacePairsBuilder1
=workPart.Features.CreateMidSurfaceByFacePairsBuilder(nullNXOpen_Features_Feature)

Pushpendra Sharma
KBE & Customization

If you have a reference to a component, you can get a reference to the part object. Once you have a reference to the part, you can iterate through the .Bodies collection to get the solid bodies of interest.

Dim myComponent as Assemblies.Component
myComponent = {some component}

dim myPart as Part = myComponent.Prototype.OwningPart
for each tempBody as body in myPart.Bodies
'do something
next