I made a script to auto dimension walls and it works great with 2 problems.
First, as you can see in the picture, the first edge is not an exterior face:
Second I would like the reverse order, in that sense, the 0" reference would be the first right to left.
- for that case I tried to reverse array but no luck here.
Auto Dimension RO Layout by Wall.dyn (33.4 KB)
For the second case the solution is “Reverse the direction of the reference curve” and the direction of dimension will be reversed as well.
I still don’t know how to find the exterior face of the adjacent wall.
It could be easier to retrieve the vertical edges of the wall.
Hi Alban, that is exactly what I am doing:
but when the walls are joined, it finds the last face before the outermost face.
I just tested different types of joins and it is working fine:
Join Abut or SquareOff :
Join Miter :
We are using a very similar approach.
The thing is the wall does not goes all the way trough,
The wall selection shows that my wall end’s at the adjacent wall, So I am using the vertical edges but the wall does not go all the way to the outer edge.
There is probably a way to change that.
I would like to grab that adjacent wall and include its outer face into my dimension references, just don’t know how to yet.
I’ve found in the API a method called ElementsAtJoin from the class LocationCurve, but haven’t figured out how to use that yet.
I will post updates.
I found a way.
# Enable Python support and load DesignScript library
from Autodesk.Revit.DB import *
from RevitServices.Persistence import DocumentManager
doc = DocumentManager.Instance.CurrentDBDocument
el = UnwrapElement(IN)
# The inputs to this node will be stored as a list in the IN variables.
wc = el.Location
lcE = wc.get_ElementsAtJoin(0) #Connected at the End
lcS = wc.get_ElementsAtJoin(1) #Connected at the Start
for l in lcE:
if l.Id != el.Id:
for l in lcS:
if l.Id != el.Id:
# Place your code below this line
# Assign your output to the OUT variable.
OUT = r
That will return the walls joined at each end of the wall, then you can use that to extract the exterior front face of the wall and use that as a reference.
Glad you found a way !
Here is an equivalent with custom nodes.