BrowserOrganisation Change vent

BrowserOrganisation Change vent

Kevin.Bell
Advisor Advisor
384 Views
1 Reply
Message 1 of 2

BrowserOrganisation Change vent

Kevin.Bell
Advisor
Advisor

Hi,

 

I've create an addon which lists views to access some that I use regularly... I've now set it up to display as per the browser organisation for sheets - this all works well.

 

I need to update my list as the user chaqnges things so I've subscripbed to the DocumentChanged event with: 

 

app.DocumentChanged += new EventHandler<Autodesk.Revit.DB.Events.DocumentChangedEventArgs>(onDocChanged);

 

I then check for changes to Views and BrowserOrganisation class using a filter:

 

            //Create filter for elements of type View
            ElementClassFilter viewFilter = new ElementClassFilter(typeof(View));

            //Create filter for elements of type BrowserOrganisaton
            ElementClassFilter orgFilter = new ElementClassFilter(typeof(BrowserOrganization));

            //Views Modified Action
            ICollection<ElementId> elesMod = e.GetModifiedElementIds(viewFilter);

            //BrowserOrganisation Modified Action
            ICollection<ElementId> orgMod = e.GetModifiedElementIds(orgFilter);

 

This works and I can detect when the user amends the BrowserOrganisation by changing some of its sorting.

 

My problem is that I cannot detect or work out what filter I should use to catch the event when the user sets the Browser organisation to something different.

 

The event fires, but the filters I have above miss whats changed. Anyone have any pointers on what to filter for to puck up the BrowserOrganisation change.

 

Thanks.

 

 

0 Likes
385 Views
1 Reply
Reply (1)
Message 2 of 2

jeremytammik
Autodesk
Autodesk

Have you tried using DMU to detect that?

 

https://thebuildingcoder.typepad.com/blog/about-the-author.html#5.31

  



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes