Point object conflict


#1

Hi guys, I had troubles trying to create a DesignScript.Geometry.Point in my Python Script. I noticed that the problem comes when I import the RevitAPI (Autodesk,Revit.DB). I have tried to code Autodesk.DesingScript.Geometry.Point, instead of just Point but that also doesnt work. How would you handle this?


#2

Either qualify your class:

pt = Autodesk.DesignScript.Geometry.Point.ByCoordinates(0.0, 0.0, 0.0)

…or use an alias in your import statements:

import clr
clr.AddReference('ProtoGeometry')
from Autodesk.DesignScript.Geometry import *
from Autodesk.DesignScript.Geometry import Point as ProtoPoint

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

pt = ProtoPoint.ByCoordinates(0.0, 0.0, 0.0)

You can also declare an alias like this:

import Autodesk.DesignScript.Geometry.Point as ProtoPoint


#3

This didnt worked for me. Ii tells me “Autodesk” is not defined.

This was the absolute solution. Thanks to you so much =)