📜 ⬆️ ⬇️

MVC programming pattern as a way to implement the design process in Revit

image Revit is a software package that implements the principle of building information modeling - BIM. Designed for architects, designers and engineers.

Before we figure out how we will use the programming pattern when creating the model and designing the Revit documentation, we need to figure out what the MVC programming pattern is. Wikipedia tells us that:

Model-View-Controller ("Model-View-Controller") is a scheme for separating application data, interface and logic into three separate elements: model, view and controller. Modification of each component is carried out independently.
')

By the way, this pattern was first described in 1978.

Now let's see what is in Revit, according to my implementation of work on this template.


In my implementation of the MVC pattern for working in Revit, each Model refers to the corresponding Representation (which is best stored in the view template, for repeated use). The model can not change the view in the process. For now, it may not be clear, but for now just remember this.

Typical work


Typical work in Revit looks like. The worker begins to create a model in some form, redefines the visibility of the graphics for his convenience, for example, the bearing walls of him are orange, fireproof - red, etc.

Next, he receives the task to issue this type for printing and issuing tasks to subcontractors. The worker again redefines the visibility of the graphics, makes load-bearing walls with shading according to GOST, etc. But after issuing the job, you need to continue to model, and the process of redefining the graphics begins anew. It is terribly unproductive. And continue to model in the form configured for printing, inconvenient.

Advanced users Revit create different templates that reflect the visibility of graphics, and change them. For modeling they use the template “Template for modeling”, for issuing tasks they have a template “Template for issuing”. But this approach is also not optimal. We will always have a bunch of 2d elements (dimensions, masking areas, 2d lines) that will interfere with the modification of the 3d model in this form.

Theory


No need to strive to use the same type (Model) for different representations, changing them by means of templates (or not using templates, this is not important anymore). This approach mixes up different Models and Views on my MVC concept.

It is necessary for each specific Model (type) consisting of 3D and 2d elements in a form to create its own specific Representation (template of the type).

Changing the View (view template) for a Model (a certain view) is prohibited!

We should have a separate Model (view) for editing 3d elements, with the View configured for it (view template).

We must have a separate Model (view) for issuing the task to subcontractors, with its own View (view template) configured for it.

I remind you that under the Model a set of 3d elements (they are common for the project) and 2d elements placed on a specific form are taken.

A view is a specific customized view template (or just a view setting, without a template, in exceptional cases) for the Model to display correctly.

Practice


In practice, it looks like this. Create a folder in the “Model Editing” project manager. Here we add copies of species for modeling. Create a folder "Design job." Here we put copies of species for registration.

For the “Model Editing” folder, specify the template applied to the new “Template for modeling” types.

image

For the folder “Task Design”, we indicate the template applied to the new types “Template for issue”.

image

Now with the views in the folder "Edit Model" do anything. Add new work planes, filters, hatching areas, temporary sizes and anything else. The display of elements and their appearance in the “Model Editing” folder controls the “Template for modeling” template. We can, in some forms in the folder “Edit model”, refuse to use the template altogether and reconfigure the visibility parameters of individual elements.

image

Go to the views in the folder "Design job". There will be no unnecessary cuts markings, sizes in them, as they are controlled by the template for issuing. In addition, we do not have to delete the 2d construction auxiliary lines, hatching, etc., since they will only be on the views in the “Model Editing” folder. Views from the “Job Design” folder are intended only for printing. You cannot remove templates from view settings from the Task Design folder.

image

Switching between views for 3d modeling and for setting a job is done with one click.

findings


Using the MVC pattern in working with Revit allows you to save a lot of time, speed up the work on creating a 3d model of a model, and store supporting information (which was needed to build a model) right in the project.

We always have on hand views for modeling, on which we can do anything: insert tasks of subcontractors into them, create auxiliary sections, planes, lines, hatching and so on. None of this will be visible on the print.

My implementation of the MVC pattern in Revit allows species intended for issuing or printing to be relevant and neatly decorated at any given time.

Source: https://habr.com/ru/post/322484/


All Articles