Our Recent Posts

Tags

No tags yet.

Best practice for Clash Detection (Revit/Navis/Dynamo)

Please follow the link for the enhanced Workflow per category Link

Clash Detection:

In this case we will go through the best practice for clash detection procedure so we find the best way to build a model that's free of clashes and the best way to achieve that. Also since you can't build one big project in Revit due to the size of the file, you need to breakdown the model based on the discipline, zone, floors and etc. We will focus on coordination between separated models as well (host and link).

Case Study:

We will study two structural models and I will insert one of them as a linked model and the other one as host model. Model X includes the outer walls and floors while Model Y includes inner walls.

Linked Model:

Figure 1. Model X section view and Full view (Outer Walls, Floors)

Host Model:

Figure 2. Model Y (Inner Walls)

After linking model X in model Y:

Figure 3. Model X linked in Model Y section view and Full view

Next step is to run the clash detection to check if the two models are clashing. For this procedure we will represent the clash detection procedure in three different ways and list the advantages and disadvantages for each way.

1- Interfernce check: Run the clash detection from Revit using interfernece check. We will choose In the first window the host model and in the second window the linked model. check figure(4).

Figure 4. Interference check

After running the interference check it will show all clashed elements between the two models with ability to export a report as HTML file. Check figures (5 & 6).

Figure 5. Interference Check Results, Figure 6. HTML file.

Next step is to solve the clashes since you can’t find the engaged elements easily in the view you need to select the element by ID (ID’s from the exported report figure (6)) then create selection box per element, remember you can’t select the linked elements you can only select the host's elements. Check figures (7 & 8).

Figure 7. Select Model by ID, Figure 8. Apply selection box.

After applying the selection box you can open the last interference report and pick the clash to show the clashed elements (If needed). Check figure (9).

Figure 9. Showing the clash in the selection box.

Advantages:

  1. The interference check embedded within Revit.

  2. Ability to export the result to HTML file.

  3. Gives the elements ID.

  4. Very fast check.

Disadvantages:

  1. You can’t find the clash easily in the views.

  2. You need to select element by ID each time for each clash to isolate and solve it.

  3. Talking a lot of time.

  4. You can’t set tolerance.

2- Navisworks: Export the model in the 3D View to navis using external tools (In the add-ins tab) make sure to to disable the analytical before exporting check figure(10), then Open it in Navisworks. Check figures (11 & 12).

Figure 10. disable analytical , Figure 11. export to navis, Figure 12. Open the model in Navis.

Next step is to add test to perform the clash detection. Also to set the rules of the test (Tolerance, type of the clash). Check figures (13 & 14).

Figure 13. Add test, Figure 14. Set Rules.

After running the test you can check the results in Navisworks with details about the clash and auto focusing on the clashed elements. Check figure (15).

Figure 15. The results in navis.

After that you need to solve the clashes so you should go back to Revit and edit the elements from there. To do that you need to go find the elements by the ID’s, which is again you need to export HTML report from Navis that includes elements ID. Navis can export report with full details for each clash, that will give better understanding about the clash. Check figure (16 & 17).

Figure 16. Export Report, Figure 17. Report's Result.

The last step is to select the element by ID, make selection box and solve the clash. Check figure (7 & 8).

Advantages:

  1. Ability to add tolerance and choose the clash type.

  2. Ability to export the result to HTML file.

  3. Gives full details about the clash.

  4. Ability to navigate and auto focusing on the element in Navis.

  5. Ability to categorize the clashes.

Disadvantages:

  1. Need to export the model to run the clash detection.

  2. You need to select element by ID each time for each clash to isolate and solve it.

  3. Talking a lot of time.

3- Dynamo: The idea behind using dynamo is to build script that automate the process of clash detection with creating selection box views for each clash. So once you run the script it will detect all clashed elements and color them so you can detect the clash visually. We will build the script step by step and we will compare the results with the previous ways.

What you need:

  1. Dynamo. 1.3.

  • Packages: (You can install easily from dynamo)

  • MEPover.

  • Data-Shapes.

  • BimorphNodes.

  • RevitPythonWrapper.

  • Visual Style Select.

  • Clockwork

  • Archi-Lab

  • LunchBox

2. Revit 2016 – 2018.

