Unknown source of Sites in project

Unknown source of Sites in project

ido_b
Explorer Explorer
125 Views
0 Replies
Message 1 of 1

Unknown source of Sites in project

ido_b
Explorer
Explorer

Hi

 

What I'm trying to do

I'm iterating loaded links in my Revit model, and I'm trying to programmatically get a list of Sites names for each link, and write the list to an excel sheet.

 

The problem

For most links the list of Sites are being created successfully and matches the list of sites inside Revit when I access it via Revit UI. However for some links the list contains multiple Sites that all of them are called "Default  Location" and do not exist inside Revit when I open the linked model via Revit.

 

Can anyone tell where is this coming from and why?

 

Excel - Sites From Code, unknown "Default Location"

ido_b_0-1751201592646.png

 

Revit - Only Internal shows

ido_b_1-1751201783357.png

Code

// Sites
IList<ProjectLocation> linkSites = new FilteredElementCollector(linkDoc)
    .OfClass(typeof(ProjectLocation))
    .Cast<ProjectLocation>()
    .Where(s => s.Name != "Project") // ignore default Revit ProjectLocation 'Project'.
    .ToList();

int totalSites = linkSites.Count;
string siteNamesList = CustomFunctions.GetNamesListAsString(linkSites.Select(site => site.Name).ToList());

 

 

 

0 Likes
126 Views
0 Replies
Replies (0)