Find location of section heads on sheet

Find location of section heads on sheet

Anonymous
Not applicable
1,015 Views
6 Replies
Message 1 of 7

Find location of section heads on sheet

Anonymous
Not applicable

I'm trying to get the location of section heads on a sheet viewport. However, I'm finding it difficult to even find the section head elements themselves using a FilteredElementCollector. I've resorted to running a FilteredElementCollector to collect all elements from the view, and then grouping them by category. In the results, I don't see ANY reference to section heads.

 

Here's my C# code:

 

var counts = new Dictionary<String, int>();
var collector = new FilteredElementCollector(document, view.Id)
foreach (var element in collector) 
{
    if (element.Category == null)
    {
        continue;
    }
    if (!counts.ContainsKey(element.Category.Name))
    {
        counts[element.Category.Name] = 0;
    }
    counts[element.Category.Name] += 1;
}

The collector is able to find a View element corresponding to the Section that's referenced from this view, but I can't figure out how to use that to find the location of the section head.

 

I'm relatively new to the Revit API, but I've put in a few hours of research on this topic and can't figure out where to even start. From reading through documentation on categories, I should be looking for elements of type BuiltInCategory.OST_SectionHeads (and if I'm not, then what on earth is this category for?!), but again I see no hint of elements of this type on this view. No elements of this category appear when running RevitLookup's "Snoop DB" command.

 

Finally, I'd like to repeat this process for elevation and callout markers. If that process is significantly different, any info on it would be appreciated.

0 Likes
1,016 Views
6 Replies
Replies (6)
Message 2 of 7

Mustafa.Salaheldin
Collaborator
Collaborator

I think you can't do this through the API, but let me know why do you need the location of the marks, may be we can find out another solution!!


¯\_(ツ)_/¯
Let it work like a charm.

Mustafa Salaheldin


EESignature




Digital Integration Manager, DuPod

Facebook | Twitter | LinkedIn

0 Likes
Message 3 of 7

Anonymous
Not applicable

There's not really another option. I would like to export this data out of Revit.

0 Likes
Message 4 of 7

Mustafa.Salaheldin
Collaborator
Collaborator

You can export the end points of the section line. Is this working for you?


¯\_(ツ)_/¯
Let it work like a charm.

Mustafa Salaheldin


EESignature




Digital Integration Manager, DuPod

Facebook | Twitter | LinkedIn

0 Likes
Message 5 of 7

Anonymous
Not applicable

How do I do this? Which category is the section line under?

0 Likes
Message 6 of 7

Dale.Bartlett
Collaborator
Collaborator
0 Likes
Message 7 of 7

Anonymous
Not applicable

Thanks Dale! That is helpful, and gives me a hint as to how I might go about hacking my way towards a solution. But I'm still quite a ways off from being able to find the bounding box for the section heads, even with this neat hack. I suppose at this point the answer is "No, there's no good way to get bounding boxes for section heads".

 

If anyone has any other hacks or advice, it would be greatly appreciated!

0 Likes