Do you have an AutoCAD drawing that you need to convert to Revit? Wish you could just convert lines to walls in Revit?
This macro makes the process a lot easier by automatically converting model lines to Revit walls.
One of the first things I wanted to learn when I started writing Revit macros was how to create Revit objects, like walls, doors and windows. After some trial and error, I managed to write a macro that prompted you to select a model line then inserted a wall on top of that line. It was pretty simple but I managed to get it to work, which was a major accomplishment at the time.
Fast forward a couple of years later. I decided to revisit this macro to see if I could make it more useful. This time around, I added a nifty dialog box so you can select the line style you want to create the walls from, the starting floor level of the walls, the wall type to use and the wall height.
A couple of things to know about the macro:
- The macro can use any model line to create the walls EXCEPT ellipses, partial ellipses and splines.
- If you insert an AutoCAD drawing, you’ll need to explode it before you can convert the lines to walls. I’m looking into methods for creating walls from linked files. This would be my preferred method. I’m not a big fan of inserting DWG files into Revit models as it adds all sorts of junk to the file.
- The walls are centered on the model line. The location line of the wall is set to “Wall Centerline”.
Some future enhancements will include the ability to set the wall’s top constraint instead using an unconnected height and allowing you to specify the wall’s location line. I’m also looking into using a similar method to create MEP ducts and pipes from 2D lines.
Download the macro
You can download the macro (in Revit 2014 and 2015 formats) from the ArchSmarter Revit Macro library. Don’t have access? Sign up for ArchSmarter updates in the form below and get immediate access to this and other time-saving Revit macros!
Have you written any Revit macros to automate your work? If so, what tasks have you automated and how much time do you think you’ve saved? Leave a comment below. Also, if you’d like more information on getting started with Revit macros, you can find a list of great resources on my Revit Macro Resources page.
Hello, Michael!
I get the error, when open project “Wall from lines macro – v1_2015”:
I saw the icon “Loading the macro failed. Rebuilding the module may resolve this issue.
” in Macro Manager. How can I solve this? Thanks
Sorry about that. Yes, you’ll need to rebuild the source code. It’s a very easy process. Just follow the four steps outlined here and you’ll be all set. Let me know if you have any further problems with the macro.
Thank you very much for quick response! And sorry for that question.
Macro works! Great tool! Thanks for sharing!
Hello Michael,
I get the same error “Loading the macro failed. Rebuilding the module may resolve this issue.” But rebuilding the Macro sourse did not solve the problem. I googled but i couldn’t get any solution. How can i solve the problem.
(i use Revit 2016 Student Version & Revit SDK 2016)
Regards
Hi Bahar. I haven’t tested the macro in Revit 2016 yet. It’s on my list to do this week. I’ll get to it shortly and upload the new version.
Hi Michael, actually i get the same error message with Revit 2015. Could it be relevant with Student Version? Do you have any idea?
This really is a great tool. I showed this to the architects in my office and they had one question that I couldn’t answer. They wanted to know if there is a way to control justification of the wall?
Thanks Will! Right now, there isn’t a way to control the wall justification. When you create a wall using the API, it sets the location line as “Wall Centerline” by default. You could change the wall’s location line after you create it but that won’t change the position of the wall, it just changes the “Location Line” parameter value. You would need to use a move function to change the wall position relative to the new location line. I’ll look into adding this functionality in a new version. Thanks for the suggestion!
The macro is awesome, however when I try to build it in the Application tab I get the error: “the type frmWallsFromLines” is not defined. Any idea of how could I solve this? Thank you in advance and keep up posting, it is great to work smarter and not harder.
Thanks! To copy a project macro to your application macros, you need to copy all the macro files in the SharpDevelop project browser. I put together a short video that walks you through the process. You can download it here:
https://archsmarter.com/download/copy-to-application-macro-screencast/
Let me know if you run into any problems.
Michael,
I have Revit 2016 Build 16.0.1144.0
20160525(x64)
Update 5 for R2
And when I use the Version 1.1 of Lines to Wall (File name: Lines to Walls_v1.1_2016.rvt) either when opening as a RVT or incorporated as a RTE I get the Autodesk CRASH dialog.
I am reverting back to the older 1.0 version and hope I can use in my current build.
Thanks!
Phil Semanek
Phil,
A
re the lines coming from a DWG file? If so, could you email me the DWG or, better yet, the RVT that’s crashing? I’ll try it on my end.
Michael
Hi michael,
I am looking a topic ‘create sections automatically’ like column sections beam sections and elevation sections but not available in that Mastering Revit Macros with C# course let me know weather is available or not.
Thnaks
Syed
Where can I find the lines to wall macro?
Thanks! 🙂
You can download it here:
htts://www.archsmarter.com/toolbox