- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
@classmethod def Make_NewSpotCoordinate(cls, points, face): ref = face print('View', __revit__.ActiveUIDocument.ActiveView) print('Face', face) hasleader = True for point in points: pointX = point[0] pointY = point[1] pointZ = point[2] bend = revit_xyz(pointX + 450, pointY + 450, pointZ) # temp end = revit_xyz(pointX+500, pointY+500, pointZ) # temp tempArr = revit_xyz(pointX, pointY, pointZ) print('Point', point) print('Bend', bend) print('End', end) print('TempArr', tempArr) print('HasLeader', type(hasleader)) print('===test==', __revit__.ActiveUIDocument.ActiveView.Document)
try: #Document.NewSpotCoordinate(revit.active_view, ref, point, bend, end, tempArr, hasleader) # E1) NewSpotCoordinate() takes exactly 8 arguments (7 given) c_doc.NewSpotCoordinate(__revit__.ActiveUIDocument.ActiveView , revit.active_view , ref, point, bend, end, tempArr, hasleader) # E2) 'expected Document, got Document except Exception as ex: print('Exception : ', ex)
▲The above code is part of the code.
Guys,
I'm trying to use the 'NewSpotCoordinate' function in python, but there's an error.
First, I used this code 'Document.NewSpotCoordinate(revit.active_view, ref, point, bend, end, tempArr, hasleader)'
However, an error with the contents 'NewSpotCoordinate() takes exactly 8 arguments (7 given)' occurred.
So I put anything in to make eight parameters. an error with the contents 'expected Document, got 000 '.
Finally, I put 'document type' in first param. So the error that came out was 'expected Document, got Document'.
Do I have to use the 'Transaction' Class?
I really don't know...... What did I miss?
▼ The following is the contents of the output.
('View', <Autodesk.Revit.DB.View3D object at 0x000000000000044B [Autodesk.Revit.DB.View3D]>) ('Face', <Autodesk.Revit.DB.Reference object at 0x000000000000044C [Autodesk.Revit.DB.Reference]>) ('Point', <Autodesk.Revit.DB.XYZ object at 0x000000000000044D [(-11195.841918861, -14411.389384324, 23143.876630295)]>) ('Bend', <Autodesk.Revit.DB.XYZ object at 0x000000000000044E [(-10745.841918861, -13961.389384324, 23143.876630295)]>) ('End', <Autodesk.Revit.DB.XYZ object at 0x000000000000044F [(-10695.841918861, -13911.389384324, 23143.876630295)]>) ('TempArr', <Autodesk.Revit.DB.XYZ object at 0x0000000000000450 [(-11195.841918861, -14411.389384324, 23143.876630295)]>) ('HasLeader', <type 'bool'>) ('===test==', <Autodesk.Revit.DB.Document object at 0x0000000000000451 [Autodesk.Revit.DB.Document]>) ('Exception : ', TypeError('expected Document, got Document',))
The translation can be strange......!
Have a nice day 🙂
Solved! Go to Solution.