/// Obtain workspace beforehand and open for writing.
Workspace workspace = ...
workspace.Open(false, false);
// Obtain a part from active library.
IEnumerable<BaseLibraryPart>parts = project.ActiveConnection.GetLibraryPartsByPartNumber("part1");
BaseLibraryPart part = parts.FirstOrDefault();
// Prepare position and rotation.
TransformProperty<LengthProperty> position =
new TransformProperty<LengthProperty>(new LengthProperty(1, Unit.Meter), new LengthProperty(0, Unit.Meter), new LengthProperty(0, Unit.Meter));
TransformProperty<AngleProperty> rotation =
new TransformProperty<AngleProperty>(new AngleProperty(0, Unit.Degree), new AngleProperty(0, Unit.Degree), new AngleProperty(0, Unit.Degree));
// Place a Part with mandatory and optional accessories.
workspace.PlacePart(part as BaseLibMechanicalPart, position, rotation , ApiLinkType.Optional | ApiLinkType.Mandatory);
// Or place a Part without accessories.
workspace.PlacePart(part as BaseLibMechanicalPart, position, rotation);