Blog · STEP · 1 Oct 2026 · Last updated 13 Oct 2026 · 5 min read · By Stefano B.

Inventor multi body part to assembly with iLogic, one part file per body

A STEP often arrives as one part with many solid bodies. To draw each one you need one part file per body. A tested iLogic rule that copies every body into its own part file and places them all in an assembly, plus the traps: bodies looked up by index, gaps in the numbering, bodies that will not delete.

Short answer: to go from an Inventor multi body part to assembly, copy each solid body with TransientBRep.Copy, put the copy in a new part with NonParametricBaseFeatures.Add, save it, and place it in an assembly with an identity matrix: every part lands where its body was. The bodies of the client's file are never changed. Find bodies by their Name, never by index.

Our test part from STEP, isometric view: one part file with five solid bodies, Solid1 the base plate, Solid3 a side plate, Solid5 and Solid8 two ribs, Solid9 a small plate, all in one coordinate system.
From this: one part, five solid bodies.
The same five bodies after the rule: five part files P-001 to P-005, from Solid1, Solid3, Solid5, Solid8 and Solid9, drawn at the same scale with their overall sizes in millimetres: 300 by 200, 200 by 150, 100 by 100, 100 by 100 and 100 by 50, all 10 thick.
To this: one part file per body, same volume, same position in the assembly.

We ran the code on this page as an iLogic rule in Inventor 2025, copied as it is (only sFolder changed), on a test part we modelled for it: seven plates in one part, saved as STEP, then two bodies removed to leave gaps in the numbering. The images are the drawing views of that part and of the files the rule wrote, exported to DXF and redrawn.

This came up on the Autodesk forum: multi-body part to assembly made by iLogic. This page is the long answer.

Why one file per body

A steel model often arrives as one STEP part with every plate as a solid body, all in one coordinate system. Our drawing rules work on one part file per plate, so the first step is one .ipt per plate.

The rule

Open the multi body part and run this rule (Manage > iLogic > Add Rule, paste, Save & Run):

Dim sFolder As String = "C:\Temp\split\"   ' must exist, ends with \
Dim sPrefix As String = "P-"                ' files P-001.ipt, P-002.ipt...

Dim oApp As Inventor.Application = ThisApplication
Dim oSrc As PartDocument = ThisDoc.Document
Dim sPartTpl As String = oApp.FileManager.GetTemplateFile(DocumentTypeEnum.kPartDocumentObject)
Dim sAsmTpl As String = oApp.FileManager.GetTemplateFile(DocumentTypeEnum.kAssemblyDocumentObject)
Dim oAsm As AssemblyDocument = oApp.Documents.Add(DocumentTypeEnum.kAssemblyDocumentObject, sAsmTpl, False)
Dim oPlace As Matrix = oApp.TransientGeometry.CreateMatrix()   ' identity: each part stays where its body was
Dim nPos As Integer = 0

For Each oBody As SurfaceBody In oSrc.ComponentDefinition.SurfaceBodies
    nPos += 1
    Dim oCopy As SurfaceBody = oApp.TransientBRep.Copy(oBody)   ' a copy: the source part is not touched
    Dim oNew As PartDocument = oApp.Documents.Add(DocumentTypeEnum.kPartDocumentObject, sPartTpl, False)
    oNew.ComponentDefinition.Features.NonParametricBaseFeatures.Add(oCopy)
    Dim sFile As String = sFolder & sPrefix & nPos.ToString("000") & ".ipt"
    oNew.SaveAs(sFile, False)
    oNew.Close(True)
    oAsm.ComponentDefinition.Occurrences.Add(sFile, oPlace)
Next

oAsm.SaveAs(sFolder & sPrefix & "assembly.iam", False)
oAsm.Close(True)

What to change:

On our test part the rule wrote five part files and an assembly with five occurrences. Each file holds one body with the same volume as its source body, and each occurrence sits exactly where that body was (same bounding box corner).

Find a body by name, not by index

Dim oFound As SurfaceBody = Nothing
For Each b As SurfaceBody In oSrc.ComponentDefinition.SurfaceBodies
    If b.Name = "Solid5" Then oFound = b : Exit For
Next

SurfaceBodies.Item(n) is a position in the list, not the number in the name. Our test STEP has five bodies: Solid1, Solid3, Solid5, Solid8, Solid9.

The test part with one body in orange: SurfaceBodies.Item(3) returns the body named Solid5, not Solid3, because the names have gaps. Item(9) gives an error although a body named Solid9 exists.
Item(3) is the third body in the list: here it is Solid5.

Traps

Trap What we measured Rule
SurfaceBodies.Item(3) Returns Solid5: the names have gaps, no error Loop and compare .Name
SurfaceBodies.Item(9) Error, although Solid9 exists: there are only 5 bodies Loop to the count; the highest number in a name can be higher
SurfaceBodies.Item("Solid5") Error: Conversion from string "Solid5" to type 'Integer' is not valid Loop and compare .Name
Body names after a STEP round trip Our 7 bodies Solid1…Solid7, saved as STEP and opened again, came back as Solid2…Solid8 Do not store body names across imports: read them from the file you split
SurfaceBody.Delete on a body from STEP Error (E_FAIL), the body stays Delete the NonParametricBaseFeature that holds it
Feature names Feature Solid2 holds body Solid1, feature Solid4 holds Solid3 Find the feature through its SurfaceBodies, not its name
SurfaceBody.Volume Needs an argument: Volume(0.001) Or use MassProperties.Volume of the new part

Putting a body back into the multi body part

Sometimes the reverse is needed: a part changed by hand must go back into the multi body part. The flow: read occ.Transformation, TransientBRep.Copy the body, TransientBRep.Transform it with that matrix, then NonParametricBaseFeatures.AddByDefinition.

Trap What we measured Fix
OutputType set to surface No new solid body; a work surface appears instead defi.OutputType = kSolidOutputType (90114)
Add(collection) Type mismatch AddByDefinition(defi) with defi.BRepEntities as an ObjectCollection
Matrix.AsArray from Python (late binding) Fails Read m.Cell(r, c), indices 1 to 4

Check: compare volumes before and after. On our test part every copy had the same volume as its source body.

Do and don't

Do

Don't

Questions people ask

Does it work on hundreds of bodies? The rule loops over every body; we ran it on five. On any count the check is the same: number of files and their volumes. In our work the AI agent writes and adapts the rule, Inventor runs it.

What name does each part get? Here a prefix and a position (P-001, P-002...). Codes are made final later, after identical parts are merged: merging identical parts and renumbering drawings. Next step for each part: choosing the base view for STEP parts, and for bent plates the flat pattern from a STEP solid.

References