Doors are placed but don't cut host

Hi, I am trying to create a family container file. So I am using Dynamo to place doors in host walls. The problem I am having is that after the first five doors are placed the following doors are placed but don’t cut the host. They seem to be not actually hosted in the wall but that seems impossible because they are doors.

When in Dynamo if I change host wall height and then rerun this causes them to become hosted in correct wall. But I am trying to get this script to be used with Dynamo player and so that won’t be a workable solution for me.

1 - Doors Windows - CW Doors Windows #4.dyn (1.3 MB)

Hi, @simon_murphy1
I had a quick look at the script without even running, just to better understand your intentions.
My guess about the error is the location point of the family because I see you worked in the ProtoGeometry environment (the Dynamo one) and then used directly its geometry to the doors’ creation.

Anyway, my suggestion is to simplify the graph and the script: here a Python that will create door at the center of the provided wall (only if you give the same number of walls and door types). On my side, this is working well, let me know if it is the same for you.

# INPUTS
walls = UnwrapElement(IN[0])
doorsType = UnwrapElement(IN[1])

result = []
if len(walls) == len(doorsType):
	# "Start" the transaction
	TransactionManager.Instance.EnsureInTransaction(doc)
	
	for w, d in zip(walls, doorsType):
		pt = w.Location.Curve.Evaluate(0.5,True)
		lvl = doc.GetElement(w.LevelId)

		try:
			newDr = doc.Create.NewFamilyInstance(pt, d, w, lvl, StructuralType.NonStructural).ToDSType(False)
		except Exception as ex:
			newDr = str(ex)
		result.append(newDr)

	# "End" the transaction
	TransactionManager.Instance.TransactionTaskDone()
	OUT = result
else:
	OUT = "the number of the wall do not match with the doors \n" + str(round(len(walls))) + " walls / " + str(round(len(doorsType))) + " door types"

Hi @Giuseppe_Dotto,

I am afraid to say that didn’t work either. In my script I am creating two grids of normal walls to host doors and windows and two grids of curtain walls where I swap the panels for curtain wall door and windows.

I have added in Transaction Start and End nodes to ensure the walls are created first but even this doesn’t work. For some strange reason the first five doors are created correctly but the rest don’t get hosted.

1 - Doors Windows - CW Doors Windows #5.dyn (1.3 MB)

If I run the script once the first five doors are created properly. Then if I change the height input of the walls and rerun the script then the rest of the doors are hosted properly but the first five get deleted.

It works if I set the sill height of the doors after I create them.

1 - Doors Windows - CW Doors Windows #6.dyn (1.3 MB)

using the script I share, providing the walls in IN[0] and the door types in IN[1], it doesn’t work yet?
Then there must be something before the script… let’s try to include into the python also the wall creation so to be sure that the passes are in the correct order.
As you can see, here I had to add an input (the level) so to let the walls being created right before the door placement. Check it ou:

# INPUTS
wallsLines = UnwrapElement(IN[0])
doorsType = UnwrapElement(IN[1])
lev = UnwrapElement(IN[2])

	

result = []
if len(wallsLines) == len(doorsType):
	# "Start" the transaction
	TransactionManager.Instance.EnsureInTransaction(doc)
	
	walls = []
	for ln in wallsLines:
		new_w = Wall.Create(doc, ln.ToRevitType(), lev.Id, False)
		walls.append(new_w)
		
	for w, d in zip(walls, doorsType):
		pt = w.Location.Curve.Evaluate(0.5,True)

		try:
			newDr = doc.Create.NewFamilyInstance(pt, d, w, lev, StructuralType.NonStructural).ToDSType(False)
		except Exception as ex:
			newDr = str(ex)
		result.append([w.ToDSType(False), newDr])
		
	# "End" the transaction
	TransactionManager.Instance.TransactionTaskDone()
	OUT = result
else:
	OUT = "the number of the wall do not match with the doors \n" + str(round(len(walls))) + " walls / " + str(round(len(doorsType))) + " door types"
1 Like

I think creating the walls inside the python script might work but I don’t have time to check now. Thank you for the assistance.