Inheriting Autodesk.Revit.DB.View

Inheriting Autodesk.Revit.DB.View

BrentBurgess1980
Collaborator Collaborator
773 Views
3 Replies
Message 1 of 4

Inheriting Autodesk.Revit.DB.View

BrentBurgess1980
Collaborator
Collaborator

Is it possible to derive a class from Autodesk.Revit.DB.View and if so how? I get

'View' does not contain a constructor that takes 0 arguments, which suggests to me that it can be inherited, like View3D etc is.

 

Thanks,

 

Brent

0 Likes
Accepted solutions (1)
774 Views
3 Replies
Replies (3)
Message 2 of 4

RPTHOMAS108
Mentor
Mentor
Accepted solution

Although not marked Sealed/NotInheritable the majority if not all of the RevitAPI objects have a private parameterless constructor for the purpose of preventing inheritance or instantiating object with the New keyword. 

 

Given the lifecycle of RevitAPI objects it would probably be not a good idea to inherit such things to extend their functionality. You can use extension methods.

Message 3 of 4

BrentBurgess1980
Collaborator
Collaborator

That makes sense. I thought the answer was more than likely no bit thought I'd check.

0 Likes
Message 4 of 4

kent123
Contributor
Contributor

Are the following new 2026.2 tools related to OR could be used for the areas/workflow that you are talking about?

 

command name: Open (commandID: ID_DBVIEW_OPEN)

command name: Open Sheet (commandID: ID_DBVIEW_OPEN_SHEET_CANVAS_OPTION)

0 Likes