Concept:

Part-1: Read the linked models and make selection form, so the user pick which model to run versus the host model. We will add ability also to run the clash detection for the host model vs itself. Check the figure (18)

Tip. Make sure to keep the Run mode of the dynamo as manual.

Figure 18. Part-1

Part-2: We will collect the host model's elements aslo Collect the elements from the picked model and Check the intersection in between to detect the clashes. Check figure (19).

Figure 19. Part - 2

Part-3: Create 3D view for each element. Check figures (20).

Figure 20. Part-3

Part-4 To make the 3D-View in Revit as shaded and to color the element in the 3D-view. Check figures (21).

Figure 21. Part-3

Last thing every time you run the script you need to make sure to delete the previous created views or choose different names for the new views, otherwise Revit will give an error that views already created with the same names. The deleting for the views can be automated as well.

Since the script made with an input form you can run it from dynamo player without opening dynamo.

Each view will include the clashed elements and if you still can’t detect the clash visually you can run the interference check for elements in the view. With this way you will make sure to detect the clash and understand it. Check figures (22 & 23).

Figure 22. Interference check Result. Figure 23. Interference check per element.

Advantages:

  1. Embedded in Revit.

  2. Full automated detection process.

  3. Creating view per clash.

  4. Visual detection: Override(by color) the hosted element per view.

  5. Ability to run the clash detection host model with linked models, as well the host model with itself.

  6. Ability to enhance the workflow and automate more process.

  7. Very fast check.

Disadvantages:

  1. You can’t set tolerance.

  2. Sometimes you need to run interference check again.

Script:

Dynamo Script Request Here

Python code for the needed Nodes:

  • Some of the below nodes are taken from popular packages and have been edited to meet the desired needs.

StartFragment

Collect Elements:

StartFragmentimport clr clr.AddReference('ProtoGeometry') from Autodesk.DesignScript.Geometry import * clr.AddReference('RevitServices') # Import RevitAPI clr.AddReference("RevitAPI") import Autodesk, RevitServices from Autodesk.Revit.DB import * from RevitServices.Persistence import DocumentManager import System import sys pyt_path = r'C:\Program Files (x86)\IronPython 2.7\Lib' sys.path.append(pyt_path) #The inputs to this node will be stored as a list in the IN variable. dataEnteringNode = IN doc = DocumentManager.Instance.CurrentDBDocument _category = IN[0] result = [] for x in _category: errorReport = None filter = ElementCategoryFilter(System.Enum.ToObject(BuiltInCategory, x.Id)) result.append(FilteredElementCollector(doc).WherePasses(filter).WhereElementIsNotElementType().ToElements()) OUT = resultEndFragment

If Statement:

EndFragment

StartFragment

#Copyright(c) 2018, Mohammad Nawar

#BIMhex, http://BIM-hex , mohadnawar@live.com

import clr clr.AddReference('ProtoGeometry') from Autodesk.DesignScript.Geometry import * #The inputs to this node will be stored as a list in the IN variables. dataEnteringNode = IN cond = IN[0] x = IN[1] y = IN[2] #Assign your output to the OUT variable. o = [] if cond: OUT = y else: OUT = x

List editing:

# Copyright(c) 2018, Mohammad Nawar # http://BIM-hex.com

StartFragmentimport clr clr.AddReference('ProtoGeometry') from Autodesk.DesignScript.Geometry import * #The inputs to this node will be stored as a list in the IN variables. dataEnteringNode = IN x = IN[0] o = [] l = [] for i in range(len(x)): o.append(x[i]) o.append(x[i]) #Assign your output to the OUT variable. l = [o[j:j+2] for j in range(0, len(o), 2)] OUT = lEndFragment

Rename Views:

StartFragmentimport clr clr.AddReference('ProtoGeometry') from Autodesk.DesignScript.Geometry import * import clr clr.AddReference('RevitServices') from RevitServices.Persistence import DocumentManager app = DocumentManager.Instance.CurrentUIApplication.Application #The inputs to this node will be stored as a list in the IN variables. dataEnteringNode = IN x = IN[0] y = IN[1] o = [] for i in range(len(x)): o.append(y + str(i)) OUT = oEndFragment

Create Views:

