Try this. Just edit the value of the variable oThickness to whatever value you want, just keep in mind that this value will be understood as centimeters by the system, so you may have to either do some math or use a conversion tool.
This process assumes the first surface body within each part document is the main (and only) body, and that the first face in the faces collection is the one you would want to choose as the one to remove in the shell process. To be more specific about which face to remove, you would most likely have to name the right face within each part file, then find that named face within each part file within the code to use the right one. If you need to do it that way I can help, just let me know.
Here's the code.
Dim oADoc As AssemblyDocument = ThisAssembly.Document
Dim oPDoc As PartDocument
Dim oPDef As PartComponentDefinition
Dim oFaces As FaceCollection = ThisApplication.TransientObjects.CreateFaceCollection
Dim oBody As SurfaceBody
Dim oFace As Inventor.Face
Dim oShellFeats As ShellFeatures
Dim oShellDef As ShellDefinition
Dim oShelllFeat As ShellFeature
Dim oThickness As Double = .125
For Each oRefDoc As Document In oADoc.AllReferencedDocuments
If oRefDoc.DocumentType = DocumentTypeEnum.kPartDocumentObject Then
oPDoc = oRefDoc
oPDef = oPDoc.ComponentDefinition
oBody = oPDef.SurfaceBodies.Item(1)
oFace = oBody.Faces.Item(1)
oFaces.Add(oFace)
oShellFeats = oPDef.Features.ShellFeatures
oShellDef = oShellFeats.CreateShellDefinition(oFaces,oThickness,ShellDirectionEnum.kInsideShellDirection)
oShelllFeat = oShellFeats.Add(oShellDef)
End If
Next
If this solved your problem, or answered your question, please click ACCEPT SOLUTION.
Or, if this helped you, please click 'LIKE' 👍.
Vote For My IDEAS 💡and Explore My CONTRIBUTIONS
Inventor 2020 Help | Inventor Forum | Inventor Customization Forum | Inventor Ideas Forum
Wesley Crihfield

(Not an Autodesk Employee)