Wall Create rvt 2022

Hello,
I am using RVT 2022 and Dyn. 2.10. Currently I am struggling with this ERROR: Warning: TypeError : No method matches given arguments for Create: (<class ‘Autodesk.Revit.DB.Wall’>, <class ‘Autodesk.Revit.DB.Document’>, <class ‘Autodesk.Revit.DB.Line’>, <class ‘Autodesk.Revit.DB.ElementId’>, <class ‘bool’>) [’ File “”, line 34, in \n’]
Under my understanding, I am not calling that method. You will find the script below. I would really appreciate your support.
Thanks for your time.

image

# Load the Python Standard and DesignScript Libraries
import sys
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *

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

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

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

# The inputs to this node will be stored as a list in the IN variables.
Doc = DocumentManager.Instance.CurrentDBDocument

Lines = IN[0]
LevelId = UnwrapElement(IN[1]).Id

Walls = []
RVTLines = []
for line in Lines:
    RVTLines.append(line.ToRevitType())

# """    
TransactionManager.Instance.EnsureInTransaction(Doc)
for RVTLine in RVTLines:
    Wall = Wall.Create(Doc, RVTLine, LevelId, False)
    WallWraped = Wall.ToDSType(False)
    Walls.append(WallWraped)

TransactionManager.Instance.TransactionTaskDone()

# Place your code below this line

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

not so sure, but please try one curve first:

image

2 Likes

Hello, I put the transaction inside the loop, and change the name of your variable to avoid that it looks like a class

your reworked code:
# Load the Python Standard and DesignScript Libraries
import sys
import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *

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

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

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

# The inputs to this node will be stored as a list in the IN variables.
Doc = DocumentManager.Instance.CurrentDBDocument

Lines = IN[0]
LevelId = UnwrapElement(IN[1]).Id

Walls = []
RVTLines = []
for line in Lines:
    RVTLines.append(line.ToRevitType())

# """    

for RVTLine in RVTLines:
    TransactionManager.Instance.EnsureInTransaction(Doc)
    Wall_ = Wall.Create(Doc, RVTLine, LevelId, False)
    Walls.append(Wall_)
    TransactionManager.Instance.TransactionTaskDone()

# Place your code below this line

# Assign your output to the OUT variable.
OUT = RVTLines,Walls

Cordially
christian.stan

2 Likes

Thanks for your kind support.
Best regards.

1 Like