Programmatically detect that user is Showing/Hiding Mass

Programmatically detect that user is Showing/Hiding Mass

rossen.hristov
Enthusiast Enthusiast
658 Views
5 Replies
Message 1 of 6

Programmatically detect that user is Showing/Hiding Mass

rossen.hristov
Enthusiast
Enthusiast

Is there any way to detect that the user is showing or hiding mass. There is no DocumentChanged event fired for this kind of change. Is there any other way to detect that this is happening and the ElementId of the mass?

0 Likes
Accepted solutions (1)
659 Views
5 Replies
Replies (5)
Message 2 of 6

jeremytammik
Autodesk
Autodesk

No DocumentChanged event is raised because the Revit project and associated database is not affected and no transaction is committed.

 

Maybe you can use the .NET Automation API to register for events on the associated Windows user interface widget:

 

http://thebuildingcoder.typepad.com/blog/automation

 

Cheers,

 

Jeremy



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

Message 3 of 6

rossen.hristov
Enthusiast
Enthusiast

Thank you for your answer.

 

That is interesting, because if I render with hidden mass -- the mass is not seen in the render. If I render with shown mass, the mass is seen in the render. So how come two different renders occur with shown/hidden mass if nothing changes in the database? The mass is an Element with some Id just like all other elements, so there must be some value stored somewhere that indicates whether the mass is shown or hidden. How does the renderer know whether to render the mass or not? It has to check its shown/hidden status somehow.

0 Likes
Message 4 of 6

jeremytammik
Autodesk
Autodesk

If it would modify the database, DocumentChanged would be triggered.

 

Furthermore, if something is modified in the database, chances are that you can see that change in some element property via RevitLookup.

 

I am afraid both is not the case.

 

I will be very interested to hear about any proof of the contrary, of course.

 

Thank you!

 

Cheers,

 

Jeremy



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

Message 5 of 6

RPTHOMAS108
Mentor
Mentor
Accepted solution

Masses are either shown in view by category or shown in all views regardless of category visibility settings via Document.MassDisplayTemporaryOverride.

 

So depends what you mean by shown by user?

 

Would likely require idling event to check mass category visibility in active graphical view in tandem with property above. 

Message 6 of 6

rossen.hristov
Enthusiast
Enthusiast

Thank you so much. This seems possible.

0 Likes