Working with Subassemblies in an Assembly

The Assembly object exposes several methods for working with its component Subassemblies. There are methods for adding, copying, inserting, mirroring, and replacing Subassemblies.

In this example, a stock subassembly is imported, then added to a drawing Assembly object, then mirrored:

// Add stock subassembly to drawing
ObjectId subassemblyId = _civildoc.SubassemblyCollection.ImportStockSubassembly("Imported subassembly", "Subassembly.BasicLane", offsetLocation);

// Add stock subassembly to assembly
AssemblyGroup assemblyGroup = assembly.AddSubassembly(subassemblyId);

// mirror subassembly
AssemblyGroup mirrorAssemblyGroup = assembly.MirrorSubassembly(subassemblyId);