Using DSCoreNodes in a Python Node

Hi
I’ve been using DSCoreNodes in Python previously with no problems,
But recently I get this error message:
“AttributeError: attribute ‘Name of module’ of ‘namespace#’ object is read-only”
image

What has changed?
How can I use the core nodes in Python?

DSCore doesn’t have a namespace called Elements hence the exception (albeit not a very accurate one).

You need to import the RevitNodes library which has a namespace called Elements, however that still wont help as you’ve unwrapped the Revit element and this namespace and the Element class in it will only work with wrapped Revit elements. So, either don’t unwrap and stick with Dynamo’s RevitNodes libraries (not recommended) or import the Revit API, then you can use the myElement.Geometry[Options()] property (way better to develop around the Revit API than any of Dynamo’s libraries, particularly for performance and cleaner code).

1 Like

Hi Thomas and thanks for replying
I only used getting the geometry as an example here, I usually get it with the Options() from within Python.
Anyway your reply helps a lot.