<?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 Re: Quick way of counting rows in a schedule? in Revit API Forum</title>
    <link>https://forums.autodesk.com/t5/revit-api-forum/quick-way-of-counting-rows-in-a-schedule/m-p/5805805#M70681</link>
    <description>&lt;P&gt;tnx..&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Both solutions is needed I guess.. Am going to Count number of rows, and then get the value of the n^th element to make a new filer and create a duplicate schedule so that it fits a spesific sheet.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think this is a major missing feature in Revit, the ability to easy print a schedule over multiple sheets..&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 07 Sep 2015 07:25:25 GMT</pubDate>
    <dc:creator>daniel</dc:creator>
    <dc:date>2015-09-07T07:25:25Z</dc:date>
    <item>
      <title>Quick way of counting rows in a schedule?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/quick-way-of-counting-rows-in-a-schedule/m-p/5800112#M70677</link>
      <description>&lt;P&gt;HI,&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was trying to get hold of the number of elements visible in a schedule.&amp;nbsp;&lt;/P&gt;&lt;P&gt;First I thought that I just could check if a spesific element was visible in the spesific schedule, but that turnd out not work, due to&amp;nbsp;&lt;/P&gt;&lt;P&gt;"non view spesific" behavior of som elements.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone have a tip on how to do this?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I really want the schedule api to expose a counter of some kind, but until that happens, some workaround needs to be found ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any tips ?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Daniel&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 02 Sep 2015 16:20:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/quick-way-of-counting-rows-in-a-schedule/m-p/5800112#M70677</guid>
      <dc:creator>daniel</dc:creator>
      <dc:date>2015-09-02T16:20:39Z</dc:date>
    </item>
    <item>
      <title>Re: Quick way of counting rows in a schedule?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/quick-way-of-counting-rows-in-a-schedule/m-p/5803067#M70678</link>
      <description>&lt;P&gt;Hi daniel,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;as far as I know, there is no way to get the ElementId of a schedule's row.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;There is an ugly workaround:&lt;/P&gt;&lt;P&gt;Add a new schedule field containing a newly added parameter.&lt;/P&gt;&lt;P&gt;Fill that parameter with the ElementId's value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now you have the row/element relation which can be used to count displayed elements.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After doing so, rollback your transaction.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Revitalizer&lt;/P&gt;</description>
      <pubDate>Fri, 04 Sep 2015 07:48:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/quick-way-of-counting-rows-in-a-schedule/m-p/5803067#M70678</guid>
      <dc:creator>Revitalizer</dc:creator>
      <dc:date>2015-09-04T07:48:01Z</dc:date>
    </item>
    <item>
      <title>Re: Quick way of counting rows in a schedule?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/quick-way-of-counting-rows-in-a-schedule/m-p/5803570#M70679</link>
      <description>&lt;P&gt;If all you want is the number of rows in a shcedule, why don't you use the TableData?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;TableData table = schedule.GetTableData();
Assert.IsNotNull(table);

TableSectionData section = table.GetSectionData(SectionType.Body);
Assert.IsNotNull(section);

