Courtesy of Jamie Thomson, here’s some sample code showing how to create Analysis Services partitions from within an Integration Services package using AMO:
Although I should stress that if you’re using this in production, you do want to set the slice property on a partition to ensure you get the best possible performance in all cases.