•   about 2 years ago

Converting CAD details to Revit (Process Optimization)

CONCEPT DESCRIPTION:
Oftentimes an architecture office has a library of intricate CAD details that are imported into Revit or referred to and re-drawn. It would be extremely convenient to develop a process that automates:
1. Creation of a Detail Component of a CAD block nested in a CAD file
2. Replacement of all CAD block instances with the created Detail Component

PROCESS:
The process will require some trial and error to see what is possible and/or the most efficient workflow. Here are some questions that may help...
- are the CAD files organized by each individual detail or are they catalogs of details with many in a matrix? > trying to think of how to break the components into a kit of parts
- is the linework in the CAD details organized neatly on separate layers? > allows for targeting specific items and assigning linetypes in Revit
- on the Revit side, are the seek-and-destroy CAD imports linked into a whole sheet of details? Or are they organized in a different fashion?
- are the naming conventions very detailed for the CAD files? > how to identify specific imported CAD files in Revit and ensure precision of the replacement detail components, especially if only parts of the entire composition

RESOURCES:
- familiarity with CAD details/blocks
- familiarity with Revit detail components
- Dynamo expertise
- C# and Revit API knowledge

DELIVERABLES / PROOF OF CONCEPT:
- successfully read lines in Revit from imported CAD detail, convert to Revit line styles, & generate detail components from imported CAD blocks
- seek-and-replace all instances of CAD blocks linked throughout Revit file

GOALS:
- develop a working concept
- learn about the process of detailing in both CAD and Revit
- gain a deeper understanding of Revit back-end through Dynamo and/or C#/RevitAPI
- have each team member walk away from the experience with at least one new skill

IDEA CREDIT: Sara Troy, MODULUS Consulting

  • 5 comments

  •   •   about 2 years ago

    Interesting.

    A few ideas-
    a) I do not know about cad files, but dxf's are lists with definitions for everything: http://images.autodesk.com/adsk/files/autocad_2012_pdf_dxf-reference_enu.pdf
    they can be parsed conveniently enough with python.
    Do not quote me on this, but I think someone told me that dwg files are the same thing but bins with some additional definitions and compression.

    b) Here's a possible approach to get a nicer style mapping (though i have not worked w/ line styles in recent memory):
    1) extract all the line/region styles data from a bunch of revit models (as well as images)
    2) do same for cad equivalents (render blocks definitions to svg or something)
    3) normalize all the images.
    4) TSNE (or something similar) on images to find nearest neighbors of each style.
    If this gives a decent result, you do not have to dig into all the data definitions to find best mappings. The corresponding styles will be a lookup from the initial data. Even if you get a never before seen style, It will be possible to place the new texture in the image space, and repeat the same process without handcoding (or prompting a user what kind of style to map from nearest neighbors). This also deals with different data CAD formats, since the exact definition of the block params may have changed.

    On importing into revit, I know that some of the CAD line data gets lost (as of 2013 lol)- so maybe this warrants an external piece of something.

  •   •   about 2 years ago

    Perhaps parsing the dxf directly in Dynamo (via python or other method) could allow for recreation without losing those pieces of line data?

    I've also seen a lot of good work using the DataExtraction command in AutoCAD to create a CSV file which can be parsed over for recreating the elements natively in Revit.

  •   •   about 2 years ago

    You can use the Revit API to directly read the geometry of a linked or imported CAD file. You can then use this data to recreate the lines using Revit line types. This is the method I use in my DWG to RVT macro (http://archsmarter.com/convert-dwg-to-revit/) and Power Pack (www.archsmarter.com/powerpack-revit) add-in. I'd be happy to share the code.

    Unfortunately the Revit API doesn't read text or hatches from linked CAD files. To convert these elements, you need to export the text or dimension element's properties to a CSV or XML file from AutoCAD. You can then read this file in Revit and recreate the elements. I've had good success doing this for text and leaders. Hatches are a little more difficult.

    I haven't looked at reading DXF files but that could be an option. The only downside would be having to first create the DXF before the detail could be converted.

    AutoCAD's Data Extraction tool is great. You can export text properties very easily. It doesn't, however, export all the properties you need to recreate leaders and hatches. The only way I was able to do this was via the AutoCAD API.

  •   •   about 2 years ago

    Fantastic discussion everyone, although I will admit that a lot of these suggestions are outside the realm of things I have personally investigated...

    Responding to your comment Michael, I saw a post from Jeremy Tammik a few months ago about an alternate approach for extracting and dimensioning hatch patterns in Revit that looked promising:
    http://thebuildingcoder.typepad.com/blog/2017/06/hatch-line-dimensioning-voodoo.html
    Would a similar approach be possible using the AutoCAD API to calculate references from the hatch lines, shuttle that information into Revit, somehow match it against it a library of hatches, and populate the corresponding hatch pattern?

    In addition to not knowing how much overlap there is between Revit and AutoCAD API calls, I cannot tell if Tammik's approach only works on continuous line linear hatches or can even be adapted to fragmented patterns such as concrete?

  •   •   about 2 years ago

    Yes, the Revit API and AutoCAD API can intermingle. The trick is converting element properties from one API into the other. For example, hatches in the AutoCAD API are structured differently from filled regions in Revit. To recreate a hatch, you need to get the properties of the hatch from AutoCAD and map those properties to the arguments needed to create a filled region in Revit. I've done this by exporting the properties to a CSV file but it would be possible to read the DWG file in a Revit add-in using the AutoCAD API. The only requirement is the the computer running the add-in would need to have AutoCAD installed.

    I skimmed Jeremy's article and it looks like it's refering to filled region geometry already in Revit. I'll take another look later today.

Comments are closed.