I’m trying to use the Creation.Document.NewSpace(Level, UV) method to create a mechanical space based on the Room element. Though I feed in the Level and a UV point to the method, it tells me a Document is required. I did not find any Space create method requires a Document instance. How to make it work? Thanks in advance.
SpaceFromRoom.dyn (4.0 KB)
doc = DocumentManager.Instance.CurrentDBDocument room = UnwrapElement(IN) theUV = UV(room.Location.Point.X, room.Location.Point.Y) TransactionManager.Instance.EnsureInTransaction(doc) space = Document.NewSpace(room.Level, theUV) TransactionManager.Instance.TransactionTaskDone() OUT = space
Project1.rvt (3.0 MB)