Automatic Wall Creation in Revit from Imported CAD Drawings (DGN file)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi all,
First of all, I want to know how to automatically create a wall in Revit from a wall in a DGN drawing. As you may have noticed, the DGN File format is a CAD format of the MicroStation, a CAD software from Bentley. My end goal is to be able to recreate Wall elements in Revit from a 2D CAD drawing (DGN file)
I am building the Revit API plugin for this by using the C#. I understand that there are several Wall.Create Method Overloads in Revit API. Each with different input arguments.
Recently, I have been playing around with the Create Method (Document, Curve, ElementId, ElementId, Double, Double, Boolean, Boolean) of the Wall Class. The Curve Class input argument is the baseline of the wall, and if my understanding is correct, it is the Location Line of the wall element.
My problem is that, I currently can think of two ways to be able to recreate wall elements in Revit based on the 2D DGN Drawing:
1. I have built a MicroStation API to get the Vertices (Vertex/Edge Points) of wall Shape Elements in MicroStation. However, the Curve Class input argument for the wall creation in Revit API is the baseline/centerline of the wall element. Long story short, I am clueless on how to get the centerline coordinates of an object given the Vertices of the object itself. The following picture explains my question more clearly:
As you can see, I have the black coordinate points (vertices), but how can I use this information to be able to get the red coordinate points, which can be used to create Curve for the Wall Create Method.
I have actually looked for some similar topics online, and it seems like everyone on the web recommends the GIS-related approach or other methods that is very complex such as implementing Voronoi or Delaunay Triangulation Algorithms
2. Another method I can think of is to first import the DGN drawing into Revit by using the Import CAD tools already available inside Revit. Even so, how can I transform the drawing lines in a CAD file into Wall elements in Revit? I would still need the centerline of the Walls to be able to use the create method to create walls in Revit. Or is there other methods or tips that I am unaware of?
P.S. In my DGN drawing, the walls are not accompanied with any centerline drawings, so it is purely just the wall line drawings like this without any centerlines:
Thank you!