Creating Line by two points in Python

Hi Everyone!

I’ve been playing with Python scripting in Dynamo for a while and was able to achieve pretty advanced results, but I failed with such a basic thing as creating primitive geometric objects.

Within one of my scripts I need to generate a collection of lines using their limit points but the method doesn’t work despite having DesignScript imported. I’m pretty sure that I’m missing some nuance here.

Searching this forum didn’t result in anything helpful, so I decided to start a new thread on it. Could someone please explain how to deal with this?

Thanks in advance!

1 Like

Qualify the class or don’t import the RevitAPI (Line class is in both ProtoGeometry and RevitAPI libraries which leads to ambiguous references…and exceptions like the one you are seeing).


Thanks for a prompt reply @Thomas_Mahon! That in fact solved the problem.