<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic How to duplicate a split schedule in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-duplicate-a-split-schedule/m-p/12045640#M11335</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My research came up fairly empty hence the post. I need to duplicate sheets via the API and I'm struggling to create exact duplicates of schedules that were split in two or more parts and placed on the same sheet.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm doing some tests on how to achieve that and I can manage to split a schedule using the&amp;nbsp;&lt;A href="https://www.revitapidocs.com/2023/c3f8f4e7-8430-f471-3a82-39e5c8f36bb8.htm" target="_blank" rel="noopener"&gt;Split(IList(Double))&lt;/A&gt; however, despite Revit Lookup telling me that my schedule is split, it's shown as one single schedule in the sheet.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Part 1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I split the schedule via the UI and collected their segment heights via the API (as I couldn't find that method in Revit Lookup).&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;var allScheduleSheetInstance = new FilteredElementCollector(doc, doc.ActiveView.Id).OfClass(typeof(ScheduleSheetInstance));
var splitSchedIds = new HashSet&amp;lt;ElementId&amp;gt;();

foreach (ScheduleSheetInstance schedInst in allScheduleSheetInstance)
{
	var viewSched = doc.GetElement(schedInst.ScheduleId) as ViewSchedule;
	
	if (!schedInst.IsTitleblockRevisionSchedule &amp;amp;&amp;amp; viewSched.IsSplit() == true)
	{
		splitSchedIds.Add(viewSched.Id);
	}
}

