# Wall.ByCurveAndHeight function wrong level and data

**URL:** <https://forum.dynamobim.com/t/wall-bycurveandheight-function-wrong-level-and-data/22212>\
**Category:** Developers\
**Tags:** revit, python, dynamo, levels\
**Created:** [May 25, 2018, 10:09am UTC](https://forum.dynamobim.com/t/wall-bycurveandheight-function-wrong-level-and-data/22212 "2018-05-25T10:09:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tim\_Lugtenburg](https://avatars.discourse-cdn.com/v4/letter/t/a6a055/32.png) [@Tim\_Lugtenburg](https://forum.dynamobim.com/u/Tim_Lugtenburg)\
**Post date:** [May 25, 2018, 10:09am UTC](https://forum.dynamobim.com/t/wall-bycurveandheight-function-wrong-level-and-data/22212/1 "2018-05-25T10:09:02Z")

</div>

Hi,

By making a script for placing walls I ran into a strange problem. When a Wall.ByCurveAndHeight function is called and a vector is applied the wall will generate on a different level and the data in the properties of the wall don’t match.

The problem doesn’t appear when the same code is made in Python. 🤔

Does anyone have an explanation for this?

Code Block:

```
vectorx = Vector.ByCoordinates(vectorxin,0,0);

x1 = 0;
y1 = 0;
z1 = 0;
x2 = 2000;
y2 = 0;
z2 = 0;
wallheigth;
level;
walltypes;
vectorxin;

StartPunt = Point.ByCoordinates(x1,y1,z1);
EindPunt = Point.ByCoordinates(x2,y2,z2);

EindPuntVec = EindPunt.Add(vectorx);

lijn = Line.ByStartPointEndPoint(StartPunt,EindPuntVec);

Wall.ByCurveAndHeight(lijn,wallheigth,level,walltypes);

```

Python Code:

```
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *

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

# 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

#The inputs to this node will be stored as a list in the IN variables.
dataEnteringNode = IN

# Place your code below this line

x1 = IN[0]
y1 = IN[1]
z1 = IN[2]
x2 = IN[3]
y2 = IN[4]
z2 = IN[5]
hoogte = IN[6]
level = IN[7]
walltype = IN[8]
vector = IN[9]

metersToFeet1 = 0.3048
feetToMeters = 1 / metersToFeet1
mmToFeet = feetToMeters/1000

LeveId = UnwrapElement(level).Id
WallTypesId = UnwrapElement(walltype).Id
hoogte = hoogte*mmToFeet

XYZstart = XYZ(x1*mmToFeet,y1*mmToFeet,z1*mmToFeet)
XYZeind = XYZ(x2*mmToFeet,y2*mmToFeet,z2*mmToFeet).Add(XYZ(vector*mmToFeet,0,0))
Curve = Line.CreateBound(XYZstart,XYZeind)

TransactionManager.Instance.EnsureInTransaction(doc)
Wall = Wall.Create(doc,Curve,WallTypesId,LeveId,hoogte,0,False,False)
TransactionManager.Instance.TransactionTaskDone()

# Assign your output to the OUT variable.
OUT = Wall

```

 ![Wall%20test](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/b/3/b3247eab647728b345aa507c6c758887d5e28bf3.png)

![wall](https://us1.discourse-cdn.com/flex022/uploads/dynamobim/original/3X/2/3/2328c991f91db966302febb244681c46d22e9aa1.PNG)

[Wall test.dyn](https://forum.dynamobim.com/uploads/short-url/mUwY3tsTR9MDfkFo5gFvSwz1zVa.dyn) (24.0 KB)
