Wall Orientation Values

#1

I am trying to extract wall orientation values to be usable and compared to other list of point or vector values. See below as an example:

What would be the best way to manage the wall orientation values to be comparable to vector values or vice versa? I can say a way using strings and being nifty with editing and formatting characters but I have a gut feeling there is a much more simpler method. Any ideas?

Get pointa from normal
Create dimensions
#2

Hi @Dynamonkey ,
one way to do this is to add one line inside Andreas’s code to convert XYZs to dynamo vectors:

2 Likes
#3

Nice catch.
This bug was introduced recently.
You should replace the entire Python code with this:

import clr

clr.AddReference('RevitAPI')

from Autodesk.Revit.DB import *



clr.AddReference("RevitNodes")

import Revit

clr.ImportExtensions(Revit.Elements)

clr.ImportExtensions(Revit.GeometryConversion)



wallinstances = UnwrapElement(IN[0])

vectorlist = list()

for item in wallinstances:

    try:

        lcurve = item.Location.Curve

        if str(lcurve.GetType()) == "Autodesk.Revit.DB.Line":

            vectorlist.append(item.Orientation.ToVector())

        else:

            direction = (lcurve.GetEndPoint(1) - lcurve.GetEndPoint(0)).Normalize()

            vectorlist.append(XYZ.BasisZ.CrossProduct(direction).ToVector())

    except:

        vectorlist.append(list())

OUT = vectorlist

I’ll update the node for the next release of Clockwork.

3 Likes
#4

Guys, I am trying to solve “null” return from both nodes, using the latest package from Clockwork
Could you tell me if there is intrinsic problem with the node or maybe that is my configuration ?
Thank you in advnsew does not workdyn.dyn (5.8 KB)
ance!

#5

Filtrate and classify walls and windows by orientation
#6

Hi @erlich.denis ,
It looks like Wall.Orientation node still gives out Revit XYZ and not DS vectors. You should replace the code inside the custom node as suggested by Andreas ^

#7

Worked like a charm! Thank you so much!

#8

would you share the nodes that you used for wall.orientation custom node?

#9

Hi @MarianaB

Wall.Orientation is from the clockwork package.

For future references, I’ll urge you to create a new thread rather then reviving 2 year old ones. A lot have changed with Dynamo in the past 2 years :slightly_smiling_face:

#10

I’m still getting this error message when I add the code…

Blockquote Error: ‘;’ is expected> Blockquote

Did I miss any step?

#11

Python code in a Code Block won‘t work. Use a Python Script node…

#12

How do I type it in a python script node?

Sorry if it is a very silly question, but I rather make it

Thank you Andreas

#13

http://primer.dynamobim.org/10_Custom-Nodes/10-4_Python.html