Get compound element thickness in Revit

Hello Dynamites!

I have been trying to get the layer thickness for each material in my project but whatever I try I seem to get the wrong numbers. I’ve tried the WallType.Width function of dynamo for my walls and the Get CompoundStructureLayers from GeniusLoci but it doesn’t work. Any ideas what is wrong or how I can solve this issue?

Thanks in andvance!!

1 Like

@franziska.griesser ,

you can use genius loci package

Thank’s for your reply! Unfortunately the package does not work for some reason, although I believe the problem must come form something else. If I use the same script as you did I receive the following as outcome:
(The numbers of the wall thickness above btw are incorrect too)

@franziska.griesser ,

are you in a “work mode” or typeproperties are open in the background?
you run manual or automode?

KR

Andreas

no tabs are open in Revit and I usually run the script manually. I haven’t touched Revit besides the script :frowning:

KR Franziska

Hi,

In Revit 2023, you need to install the IronPython2.7 package to use custom nodes written in ironPython.

Hey :slight_smile:
I’ve double-checked it now and apparently I already have the IronPython 2.7 package:

@franziska.griesser ,

do it yourself :wink:

import clr
import sys
import System

clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
from Autodesk.Revit.DB.Structure import *

clr.AddReference('RevitAPIUI')
from Autodesk.Revit.UI import *

clr.AddReference('System')
from System.Collections.Generic import List

clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.GeometryConversion)
clr.ImportExtensions(Revit.Elements)

clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument
uidoc=DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument

#Preparing input from dynamo to revit
walls = UnwrapElement(IN[0])
vals = []


for i in walls:
    vals.append(i.Width)


OUT = vals

KR

Andreas

I guess sometimes there’s no way around :sweat_smile:
Thank you so much! I’ve used your scrip in a new file (architecture/meters) now with the Basic Wall: generic - 200mm and was able to receive the same result as you did. However I ask myself how I get from the 0.6561… to the 200 mm? I guess I would have to remap those numbers or am I wrong?

Cheers, Franziska

@franziska.griesser

do it this way

import clr
import sys
import System

clr.AddReference('RevitAPI')
from Autodesk.Revit.DB import *
from Autodesk.Revit.DB.Structure import *

clr.AddReference('RevitAPIUI')
from Autodesk.Revit.UI import *

clr.AddReference('System')
from System.Collections.Generic import List

clr.AddReference('RevitNodes')
import Revit
clr.ImportExtensions(Revit.GeometryConversion)
clr.ImportExtensions(Revit.Elements)

clr.AddReference('RevitServices')
import RevitServices
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManager

doc = DocumentManager.Instance.CurrentDBDocument
uidoc=DocumentManager.Instance.CurrentUIApplication.ActiveUIDocument

#Preparing input from dynamo to revit
walls = UnwrapElement(IN[0])
vals = []
output = []


for i in walls:
    vals.append(i.Width)

for w in vals:
    output.append(UnitUtils.Convert(w, UnitTypeId.Feet, UnitTypeId.Millimeters))
    
OUT = output

1 Like

Ah awesome! Thank you so much :slight_smile:

In the meantime I found a way to work around without Python knowledge, but I guess yours is more elegant! :smile:

Thanks for your support!!

KR Franziska

1 Like

@franziska.griesser ,

i would say you have to become a “Zorro” of copy/paste :wink:

1 Like