Using Dynamo to Adjust Wall Top Extension Distance to adjacent Ceiling height

Hello people this is my first post in this community and i ll try to keep it into the guidelines:

So… i am not a Dynamo expert at all, i have use it for solving a couple of problems in the past but mostly googling my way up to the solution but for this topic i have not been able to find a single clue.

Currently at my company we are using Revit models to manage the sub contractor payments (in fact we are publishing Revit models into a platform called Assemble) over there the on site engineers can markup which walls are already built (over here we are using construction parts to manage the different wall layers). So at the end of each month we can just filter which walls are already marked as built and we can know the quantity for the payment for each subcontractor.

THE PROBLEM:
This is going good with almost all the model elements except the wall finishes layers as they are normally model with a height which does not represent the real height. I am pretty aware of this problem and in the past i usually made a workaround to get the precise quantity of the layers with the wrong height but as we are demanding more precision from the model so we can pay the subcontractors with the model quantity my workaround is no longer a good option.

So i know i can manually unlock a Wall Type adjacent layers and manually adjust each instance to the ceiling height, but i was actually wondering if there may be a way to get to wall “Top Extension” to be aligned with an adjacent Ceiling panel height so maybe the process can be faster.

It would be very nice to get some starting point because as i have told you am not an expert user but i can learn and research if you guys point me in some direction.

Thanks alot for your help in advance!

I tried it on a simple example (with only one variable layer)



Do you prefer using this method or “exploding” the wall in its parts:image ?

Method with parts:

import clr

# Import Element wrapper extension methods
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)

# Import DocumentManager and TransactionManager
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication
app = uiapp.Application
uidoc=DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument

# Import RevitAPI
clr.AddReference("RevitAPI")
import Autodesk
from Autodesk.Revit.DB import *

test=[]
part=UnwrapElement(IN[0])
face=UnwrapElement(IN[1])
offset=IN[2]/304.8 #decimal to imperial

TransactionManager.Instance.EnsureInTransaction(doc)
part.SetFaceOffset(face,offset)
TransactionManager.Instance.TransactionTaskDone()

OUT=part.GetFaceOffset(face)*304.8

@GregX wow! that was fast!

I think this method is better,

Blockquote

do you mind to explain what do you mean by one variable layer?? am not sure i am understanding here.

Anyways i think this is a great starting point.

I am assuming you had to manually create the Wall Type and unlock the layer for it to be adjustable.

Thanks a lot i ll try this code and keep on searching!

I ll check it as solved as soon as i get it to work back here :D:D

With “one variable layer” I mean that in the example i unlocked only one layer of the wall.


I guess that you cannot unlock non-adjacent wall layers, I have never really used these functionalities so plese excuse me if I don’t know exactly what I’m talking about (:slight_smile:

image The formatting is off, what did you mean?

Anyways yes I manually modified the Wall Type and unlocked a layer.

My examples were simple (with only one wall and one ceiling, no roofs, no “attached to floor/roof”, no weird inserts, no weird or multiple ceilings, etc,) so if you try to implement this on a larger scale you will have to test it and find all the possible problems that might occur.

Good luck!

Well in Revit it is not possible as the error is showing you, i dont know if there is a way to make that through Dynamo.

Using the parts example may be more flexible at a large model scale but as i am kind of newbie here its gonna take me some reading to fully understand what you did up there and test it several times.

Still in the “very basic” example you made you are helping me save a lot of hours, i hope more people can check this up because is a recurrent topic in Revit forums but seems very few had try to work around with Dynamo.

i ll giving you heads up as soon as i get it running over here.

Thanks again!

It’s alwayas a pleasure to help somebody, even if it’s just a starting point.
Please keep us posted with your updates!

Hey @GregX sorry to bother you, could you help me with this spots of the script where i can’t see clear.

Also i tried to guess and am having an error over here:

Had to make another post to show you this

It says “Warning: The index is outside the given range”

Thanks again anyways!

Woops Sorry, I didnt notice the picture had some hidden spots.
In the First Red circle i typed “width/2+100”. This is because I wanted to “move” the Wall centerline under the ceiling (with the offset mode). To do so i added half the width plus a random value (100),just to be sure to be under the ceiling and not on Its edge. I was lucky because the offset was where i wanted It to be,maybe in another situation i should have added a negative value for the offset. This anyways was Just a quick example .

In the second Red circle i typed 0.5 . This is a value that represents a point on a line (in the following mode), with 0 being the start of the line and 1 being the endpoint.

The third Red circle is Just a note i added to explain what that node was. Notes are useful to comment (you can add them by pressing ctrl+w).

If you hover your mouse on the bottom right corner of a node a Window will appear showing Its content. You can Also pin the output so that you can see It when moving around the canvas. You get an error because the node probably did not work as expected: if you show us your script with the outputs of the raybounce and Also the nodes before maybe we understand what isnt working

Just to be clear when you type variabile[Number] you are trying to take the elementare in the “Number” position of the list “variabile”. If you havent already try googling Dynamo Primer to get started!

Sorry for the typos, i’m on mobile!

Thanks again, i figured out what the problem was, am guessing you were working on mm or cm as length unit and my template was in meters so when the offset was set to With/2+1000 it was getting way too far and the ray did not clash against anything, but it is now working!!

Am gonna be reading and trying some nodes to automate this process for a whole project… i know there will be plenty of problems but that makes it more exciting.

Thanks again for your help!

No problem! Sorry i didnt think about units when postiny. Anyways when something is not working try to look at the nodes connected to the broken Yellow nodes and their outputs, so that you can understand what is happening!