Revit + Dynamo + Python: Create your own Plug-ins by automating interference correction between MEP specialties within BIM models: Part 1
With the next group of routines, we will automate part of the correction of MEP interferences, while at the same time all other specialties continue to be modeled. This allows obtaining a better-modeled end product in more detail in a faster time with greater technical quality.
Step 1: Prior to everything, we have to create the parameters “Clash”, “Clash Category”, “Clash Comments” and “ID Element”. This process has been automated with the next Script: CreateClashParameter.dyn.
We execute the routine using the top button that Dyno Browser gives us and once is ready, we have the parameters created for all the elements of the model instantly.
Step 2: Then we prepare a 3D view of the entire project. Where the building and all the modeled elements are appreciated. To have a better assortment, we name this view as “COORD”, if the project is too large it can be divided into several views “COORD_A”, “COORD_B”, “COORD_C”, etc.
Step 3: Once the COORD view is configured, we execute the Script: SetNoValueClashParameter.dyn, which sets the value “false” to the “Clash” parameter (Clash=0). This is done because when creating a new parameter Revit does not assign it a defined value and thus we ensure all the elements have that parameter clean.
Step 4: Now we select all the elements and execute the “Run Interference Check” function provided by the Revit itself. It is chosen which elements and against what specialty the interference shock will take place. Once finished we export the result an HTML report (clashreport.html)
Step 5: Then, we import the Interference Report (clashreport.html) directly as Revit gives us in HTML format when executing the following Script: SectionBoxClashReport; Automatic 3D Views of all detected interference are created, separated by Category vs. Category.
In this routine, a small block programmed in Python was used to be able to clean the file in HTML format that is exported from Revit when doing the special clash.
When we finish executing the Script, we get the following automatic 3D views:
Step 6: We configure the views templates for interference coordination by adding the following filters: 0_COORDINATION and 0_COORDINATION NO.
This allows us to quickly visualize which elements are affected and which are not when we paint in lead-color the elements without interference and red-color those that do.
Step 7: We set up a table with all the elements detected with interference and we call it “CLASH SCHEDULE” to be able to have an order of which elements the interferences are corrected and which will be sent as comments for a second review by the other specialty.
Step 8: It is a corrected view by view. Once the view or the Clash is corrected, it is eliminated and places the value 0 to the “Clash” parameter with the corresponding Scripts (SetNoValueToClash).
Clash views that cannot be corrected, will be added a comment for the second revision with the next Script: Clash Comments; and will accumulate in pending interference.
Step 9: Once you have finished reviewing all the views, you can see the CLASH SCHEDULE (It is important to keep this name in uppercase as Dynamo is case sensitive), and only the pending Clashers are filtered. Here you can see all the parameters created together with the comments and relevant information (“Clash”, “Clash Category”, “Clash Comments”). This table is exported as-is for a second revision with the Script (ExportClashSchedule), obtaining an Excel ready to be imported in the model of the other specialty, electrical in this case.
It is better to have a blank Excel file already configured to use it as an export path, but it works the same way if one is not chosen anyways. In this case, we use an already created one that is blank with the name: clashreportpendientes.xlsx
Step 10: The Excel obtained must be in the following format shown in the photograph:
In the CLASH SCHEDULE tab, the table is exported as it is in Revit. And in the MIN POINTS and MAX POINTS, tabs are the coordinates (x, y, z) of the Section Boxes pending review.
Step 11: Excel is imported by the other specialty involved and must create the views in Section Box of the previously pending interferences. The other model of the Electrical specialty is observed:
The “Clash”, “Clash Category”, “Clash Comments”, “ID Element” parameters must be re-created with the same routine.
Once the parameters are created, the exported Excel file of the Climate model is imported:
Finally, we get the new 3D views with their respective Section Box for quick correction.
In this way, we can send in real-time the interferences that occur while modeling each specialty without using other software or cleaning tables exported to Excel. This allows greater fluidity and detail when correcting all clashes between specialties.
In the second part, I will explain in more detail the operation of the last 2 Scripts: ExportClashReport.dyn and ImportClashReport.dyn, and also one way to export and import in XML format will be implemented, which makes file handling even faster and more automatic since it will not be necessary to place the Excel file path to export or import. The paths to the XML files will be within the Script and the files cannot be manipulated by anyone.
Thank you so much! Any questions about the operation of the Scripts to the Inbox: alonsooteroseminario@gmail.com
Developer: 👨💻 Luis Alonso Otero Seminario
Email: 📩 alonsooteroseminario@gmail.com
Consulting: 📍 https://luisotero.vercel.app/