- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I'm very new to the Revit API and C#, so all the usual noob disclaimers are relevant here. I'll describe what I've got working so far, and then describe where I'm having difficulty.
I have a generic annotation that includes a label into which you can type whatever you'd like. This content is kept as the value for a parameter I've created called "Note Content". I've successfully implemented a Revit ribbon button that returns all annotations with the "Note Content" parameter and the associated value and lists these notes in a WPF window.
And now the "I'm stumped" part...
I'd like to include the location (view/sheet) in the set where the annotation resides. I'm using the OwnerViewId property to do this, and when implemented in code, it just returns an integer. However, when I snoop the annotation element using Revit Lookup, I see the OwnerViewId property, but it lists more than just an integer value. It actually lists 3 values. For example, the OwnerViewId property for one of these annotations has a value of '<ViewPlan Level 1 356>' I've only been able to get the '356' part of that to return, but I can see what I want right there! I want the 'Level 1' part. And when I click on the OwnerViewId property in the Revit Lookup window to go deeper, it opens another window, and there's a property called Name that has a value of 'Level 1'. So again, I can see what I want to return. But I can't for the life of me figure out how to get to it and pull it out. Anyone have any insight?
(Revit 2019.2, Windows 10 Pro)
Solved! Go to Solution.