Align and lock walls

Is there any way to align and link all joined walls together by using dynamo python script ??