Wall join Python

Hi,
All

I use this Topic but i don’t know where am i wrong.(See Images)

Please give me a solution.

Can you show more of the graph? It seems to be an input problem. Are you inserting elements or a wall type as IN[0]?

i use wall Element as IN[0].

It is probably because of lines 30 and 31 where you have two variables with similar names. You put
for wall in walls_list but then change wall to UnwrapElement(Wall), where Wall (capital W) is a type, not the element anymore. Change line 30 and 31 to:

for i in walls_list:
    wall = UnwrapElement(i)

I’m not sure if this will produce an error about indenting but to be safe, when you change the lines, delete the spaces before wall = and use a tab indent.

i change line 30 and 31, but is not working.

Don’t use capital letter (W) for the beginning of any variable as it is more likely for you to conflict with an existing class or method.
For example, in line 31, here you are referencing the Revit class Wall instead of a variable, which is what you do not want to do. Leave walls_list as all lowercase and change line 31 Wall to a different variable name, or if you must use wall, use lowercase. I would say choose a different name like elem or something.

walls_list = IN[0]
doc = DocumentManager.Instance.CurrentDBDocument
t = Transaction(doc, 'Disallow Wall Wall') #what is this?
t.Start()

for i in walls_list:
    elem = UnwrapElement(i)
    WallUtils.DisallowWallJoinAtEnd(elem, 0)
    WallUtils.DisallowWallJoinAtEnd(elem, 1)

t.Commit()

OUT = walls_list

i change but yet i face same problem.

Did you try flattening the Wall.ByProfile node? As in add a flatten node after Wall.ByProfile and then feed into Python script. The python script isn’t set up to accept nested lists of elements.

Okay, that is better. The next step is that your transaction managers are not correct or outdated as they have been changed since the original post you referenced. Delete line 27 and 28, and add this before line 31, still within the for loop:

TransactionManager.Instance.EnsureInTransaction(doc)

Then replace line 35 with:

TransactionManager.Instance.TransactionTaskDone()

1 Like

Thanks Kenny :+1::+1::+1:

All walls are working in dynamo, but it’s not showing in plan.
i given 100mm gap between two wall.

1 Like

What isn’t showing? The disallow join icon is there (that tetris looking shape) so it means it was successful and showing right? And where/when did you give a 100mm gap?

yes, Right

Disallow icon is there but in plan is not shown gap between two wall.

like,

Red Cloud is my requirement, currently is showing same blue cloud.

Disallow join doesn’t create a gap between the walls, it just doesn’t connect them. If you want a gap, you would have to move/drag the end a distance away.

i have already set distance between two wall as gap (100mm).

Is this in the same script, as it is not in the python you showed? That might be a separate issue. Since your wall join issue has already been solved, could you make a new post with more detail about it.

ok,
one more thing

can i use split with gap command by python??

No you can not
you have to create new walls ( seperate walls)

1 Like

I believe this was asked before and as there is no way to use the split function in the Revit API, it is not possible to be done in Dynamo either.

2 Likes