Yes, it is possible to generate a drawing sheet for each part and sub-assembly in an assembly using iLogic in Autodesk Inventor. Here's an example code that you can modify for your specific assembly structure:
' Get the active assembly document
Dim asmDoc As AssemblyDocument = ThisApplication.ActiveDocument
' Loop through all components in the assembly
For Each comp As ComponentOccurrence In asmDoc.ComponentDefinition.Occurrences
' Check if the component is a part or sub-assembly
If TypeOf comp.Definition Is PartComponentDefinition OrElse TypeOf comp.Definition Is SubassemblyComponentDefinition Then
' Get the document for the component
Dim doc As Document = comp.Definition.Document
' Check if the component has a drawing view
If doc.DocumentType = DocumentTypeEnum.kDrawingDocumentObject Then
' Get the drawing view
Dim dwgDoc As DrawingDocument = doc
Dim view As DrawingView = dwgDoc.ActiveSheet.DrawingViews.AddBaseView(comp, comp.Transformation)
' Set the view scale
view.Scale = 1
' Set the view style
view.Style = ThisApplication.ActiveDocument.StylesManager.ActiveStyle
' Set the view position
view.Position = ThisApplication.TransientGeometry.CreatePoint2d(0, 0)
' Set the view orientation
view.ViewOrientationType = DrawingViewOrientationTypeEnum.kNormalToViewPlane
view.ViewDirection = ThisApplication.TransientGeometry.CreateVector(0, 0, 1)
End If
End If
Next
This code will loop through all components in the active assembly document and check if they are parts or sub-assemblies. For each part or sub-assembly, it will check if there is a drawing document for that component. If there is, it will create a new drawing view for that component and set its scale, style, position, and orientation.
To customize this code for your specific assembly structure, you will need to modify the component selection criteria and the sheet naming convention. For example, you could use the component names to generate sheet names like "1-1-1", "1-1-2", "1-2-1", etc.