Please help. New to this.. why wont this work. I just need an ope in the wall

Warning is Wallopening.by pointwidthheight operation failed. can not load type ,autodesk.revit.DB.DisplayUnitType’ from assembly ‘revitAPI,Version=23.0.0.0 Culture=neutral, publickeytoken=null’.

What package is that from? Looks like the node was built for a different version of Revit than you have (ie: Revit 2022 or 2021 instead of 2023) so it is trying to load a Revit class (UnitType) which doesn’t exist in 2023 and up (the new type is called ForgeUnit if memory serves).

Hi, here is an example using the API

(Only rectangular openings for this method)

I’ll let you manage the changes if you have a list

Python code:

import clr
import sys

clr.AddReference("RevitNodes")
import Revit
clr.ImportExtensions(Revit.Elements)
clr.ImportExtensions(Revit.GeometryConversion)
clr.AddReference("RevitServices")
import RevitServices
from RevitServices.Persistence import DocumentManager 
from RevitServices.Transactions import TransactionManager 

clr.AddReference("RevitAPI")
clr.AddReference("RevitAPIUI")

import Autodesk 
from Autodesk.Revit.DB import *
from Autodesk.Revit.UI import *

doc = DocumentManager.Instance.CurrentDBDocument
uiapp = DocumentManager.Instance.CurrentUIApplication 
app = uiapp.Application 
uidoc = uiapp.ActiveUIDocument

#######OK NOW YOU CAN CODE########
mur=UnwrapElement(IN[0])
pa=IN[1].ToXyz()
pb=IN[2].ToXyz()
TransactionManager.Instance.EnsureInTransaction(doc)
a=doc.Create.NewOpening(mur,pa,pb)
TransactionManager.Instance.TransactionTaskDone()

OUT = a

Sincerely
christian.stan

1 Like

Dear jacob,
Can i get explain little bit deeper with examples i can understand better i am allso facing the same issues.

With your own code or a package?

If your code, post it so we can review.

If a package, which package and version so we can guide you.