Good case.
iLogic “can” automate this procedure via direct calls to Inventor API objects. My sample rule implements slightly modified method. It wasn’t tested much (see screenshot).
Please copy this code into the rule in your manifold part and run the rule.
Hope it will help you as a good start point for your own “magic” rule.
IMHO for this task it is better to use Inventor API and any .NET developing tool (VB, C#,…). Really I developed and tested this code in the form of VB.NET EXE application (because Visual Studio has excellent debugger) and only then copied resulting code into iLogic rule with very little modifications.


Sub Main
'Step 0: reference to active part
Dim oSourcePartDoc As PartDocument _
= CType(ThisApplication.ActiveDocument, PartDocument)
' Dim oSourcePartDoc As PartDocument = CType(ThisDoc.Document, PartDocument)
'Step 1: create outer body Body2 using shrinkwrap
Dim oOuterPartDoc As PartDocument = ShrinkWrap(oSourcePartDoc)
'Step 2: create new part derived source and shrinkwrap bodies
' and subtract Body1 (source) from Body2 (outer)
Dim oResultDoc As PartDocument = SubtractPart(oSourcePartDoc, oOuterPartDoc)
oResultDoc.Views.Add()
ThisApplication.SilentOperation = True
Call oOuterPartDoc.Save()
Call oOuterPartDoc.Close()
ThisApplication.SilentOperation = False
Beep()
End Sub 'Main
Function ShrinkWrap(ByVal oSourcePartDoc As PartDocument) As PartDocument
Dim oTG As TransientGeometry = ThisApplication.TransientGeometry
'active project workspace path
Dim oProjectManager As DesignProjectManager = ThisApplication.DesignProjectManager
Dim oActiveDesignProject As DesignProject = oProjectManager.ActiveDesignProject
Dim WorkspacePath As String = oActiveDesignProject.WorkspacePath
' Create new assembly document
Dim oAssyDoc As AssemblyDocument = CType(ThisApplication.Documents _
.Add(DocumentTypeEnum.kAssemblyDocumentObject, , False), _
AssemblyDocument)
'assembly definition
Dim oAssyDef As AssemblyComponentDefinition = oAssyDoc.ComponentDefinition
'Add the source component
Dim oMatrix As Matrix = oTG.CreateMatrix
Dim oOcc As ComponentOccurrence = oAssyDef.Occurrences _
.AddByComponentDefinition(CType( _
oSourcePartDoc.ComponentDefinition, _
ComponentDefinition), oMatrix)
oOcc.Name = "Manifold"
' create filename for this assembly and save it
Dim AssyFilename As String = WorkspacePath & "\TemporaryAssy.iam"
' MsgBox(AssyFilename)
ThisApplication.SilentOperation = True
oAssyDoc.SaveAs(AssyFilename, False)
ThisApplication.SilentOperation = False
' MsgBox("Saved")
' Create a new part document that will be the shrinkwrap substitute
Dim oPartDoc As PartDocument = CType(ThisApplication.Documents _
.Add(DocumentTypeEnum.kPartDocumentObject, , False), _
PartDocument)
Dim oPartDef As PartComponentDefinition = oPartDoc.ComponentDefinition
Dim oDerivedAssemblyDef As DerivedAssemblyDefinition _
= oPartDef.ReferenceComponents.DerivedAssemblyComponents _
.CreateDefinition(oAssyDoc.FullDocumentName)
' Set various shrinkwrap related options
oDerivedAssemblyDef.DeriveStyle _
= DerivedComponentStyleEnum.kDeriveAsSingleBodyNoSeams
oDerivedAssemblyDef.IncludeAllTopLeveliMateDefinitions _
= DerivedComponentOptionEnum.kDerivedExcludeAll
oDerivedAssemblyDef.IncludeAllTopLevelParameters _
= DerivedComponentOptionEnum.kDerivedExcludeAll
oDerivedAssemblyDef.ReducedMemoryMode = True
Call oDerivedAssemblyDef.SetHolePatchingOptions( _
DerivedHolePatchEnum.kDerivedPatchAll)
' Create the shrinkwrap component
Dim oDerivedAssembly As DerivedAssemblyComponent _
= oPartDef.ReferenceComponents.DerivedAssemblyComponents _
.Add(oDerivedAssemblyDef)
' Save the part
Dim PartFilename As String = WorkspacePath & "\OuterPart.ipt"
ThisApplication.SilentOperation = True
Call oPartDoc.SaveAs(PartFilename, False)
ThisApplication.SilentOperation = False
' Create a substitute level of detail using the shrinkwrap part.
Dim oSubstituteLOD As LevelOfDetailRepresentation = oAssyDef _
.RepresentationsManager.LevelOfDetailRepresentations _
.AddSubstitute(PartFilename)
oSubstituteLOD.Name = "OuterBody"
ThisApplication.SilentOperation = True
Call oAssyDoc.Save()
Call oAssyDoc.Close()
ThisApplication.SilentOperation = False
Return oPartDoc
End Function 'ShrinkWrap
Function SubtractPart(ByVal oSourcePartDoc As PartDocument, _
ByVal oOuterPartDoc As PartDocument) _
As PartDocument
'create new part
Dim oDoc As PartDocument = CType(ThisApplication.Documents _
.Add(DocumentTypeEnum.kPartDocumentObject, , False), _
PartDocument)
Dim oDef As PartComponentDefinition = oDoc.ComponentDefinition
' Create the derived part 1 - Source body
Dim oDerivedPartDef As DerivedPartUniformScaleDef _
= oDef.ReferenceComponents.DerivedPartComponents _
.CreateUniformScaleDef(oSourcePartDoc.FullFileName)
Call oDef.ReferenceComponents.DerivedPartComponents _
.Add(CType(oDerivedPartDef, DerivedPartDefinition))
' Create the derived part 2 - Outer body
oDerivedPartDef = oDef.ReferenceComponents.DerivedPartComponents _
.CreateUniformScaleDef(oOuterPartDoc.FullFileName)
Call oDef.ReferenceComponents.DerivedPartComponents _
.Add(CType(oDerivedPartDef, DerivedPartDefinition))
'Subtract bodies
Dim oColl As ObjectCollection = ThisApplication _
.TransientObjects.CreateObjectCollection
Dim oCombineFeatures As CombineFeatures = oDef.Features.CombineFeatures
Dim oBody1 As SurfaceBody = oDef.SurfaceBodies.Item(1)
Dim oBody2 As SurfaceBody = oDef.SurfaceBodies.Item(2)
Call oColl.Add(oBody1)
Dim oCF As CombineFeature = oCombineFeatures _
.Add(oBody2, oColl, PartFeatureOperationEnum.kCutOperation, False)
Return oDoc
End Function 'SubtractPart
Vladimir Ananyev
Developer Technical Services
Autodesk Developer Network