Here's a little something I put together (using bits and pieces of code from all over mixed with my own).
It's fairly basic, and doesn't move the second part very far (you can customize where you want it to go by manipulating the oMatrix further). The process sure seems way to difficult/complex for the simplicity of what we're trying to do here, but hopefully they will create/expose more methods to improve it in the near future.
Dim oPDoc As PartDocument = ThisApplication.ActiveDocument
Dim oPDef As PartComponentDefinition = oPDoc.ComponentDefinition
Dim oTO As TransientObjects = ThisApplication.TransientObjects
Dim oTG As TransientGeometry = ThisApplication.TransientGeometry
Dim oTBrep As TransientBRep = ThisApplication.TransientBRep
Dim oBody As SurfaceBody = oPDef.SurfaceBodies.Item(1)
Dim oTBody As SurfaceBody = oTBrep.Copy(oBody)
Dim oMatrix As Inventor.Matrix = oTG.CreateMatrix()
Dim oVector As Vector = oTG.CreateVector(12,12,0)
oMatrix.SetTranslation(oVector)
oTBrep.Transform(oTBody, oMatrix)
Dim oNPBFDef As NonParametricBaseFeatureDefinition = oPDef.Features.NonParametricBaseFeatures.CreateDefinition
Dim oColl As ObjectCollection = oTO.CreateObjectCollection
oColl.Add(oTBody)
oNPBFDef.BRepEntities = oColl
oNPBFDef.OutputType = BaseFeatureOutputTypeEnum.kSolidOutputType
Dim oNPBFeat As NonParametricBaseFeature = oPDef.Features.NonParametricBaseFeatures.AddByDefinition(oNPBFDef)
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)