from Autodesk.Revit.DB import FilteredElementCollector, BuiltInCategory,ItemFactoryBase
walls = FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_Walls).WhereElementIsNotElementType().ToElements()
wallLocations = [wall.Location for wall in walls]
wallCurves = [wallLoc.Curve for wallLoc in wallLocations]
lenght_wall=[i.Length for i in wallCurves]
wall_line=[i for i in wallCurves]
startpoint=[i.GetEndParameter(0) for i in wallCurves]
endpoint=[i.GetEndParameter(1) for i in wallCurves]
for i in wall_line:
ItemFactoryBase.NewDimension()
I did it some changes according to your script and advice but I faced with this error
Exception : Microsoft.Scripting.ArgumentTypeException: NewDimension() takes at least 4 arguments (3 given)
while NewDimension give 3 argument
from Autodesk.Revit.DB import FilteredElementCollector, BuiltInCategory,Dimension
from Autodesk.Revit.Creation import Document
walls = FilteredElementCollector(doc).OfCategory(BuiltInCategory.OST_Walls).WhereElementIsNotElementType().ToElements()
wallLocations = [wall.Location for wall in walls]
wallCurves = [wallLoc.Curve for wallLoc in wallLocations]
wall_line=[i for i in wallCurves]
ra=ReferenceArray()
for i in wallCurves:
ra.Append(i.GetEndPointReference(0))
ra.Append(i.GetEndPointReference(1))
Document.NewDimension(doc.ActiveView,wall_line,ra)