Here is an issue we have not looked at in a long time, brought up again by the following query:
Question: I am creating a tool to generate a BIM from CAD data.
One of the steps involves generating a floor slab, and then placing exterior walls along its edge.
The tool begins by using model lines and arcs as a profile to generate the floor.
Unfortunately, that generates walls that resting half on and half off the slab:
How can I fix this, please?
Answer: The wall creation will always be based on the wall centre line.
After creating the wall, you can adjust the wall's "Location Line" parameter to one of the following options:
- Wall Centerline
- Core Centerline
- Finish Face: Exterior
- Finish Face: Interior
- Core Face: Exterior
- Core Face: Interior
Then the wall will align according to the location line you specified.
In this way, the wall exterior face can be aligned to the floor profile edge after creating the wall using the floor profile edges.
A little note on how to determine and assign one of the options to the "Location Line" parameter:
Each option is mapped to an integer value. You can determine the specific values by looking them up using the RevitLookup tool after changing the settings back and forth manually in the user interface.
And then set the "Location Line" value.
For example:
Wall wall = ... Parameter param = wall.get_Parameter( BuiltInParameter.WALL_KEY_REF_PARAM); param.Set(2); // Finish Face: Exterior param.Set(1); // Core Centerline
Note that this is an application of the principles we discussed way back in the year 2008, explaining the old wall compound layers and brought up in a comment by Berria on that post:
Question: How can I specify that my walls Line Location are 'Finish Face: Exterior'.
Answer: You need to be very precise with what you mean by wall location line. As mentioned, there is a difference between the wall.Location line that you see in the API and the 'Location Line' visible in the user interface. The former cannot be changed, it is always in the middle of the wall. The position of the latter can be adjusted using the WALL_KEY_REF_PARAM parameter.
A bit later, Mike posted a similar query on creating a wall with a sloped profile:
Question: I am struggling to figure out how to set a wall's 'Location Line' to 'Finish Face: Interior' in code prior to drawing the wall. I would like the interior face of the wall to be at the coordinate points I supply instead of the default 'Wall Centerline'.
Answer: You can explore this as follows:
Create a new wall and look at its parameters, e.g. using RevitLookup or the Revit API Introduction labs built-in parameter checker. One of the parameters is
- WALL_KEY_REF_PARAM – Location Line – int read-write
It has an initial value of zero. Looking at the wall properties in the user interface, I see that the location line property is set to centre line. If I manually change the property to 'Finish Face: Interior' and then look at the parameter again, its value has now changed to 3.
You can invert this process, i.e. set the built-in parameter WALL_KEY_REF_PARAM to have a value of 3 through the API, which corresponds to 'Finish Face: Interior'.
Jeremy Tammik,
I just found a workaround for creating walls with the location line set to "Finish Face" (for exemple) on creation. I just first create a wall two times thicker, change the location line position, and finaly change my wall type to its final thickness. I explain it more accuratly here : http://bim42.com/2014/02/09/modellingskirtingboards/
Regards,
Simon Moreau
Posted by: Simon Moreau | February 09, 2014 at 11:19
Dear Simon,
Thank you very much for sharing your brilliant idea.
The best solutions are always the simplest, and this is an absolutely perfect example of that.
Thank you also for sharing your Revit room finishing and skirting board modelling application for free on the Autodesk Exchange:
http://apps.exchange.autodesk.com/RVT/en/Detail/Index?id=appstore.exchange.autodesk.com%3aroomfinishing_windows32and64%3aen
I am looking forward to seeing the code on GitHub.
Congratulations on all of these good steps!
Cheers, Jeremy.
Posted by: Jeremy Tammik | February 09, 2014 at 14:58
Dear Simon,
I like your solution so much that I promoted it to a proper blog post of its own:
http://thebuildingcoder.typepad.com/blog/2014/02/creating-an-offset-wall-solution.html
Thank you again!
Cheers, Jeremy.
Posted by: Jeremy Tammik | February 17, 2014 at 03:38
Dear Simon,
I'm a beginner in creating tools for revit, and the tool you created is almost similar to the one I wanted to create. I already tried the solution on the Autodesk exchange and it is great. I'm really looking forward to see your code!
Thanks!
Jesse Mom
Posted by: Jesse Mom | February 18, 2014 at 03:47
One more thing,
I hope my excitement doesn't make me sound impatient, but can you give an indication of when we can expect your code on Github? And can you tell us your username or repository name to make sure we don't miss it?
Best,
Jesse Mom
Posted by: Jesse Mom | February 18, 2014 at 05:18