Message 1 of 8
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I am trying to create a wall with a list of curves using the overload in IronPython:
public static Wall Create(
Document document,
IList<Curve> profile,
ElementId wallTypeId,
ElementId levelId,
bool structural
)
What I do is I get the lines, ordered them sequentially and create the wall. With a rectangular wall, it does work well. The issue is when adding a hole in the profile curves. I cannot stop getting Failed to create wall error. I tried all sorts (reordering the other way around) of workarounds but nothing seems to work.
This is the method I use to order the lines before calling the wall creation (all lines are cloned before trying to create the new wall and comes from the edges of an actual wall):
def foundFollowingCurve(self, sel_crv, outer_crvs, array_curves, skip_ind):
try:
st_po = sel_crv.GetEndPoint(0)
end_po = sel_crv.GetEndPoint(1)
for ind, out_crv in enumerate(outer_crvs):
if not ind in skip_ind:
at_st_po = out_crv.GetEndPoint(0)
at_end_po = out_crv.GetEndPoint(1)
if (end_po.IsAlmostEqualTo(at_st_po) or st_po.IsAlmostEqualTo(at_st_po)):
skip_ind.Add(ind)
array_curves.Add(out_crv)
return self.foundFollowingCurve(out_crv, outer_crvs, array_curves, skip_ind)
elif (end_po.IsAlmostEqualTo(at_end_po) or st_po.IsAlmostEqualTo(at_end_po)):
skip_ind.Add(ind)
array_curves.Add(out_crv.CreateReversed())
return self.foundFollowingCurve(out_crv, outer_crvs, array_curves, skip_ind)
return array_curves, skip_ind
except Exception as e:
Autodesk.Revit.UI.TaskDialog.Show("Exception", str(e) + " - " + str(sys.exc_info()[-1].tb_lineno))
Anyone had experience this issue before?
Thanks
Solved! Go to Solution.