in nRows = section.NumberOfRows;
// note: the rows include the first blank one, if there is any&lt;/PRE&gt;</description>
      <pubDate>Fri, 04 Sep 2015 13:53:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/quick-way-of-counting-rows-in-a-schedule/m-p/5803570#M70679</guid>
      <dc:creator>arnostlobel</dc:creator>
      <dc:date>2015-09-04T13:53:36Z</dc:date>
    </item>
    <item>
      <title>Re: Quick way of counting rows in a schedule?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/quick-way-of-counting-rows-in-a-schedule/m-p/5803583#M70680</link>
      <description>&lt;P&gt;Hi Arnost,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;of course you are right.&lt;/P&gt;&lt;P&gt;I thought that daniel wanted the element relation, too.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Have a nice weekend,&lt;/P&gt;&lt;P&gt;Revitalizer&lt;/P&gt;</description>
      <pubDate>Fri, 04 Sep 2015 14:00:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/quick-way-of-counting-rows-in-a-schedule/m-p/5803583#M70680</guid>
      <dc:creator>Revitalizer</dc:creator>
      <dc:date>2015-09-04T14:00:10Z</dc:date>
    </item>
    <item>
      <title>Re: Quick way of counting rows in a schedule?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/quick-way-of-counting-rows-in-a-schedule/m-p/5805805#M70681</link>
      <description>&lt;P&gt;tnx..&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Both solutions is needed I guess.. Am going to Count number of rows, and then get the value of the n^th element to make a new filer and create a duplicate schedule so that it fits a spesific sheet.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think this is a major missing feature in Revit, the ability to easy print a schedule over multiple sheets..&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Sep 2015 07:25:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/quick-way-of-counting-rows-in-a-schedule/m-p/5805805#M70681</guid>
      <dc:creator>daniel</dc:creator>
      <dc:date>2015-09-07T07:25:25Z</dc:date>
    </item>
    <item>
      <title>Re: Quick way of counting rows in a schedule?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/quick-way-of-counting-rows-in-a-schedule/m-p/8484935#M70682</link>
      <description>&lt;P&gt;&lt;SPAN&gt;What to do in case if&amp;nbsp;IsItemized = False?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 22 Dec 2018 16:38:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/quick-way-of-counting-rows-in-a-schedule/m-p/8484935#M70682</guid>
      <dc:creator>CJModis</dc:creator>
      <dc:date>2018-12-22T16:38:33Z</dc:date>
    </item>
    <item>
      <title>Re: Quick way of counting rows in a schedule?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/quick-way-of-counting-rows-in-a-schedule/m-p/8495405#M70683</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;that's&amp;nbsp; a good question (and I wonder why nobody asked it before).&lt;/P&gt;
&lt;P&gt;I think the relation (element-&amp;gt;row) is &lt;EM&gt;lost&lt;/EM&gt; in that case.&lt;/P&gt;
&lt;P&gt;One could get the parameter values in the desired row and get the matching elements by parameter comparison.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As there may be formula fields in a row, it needs to be tested if one can reproduce an element's proposed value by getting the List of TableCellCombinedParameterData from a given cell,&lt;/P&gt;
&lt;P&gt;IList&amp;lt;TableCellCombinedParameterData&amp;gt; TableSectionData.GetCellCombinedParameters(int nRow,int nCol)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Not tested, yet.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Revitalizer&lt;/P&gt;</description>
      <pubDate>Wed, 02 Jan 2019 09:56:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/quick-way-of-counting-rows-in-a-schedule/m-p/8495405#M70683</guid>
      <dc:creator>Revitalizer</dc:creator>
      <dc:date>2019-01-02T09:56:44Z</dc:date>
    </item>
    <item>
      <title>Re: Quick way of counting rows in a schedule?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/quick-way-of-counting-rows-in-a-schedule/m-p/8497051#M70684</link>
      <description>&lt;P&gt;You can find all the elements in a schedule using a FilteredElementCollector(document, scheduleview.Id).&lt;/P&gt;
