is it possible to retrieve the wall thickness through Dynamo
There’s a wall.thickness node in clockwork
I think it is not available.
Oh that’s weird. I might be mistaken about the package then. I was convinced it was clockwork.
Well it’s doable with a really simple python script, so if no one solves this, then I can help you when I get my laptop started
I found the width property in API but I don’t know how to use ot.
Yep, that’s the one you need.
Loop through all your unwrapped walls and retrieve the property using dot notation, and then return the value. That’s it
I did this much. don’t know what is next.
The image you posted gives us 0 information. We have no idea what is in that python node and no clue what the error is.
I need to retrieve the width of the wall. I collected all walls through nodes. i don’t know what is next.
my code is below
Version:0.9 StartHTML:00000097 EndHTML:00002163 StartFragment:00000199 EndFragment:00002125 # Enable Python support and load DesignScript library
import clr
clr.AddReference(‘ProtoGeometry’)
from Autodesk.DesignScript.Geometry import *
clr.AddReference(‘RevitAPI’)
from Autodesk.Revit.DB import *
clr.AddReference(‘RevitServices’)
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager
doc = DocumentManager.Instance.CurrentDBDocument
The inputs to this node will be stored as a list in the IN variables.
w = UnwrapElement(IN[0])
s = w.Width
Place your code below this line
#w.GetParameterValueByName("Width");
Assign your output to the OUT variable.
#OUT = list
import clr
#Import the Revit API
clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import *
#Start scripting here:
walls = UnwrapElement(IN[0])
output = []
for i in walls:
output.append(UnitUtils.ConvertFromInternalUnits(i.Width, DisplayUnitType.DUT_MILLIMETERS))
OUT = output
I was convinced @Andreas_Dieckmann had this in his portfolio
I can see theres one in Steam but it returns the width in meters:
Hmm, maybe
I was sure there was a node called Wall.Width
You can use node “Convert Between Units” to convert from m to mm or cm.
I am not familiar with python, can someone help me understand how to edit this script for a single wall? The way it is written it must have multiple walls selected.
Thank you
Yes, here you go:
import clr
#Import the Revit API
clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import *
wall = UnwrapElement(IN[0])
thickness = wall.Width
thickness_in_mm = UnitUtils.ConvertFromInternalUnits(thickness, UnitTypeId.Millimeters)
OUT = thickness_in_mm
Be aware that unit conversions was changed in the API inbetween 2020 and 2022, so this may cause some errors
Thank you so much for your help! I actually just wanted thickness in inches but was able to modify this code.