Recently we have come across a problem in the workflow, our engineers need a slightly complicated design of columns and rows in the panel schedule template. We decided to export all the data generated by previous schedule template into an excel sheet, this excel sheet will have that complicated design of rows and columns.
However, I'm not able to read table data of the panel schedule intelligently. Is there any workaround that API provides?
I've checked Revit Lookup, but it doesn't show the values shows in the table data of the panel schedule.
Would appreciate any help. Thank you
Solved! Go to Solution.
Recently we have come across a problem in the workflow, our engineers need a slightly complicated design of columns and rows in the panel schedule template. We decided to export all the data generated by previous schedule template into an excel sheet, this excel sheet will have that complicated design of rows and columns.
However, I'm not able to read table data of the panel schedule intelligently. Is there any workaround that API provides?
I've checked Revit Lookup, but it doesn't show the values shows in the table data of the panel schedule.
Would appreciate any help. Thank you
Solved! Go to Solution.
Hi
There is a sample for the panel schedule export in Revit SDK , you have to have basic knowledge of the API to understand it
but in short, you will have to
1 - filter for panel schedule views
ElementClassFilter PanelScheduleViewsAreWanted = new ElementClassFilter(typeof(PanelScheduleView));
2 - store them in a list
List<Element> psViews = fec.ToElements() as List<Element>;
3 - pas each panel schedule view to a custom function that creates the excel file and fills it with panel schedule data
new CSVTranslator(psView) as Translator
4 - then customize this function to your needs
private void DumpSectionData(StreamWriter sw, PanelScheduleView psView, SectionType sectionType)
{
int nRows_Section = 0;
int nCols_Section = 0;
getNumberOfRowsAndColumns(m_psView.Document, m_psView, sectionType, ref nRows_Section, ref nCols_Section);
for (int ii = 0; ii < nRows_Section; ++ii)
{
StringBuilder oneRow = new StringBuilder();
for (int jj = 0; jj < nCols_Section; ++jj)
{
try
{
oneRow.AppendFormat("{0},", m_psView.GetCellText(sectionType, ii, jj));
}
catch (Exception)
{
// do nothing.
}
}
sw.WriteLine(oneRow.ToString());
}
}
**A better approach is to extract the ElectricalSystemSet under the MepModel for each panel and extract circuits data circuit by circuit then create a separate class for excel creation and any advanced presentation you want
hope that helps
Regards,
Ahmed Attia
Senior Electrical Engineer - BIM Specialist , LEED GA , P.E.
Hi
There is a sample for the panel schedule export in Revit SDK , you have to have basic knowledge of the API to understand it
but in short, you will have to
1 - filter for panel schedule views
ElementClassFilter PanelScheduleViewsAreWanted = new ElementClassFilter(typeof(PanelScheduleView));
2 - store them in a list
List<Element> psViews = fec.ToElements() as List<Element>;
3 - pas each panel schedule view to a custom function that creates the excel file and fills it with panel schedule data
new CSVTranslator(psView) as Translator
4 - then customize this function to your needs
private void DumpSectionData(StreamWriter sw, PanelScheduleView psView, SectionType sectionType)
{
int nRows_Section = 0;
int nCols_Section = 0;
getNumberOfRowsAndColumns(m_psView.Document, m_psView, sectionType, ref nRows_Section, ref nCols_Section);
for (int ii = 0; ii < nRows_Section; ++ii)
{
StringBuilder oneRow = new StringBuilder();
for (int jj = 0; jj < nCols_Section; ++jj)
{
try
{
oneRow.AppendFormat("{0},", m_psView.GetCellText(sectionType, ii, jj));
}
catch (Exception)
{
// do nothing.
}
}
sw.WriteLine(oneRow.ToString());
}
}
**A better approach is to extract the ElectricalSystemSet under the MepModel for each panel and extract circuits data circuit by circuit then create a separate class for excel creation and any advanced presentation you want
hope that helps
Regards,
Ahmed Attia
Senior Electrical Engineer - BIM Specialist , LEED GA , P.E.
So there is no direct way to get the data from panel schedule, I guess we'll have to first export it into csv then extract the data. Thanks for the solution. Appreciate it 🙂
So there is no direct way to get the data from panel schedule, I guess we'll have to first export it into csv then extract the data. Thanks for the solution. Appreciate it 🙂
Can't find what you're looking for? Ask the community or share your knowledge.