List<StorableObject> lObjects = new List<StorableObject>();
lObjects.Add(oTestProject.Pages[0]); //Page with macro box - generates window macro
lObjects.Add(oTestProject.Pages[3]); //Page with macro definition - generates page macro
lObjects.Add(oTestProject.InstallationSpaces[0]); //InstallationSpace with macro definition - generates window macro
lObjects.Add(oMacroBox); //MacroBox - generates window macro
// Generate macros to default macros directory
new Masterdata().GenerateMacrosFromMacroProject(lObjects, null, null, true);