Hi, I’m trying to change all Dynamo nodes into single python script.
What I’m trying to make is pretty simple. Several curves imported from .dxf file on Revit, and making a solid with those curves(while doing some difference operation to make a hole)
The problem is that I cannot acces some sub-classes of Autodesk.DesignScript.Geometry.
As you can see in these pictures, it returns a error “AttributeError : type object ‘Surface’ has no attribute ‘ByPatch’ ['File”", line 25, in \n’].
I need to patch the curves, + do difference between the patched surfaces + extrude final surface as solid.
Plz help.
P.S. It is totally fine to use only Revit to do the same thing if that is possible. Just doing it with python code is important.
import sys
import clr
clr.AddReference(‘ProtoGeometry’)
from Autodesk.DesignScript.Geometry import *clr.AddReference(‘RevitAPI’)
from Autodesk.Revit.DB import *clr.AddReference(“RevitNodes”)
import Revit
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)clr.AddReference(“RevitServices”)
from RevitServices.Persistence import DocumentManager
from RevitServices.Transactions import TransactionManagerdoc = DocumentManager.Instance.CurrentDBDocument
t5 = Revit.Elements.Element.Geometry(IN[0])
surface = Surface.ByPatch(t5)surface_hole = surface[0]
for i in range(1, len(surface)):
surface_hole = Autodesk.Surface.Difference(surface_hole, surface[i])solid = Autodesk.Surface.Thicken(surface_hole, -3000, false)
geometry = Geometry.Rotate(solid, Plane.YZ(), -90)
OUT = geometry