// HpD API plugin invoked from Workspace:
Workspace workspace = api.CurrentProject.GetActiveDocument() as Workspace;
// Get desired occurrence.
ILibraryOccurrence occurrence = workspace.GetAllOccurrences<ILibraryOccurrence>().FirstOrDefault();
// Add the occurrence to the SelectSet -> in the property panel are visible all properties of this occurrence.
workspace.SelectSet.Clear();
workspace.SelectSet.Add(occurrence);
// Get new value for property 'Manufacturer' of this occurrence.
LibraryPartNumber partNumber = occurrence.LibraryPart.PartNumbers.FirstOrDefault(n => n.Type == ApiPartNumberType.Manufacturer);
// Set the new value to the occurrence.
occurrence.Manufacturer = partNumber;
// The old value is still shown in the property panel.
// But the property returns correct value:
// LibraryPartNumber newPartNumber = occurrence.Manufacturer;
// It is neccessary to reload property panel.
workspace.ReloadPropertyPanel();
// Alternative way is to re-add the occurrence to the SelectSet.
// workspace.SelectSet.Clear();
// workspace.SelectSet.Add(occ);
// The new value is shown in the property panel now.