foreach (var splitSchedId in splitSchedIds)
{
	var viewSched = doc.GetElement(splitSchedId) as ViewSchedule;
	int segCount = viewSched.GetSegmentCount();

	for (int i = 0; i &amp;lt; segCount; i++)
	{
		TaskDialog.Show("Title", $"SEGMENT HEIGHT: {viewSched.GetSegmentHeight(i)}");
	}
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Part 2&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I then hard coded the heights as a list and passed it to Split() but no success as mentioned before. The schedule is reported as split but it looks the same in the sheet. Any help would be very appreciated.&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;var allScheduleSheetInstance = new FilteredElementCollector(doc, doc.ActiveView.Id).OfClass(typeof(ScheduleSheetInstance));

foreach (ScheduleSheetInstance schedInst in allScheduleSheetInstance)
{
	var viewSched = doc.GetElement(schedInst.ScheduleId) as ViewSchedule;
	
	if (!schedInst.IsTitleblockRevisionSchedule &amp;amp;&amp;amp; viewSched.IsSplit() == false)
	{
		var segHeights = new List&amp;lt;double&amp;gt;(){ 0.25, 0.34 };
		viewSched.Split(segHeights);
	}
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm finding the relationship between ScheduleSheetInstance and ViewSchedule very odd. I can have several instances of the same ViewSchedule in different sheets but the IsSplit() method can be found in the ViewSchedule class, not in ScheduleSheetInstance. Also, I can split a schedule in one sheet and leave it as a whole in another but both are reported as split.&lt;/P&gt;</description>
    <pubDate>Tue, 20 Jun 2023 03:21:14 GMT</pubDate>
    <dc:creator>floretti</dc:creator>
    <dc:date>2023-06-20T03:21:14Z</dc:date>
    <item>
      <title>How to duplicate a split schedule</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-duplicate-a-split-schedule/m-p/12045640#M11335</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My research came up fairly empty hence the post. I need to duplicate sheets via the API and I'm struggling to create exact duplicates of schedules that were split in two or more parts and placed on the same sheet.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm doing some tests on how to achieve that and I can manage to split a schedule using the&amp;nbsp;&lt;A href="https://www.revitapidocs.com/2023/c3f8f4e7-8430-f471-3a82-39e5c8f36bb8.htm" target="_blank" rel="noopener"&gt;Split(IList(Double))&lt;/A&gt; however, despite Revit Lookup telling me that my schedule is split, it's shown as one single schedule in the sheet.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Part 1&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I split the schedule via the UI and collected their segment heights via the API (as I couldn't find that method in Revit Lookup).&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;var allScheduleSheetInstance = new FilteredElementCollector(doc, doc.ActiveView.Id).OfClass(typeof(ScheduleSheetInstance));
var splitSchedIds = new HashSet&amp;lt;ElementId&amp;gt;();

foreach (ScheduleSheetInstance schedInst in allScheduleSheetInstance)
{
	var viewSched = doc.GetElement(schedInst.ScheduleId) as ViewSchedule;
	
	if (!schedInst.IsTitleblockRevisionSchedule &amp;amp;&amp;amp; viewSched.IsSplit() == true)
	{
		splitSchedIds.Add(viewSched.Id);
	}
}

foreach (var splitSchedId in splitSchedIds)
{
	var viewSched = doc.GetElement(splitSchedId) as ViewSchedule;
	int segCount = viewSched.GetSegmentCount();

	for (int i = 0; i &amp;lt; segCount; i++)
	{
		TaskDialog.Show("Title", $"SEGMENT HEIGHT: {viewSched.GetSegmentHeight(i)}");
	}
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Part 2&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I then hard coded the heights as a list and passed it to Split() but no success as mentioned before. The schedule is reported as split but it looks the same in the sheet. Any help would be very appreciated.&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;var allScheduleSheetInstance = new FilteredElementCollector(doc, doc.ActiveView.Id).OfClass(typeof(ScheduleSheetInstance));

foreach (ScheduleSheetInstance schedInst in allScheduleSheetInstance)
{
	var viewSched = doc.GetElement(schedInst.ScheduleId) as ViewSchedule;
	
	if (!schedInst.IsTitleblockRevisionSchedule &amp;amp;&amp;amp; viewSched.IsSplit() == false)
	{
		var segHeights = new List&amp;lt;double&amp;gt;(){ 0.25, 0.34 };
		viewSched.Split(segHeights);
	}
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm finding the relationship between ScheduleSheetInstance and ViewSchedule very odd. I can have several instances of the same ViewSchedule in different sheets but the IsSplit() method can be found in the ViewSchedule class, not in ScheduleSheetInstance. Also, I can split a schedule in one sheet and leave it as a whole in another but both are reported as split.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jun 2023 03:21:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-duplicate-a-split-schedule/m-p/12045640#M11335</guid>
      <dc:creator>floretti</dc:creator>
      <dc:date>2023-06-20T03:21:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to duplicate a split schedule</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-duplicate-a-split-schedule/m-p/12057041#M11336</link>
      <description>&lt;P&gt;Come on, forum! Give me something!&amp;nbsp;&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":face_with_tears_of_joy:"&gt;😂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jun 2023 21:14:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-duplicate-a-split-schedule/m-p/12057041#M11336</guid>
      <dc:creator>floretti</dc:creator>
      <dc:date>2023-06-23T21:14:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to duplicate a split schedule</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-duplicate-a-split-schedule/m-p/13117498#M11337</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5076730"&gt;@floretti&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;Were you able to find the solution? I'm facing the same issue.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Oct 2024 09:11:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-duplicate-a-split-schedule/m-p/13117498#M11337</guid>
      <dc:creator>V__K</dc:creator>
      <dc:date>2024-10-30T09:11:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to duplicate a split schedule</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-duplicate-a-split-schedule/m-p/13118814#M11338</link>
      <description>&lt;P&gt;i would say first, verify you are getting the correct&amp;nbsp; ScheduleSheetInstances in your collector. Consider the following image, the same schedule, one split one not:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ctm_mka_0-1730315828527.png" style="width: 571px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1427762i240A3BD8ECCD2ADB/image-dimensions/571x244?v=v2" width="571" height="244" role="button" title="ctm_mka_0-1730315828527.png" alt="ctm_mka_0-1730315828527.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Oct 2024 19:17:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-duplicate-a-split-schedule/m-p/13118814#M11338</guid>
      <dc:creator>ctm_mka</dc:creator>
      <dc:date>2024-10-30T19:17:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to duplicate a split schedule</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/how-to-duplicate-a-split-schedule/m-p/13118833#M11339</link>
      <description>&lt;P&gt;To add to that, i think the issue is you are looking at the ViewSchedule, which is the definition of the schedule. Instead i would focus more on the ScheduleSheetInsance, and duplicate those, you shouldnt need anything other than that.&lt;/P&gt;</description>
      <pubDate>Wed, 30 Oct 2024 19:26:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/how-to-duplicate-a-split-schedule/m-p/13118833#M11339</guid>
      <dc:creator>ctm_mka</dc:creator>
      <dc:date>2024-10-30T19:26:29Z</dc:date>
    </item>
  </channel>
</rss>