&lt;P&gt;Delete a row from the schedule in a temporary transaction and compare the elements before and after to determine the Elements on a row in the schedule.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;public void CountScheduleEntriesOnRow()
 {
   StringBuilder sb = new StringBuilder();
   Document doc = this.ActiveUIDocument.Document;
   ViewSchedule view = doc.ActiveView as ViewSchedule;
   if (view==null) return;
   TableData table =  view.GetTableData();
   TableSectionData section = table.GetSectionData(SectionType.Body);

   List&amp;lt;ElementId&amp;gt; elems = new FilteredElementCollector(doc,view.Id)
        	.ToElementIds()
        	.ToList();
   List&amp;lt;Element&amp;gt; ElementsOnRow = new List&amp;lt;Element&amp;gt;();
   List&amp;lt;ElementId&amp;gt; Remaining = null;
   int RowToAnalyse = 2;

   using(Transaction t = new Transaction(doc,"dummy"))
	{
		t.Start();
		using (SubTransaction st = new SubTransaction(doc))
		{
			st.Start();
			section.RemoveRow(RowToAnalyse);
			st.Commit();
		}
		Remaining = new FilteredElementCollector(doc,view.Id)
			.ToElementIds()
			.ToList();
		t.RollBack();
	}
   foreach(ElementId id in elems)
   {
      	if(Remaining.Contains(id)) continue;
       	ElementsOnRow.Add(doc.GetElement(id));
   }
   sb.AppendLine(string.Format("{0} elements on row {1}",ElementsOnRow.Count,RowToAnalyse));
   foreach(Element e in ElementsOnRow)
   {
      	sb.AppendLine(string.Format("&amp;lt;{0}&amp;gt; {1} {2}",e.Id,e.Name, e.GetType()));
   }
   TaskDialog.Show("debug",sb.ToString());
}
&lt;/PRE&gt;</description>
      <pubDate>Wed, 02 Jan 2019 23:27:22 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/quick-way-of-counting-rows-in-a-schedule/m-p/8497051#M70684</guid>
      <dc:creator>FAIR59</dc:creator>
      <dc:date>2019-01-02T23:27:22Z</dc:date>
    </item>
    <item>
      <title>Re: Quick way of counting rows in a schedule?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/quick-way-of-counting-rows-in-a-schedule/m-p/9387778#M70685</link>
      <description>&lt;P&gt;I have a very quick non-traditional solution to this. &lt;STRONG&gt;This is for those people who just want to count the number of rows just to find the number of items. Not for extracting the numbers or Ids for programming.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Go to your schedule. (I'm using a space schedule for this example.)&lt;/LI&gt;&lt;LI&gt;Select cells from any columns of all the rows that you want counted. (Click and drag)&lt;/LI&gt;&lt;LI&gt;Right click on one of the cells and select "Delete Row"(You're not actually deleting them) from drop down menu. Then a dialog box appears that says "This will delete &lt;U&gt;&lt;STRONG&gt;32&lt;/STRONG&gt;&lt;/U&gt; selected spaces and any associated space tags". (There's your number of rows.) Make sure you hit cancel so you don't actually delete them. Or in case you did click "Ok" you can always undo it.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Like I said, it's not an ideal solution. But its quick and doesn't require you to follow lots of extra steps.&lt;/P&gt;</description>
      <pubDate>Thu, 19 Mar 2020 16:36:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/quick-way-of-counting-rows-in-a-schedule/m-p/9387778#M70685</guid>
      <dc:creator>Bishesh.M</dc:creator>
      <dc:date>2020-03-19T16:36:36Z</dc:date>
    </item>
    <item>
      <title>Re: Quick way of counting rows in a schedule?</title>
      <link>https://forums.autodesk.com/t5/revit-api-forum/quick-way-of-counting-rows-in-a-schedule/m-p/9681857#M70686</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;/P&gt;&lt;P&gt;The proposed technique byFAIR59 is not applicable for Material Takeoff schedules.&lt;/P&gt;&lt;P&gt;Does anybody have any other suggestions?&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://forums.autodesk.com/t5/revit-api-forum/quick-way-of-counting-rows-in-a-schedule/td-p/5800112" target="_blank" rel="noopener"&gt;https://forums.autodesk.com/t5/revit-api-forum/quick-way-of-counting-rows-in-a-schedule/td-p/5800112&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Aug 2020 07:26:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/revit-api-forum/quick-way-of-counting-rows-in-a-schedule/m-p/9681857#M70686</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-08-10T07:26:59Z</dc:date>
    </item>
  </channel>
</rss>

