I am working on developing a script to place doors and windows at CAD block locations after linking CAD in Revit, but I am not able to place all door family types; some are placed, while others show an error.
I have referred to a YouTube video. Please find the attached Dynamo script.
Yes, I created a wall as required. When I run the Dynamo script, not all doors get placed at their required location; some of them give a " wall not able to cut error.
I am looking to resolve this issue for both windows and doors.
Hi, I checked it again, and it is working, and the window cuts through the wall. I also checked in Revit 2025, and CAD Block nodes from the GeniusLoci package can extract data, but return a null value. I switched to Revit 2024. Please help me make this script Revit version-independent so it can run on Revit 2024 and later.
is that the latest from genius loci, and do you have the right ironpython package installed as well ??? you could try here for cpyhon 3…and see if it could be better…
import clr
clr.AddReference('RevitAPI')
import Autodesk
from Autodesk.Revit.DB import Options,GeometryInstance, XYZ
clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.GeometryConversion)
clr.ImportExtensions(Revit.Elements)
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager
import math
uiapp = DocumentManager.Instance.CurrentUIApplication
version=int(uiapp.Application.VersionNumber)
points,rotations,blocks,layersAll=[],[],[],[]
elem = UnwrapElement(IN[0])
geoElem = elem.get_Geometry(Options())
for geoObj in geoElem:
transform=geoObj.Transform
instance=geoObj.SymbolGeometry
for inst in instance:
layers=[]
if isinstance(inst,GeometryInstance):
points.append(transform.OfPoint(inst.Transform.Origin).ToPoint())
rotation=abs(math.degrees(inst.Transform.BasisX.AngleOnPlaneTo(XYZ.BasisX, XYZ.BasisZ))-360)
if round(rotation,3)==360:
rotation = 0
rotations.append(round(rotation,3))
if version > 2022:
blocks.append(elem.Document.GetElement(inst.GetSymbolGeometryId().SymbolId).ToDSType(True).Name.split(".dwg.")[-1])
else:
blocks.append(inst.Symbol.ToDSType(True).Name.split(".dwg.")[-1])
geom=inst.SymbolGeometry
for geo in geom:
try:
layers.append(elem.Document.GetElement(geo.GraphicsStyleId).GraphicsStyleCategory.Name)
except:
layers.append(None)
if layers != [] : layersAll.append(layers[0])
else : layersAll.append(layers)
OUT = blocks,points,rotations,layersAll