Hello everyone!
I got a problem that I can’t use design script “Line.ByStartPointEndPoint” in my python nodes.
I have read other related topics like
http://dynamobim.org/forums/topic/using-desingscript-commands-in-python-script/
and I imported DSCore but it still doesn’t work.
This is the error message:
Anybody know how to solve this?
Yep, show us more of your graph! We need the inputs especially.
I have solved this!
Using Autodesk.DesignScript.Geometry.Line.ByStartPointEndPoint instead of Line.ByStartPointEndPoint can eliminate the error. I guess the reason is that both namespace Autodesk.DesignScript.Geometry and Autodesk.Revit.DB has the same-name class “Line”, but only Autodesk.DesignScript.Geometry.Line has the attribute “ByStartPointEndPoint”.
Anyway, thanks for your concern!
This is a namespace collision. To avoid typing in full name every time, you can also use the "from… import… as… " syntax or just avoid the implicit “import *”.
Thanks a lot!
It was really the namespace collision like what you said, and I have solved this by using full name. I will try the “from…import…as…” syntax later.