Example #1
0
        internal void DuplicateSchedules(Subschedule template)
        {
            ViewSchedule vs = m_doc.GetElement(template.Id)
                              as ViewSchedule;

            template.Id =
                vs.Duplicate(ViewDuplicateOption.Duplicate);
        }
Example #2
0
 internal void DuplicateSchedule(ViewSchedule protoSchedule)
 {
     try
     {
         using (Transaction t =
                    new Transaction(m_doc, "Duplicate Schedule"))
         {
             t.Start();
             // Save the copied schedule's id
             m_createdScheduleId = protoSchedule
                                   .Duplicate(ViewDuplicateOption.Duplicate);
             t.Commit();
         }
     }
     catch (Exception)
     {
         throw new Exception("Failed to copy a schedule.");
     }
 }