import clr clr.AddReference('ProtoGeometry') from Autodesk.DesignScript.Geometry import * # Import ToDSType(bool) extension method clr.AddReference("RevitNodes") import Revit clr.ImportExtensions(Revit.Elements) # Import DocumentManager and TransactionManager clr.AddReference("RevitServices") import RevitServices from RevitServices.Persistence import DocumentManager from RevitServices.Transactions import TransactionManager from System.Collections.Generic import * # Import RevitAPI clr.AddReference("RevitAPI") import Autodesk from Autodesk.Revit.DB import * doc = DocumentManager.Instance.CurrentDBDocument uiapp = DocumentManager.Instance.CurrentUIApplication app = uiapp.Application #The inputs to this node will be stored as a list in the IN variable. dataEnteringNode = IN d = [] v = IN[1] s = 0 for k in IN[0]: elements = [] for i in k: elements.append(UnwrapElement(i)) elements.append(UnwrapElement(k)) viewName = v[s] offset = float(IN[2]) s = 1+s #get ViewFamilyType for a 3D View collector = FilteredElementCollector(doc) viewTypeColl = collector.OfClass(ViewFamilyType) for i in viewTypeColl: if i.ViewFamily == ViewFamily.ThreeDimensional: viewType = i else: continue # "Start" the transaction TransactionManager.Instance.EnsureInTransaction(doc) #define bounding box enclosing all elements bboxMin, bboxMax = [], [] i = elements[0] bboxMin.append(i.get_BoundingBox(doc.ActiveView).Min) bboxMax.append(i.get_BoundingBox(doc.ActiveView).Max) minX, minY, minZ, maxX, maxY, maxZ = [], [], [], [], [], [] for i, j in zip(bboxMin, bboxMax): minX.append(i.X) minY.append(i.Y) minZ.append(i.Z) maxX.append(j.X) maxY.append(j.Y) maxZ.append(j.Z) bboxMinX = min(minX) bboxMinY = min(minY) bboxMinZ = min(minZ) bboxMaxX = max(maxX) bboxMaxY = max(maxY) bboxMaxZ = max(maxZ) #create a bounding box bbox = BoundingBoxXYZ() bbox.Min = XYZ((bboxMinX - offset), (bboxMinY - offset), (bboxMinZ - offset)) bbox.Max = XYZ((bboxMaxX + offset), (bboxMaxY + offset), (bboxMaxZ + offset)) #create 3d View view = View3D.CreateIsometric(doc, viewType.Id) d.append(view) view.Name = viewName view.SetSectionBox(bbox) # "End" the transaction TransactionManager.Instance.TransactionTaskDone() #Assign your output to the OUT variable OUT = d

Override:

import clr clr.AddReference('RevitAPI') import Autodesk from Autodesk.Revit.DB import * clr.AddReference('RevitServices') from RevitServices.Persistence import DocumentManager from RevitServices.Transactions import TransactionManager from System.Collections.Generic import * doc = DocumentManager.Instance.CurrentDBDocument def overridecolor(element, color, fillpatternid, view): gSettings = OverrideGraphicSettings() gSettings.SetProjectionFillColor(color) gSettings.SetProjectionFillPatternId(fillpatternid) gSettings.SetCutFillColor(color) gSettings.SetCutFillPatternId(fillpatternid) view.SetElementOverrides(element.Id, gSettings) return element fillpatterns = FilteredElementCollector(doc).OfClass(FillPatternElement).ToElements() solidfillid = [f.Id for f in fillpatterns if f.Name == 'Solid fill'][0] for j in IN[1]: for i in IN[2]: if isinstance(IN[0],list): color = UnwrapElement(IN[0]) else: color = [UnwrapElement(IN[0])] adskcolor = [Autodesk.Revit.DB.Color(c.Red, c.Green, c.Blue) for c in color] view = UnwrapElement(j) elements = UnwrapElement(i) TransactionManager.Instance.EnsureInTransaction(doc) for e,c in zip(elements,adskcolor): overridecolor(e,c,solidfillid,view) TransactionManager.Instance.TransactionTaskDone() OUT = elements

#Revit #API #Python #Dynamo #Coordination #clashdetection

©2018 by Nawar.

  • YouTube Social  Icon
  • LinkedIn Social Icon