Model Line to Room boundary line issue

Hello Dynamiters,

in the workflow I place some revit groups, and later I also place the rooms and the room boundary lines and the room tags. The revit groups contain floors, walls and furniture and also model lines in the location the room boundary lines should be located. I managed to take the information from these model lines in the groups and generate the room boundary lines.
The problem is that the generated boundary lines dont separate the rooms but when I move manually a bit these lines they became “active” and do separte the rooms. I am not sure if the problem is understood but here is an screenshot, where red lines are the generated room boundary lines. Does anybody have any idea how could I sort out the issue?
Thanks in advance

here the def that generate the roomboundary lines

def create_room_boundaries(group, view):
    room_boundaries = []
    origin_List = []
    for member_id in group.GetMemberIds():
        member = group.Document.GetElement(member_id)
        try:
            typ = str(member.CurveElementType)
        except:
            typ = None    
        if typ == "ModelCurve":
            if member.LookupParameter("Linienstil") != None:
                if member.LookupParameter("Linienstil").AsValueString() == "<Verdeckt>":
                    origin = member.GeometryCurve.Origin
                    if origin not in origin_List:
                        origin_List.append(member.GeometryCurve.Origin)
                        CurveArray = DB.CurveArray()
                        CurveArray.Append(member.GeometryCurve)
                        sep_line = doc.Create.NewRoomBoundaryLines(view.SketchPlane, CurveArray, view)
                        room_boundaries.append(sep_line)

    return room_boundaries

Hello @igpema
try to change (a little bit) the LocationCurve of ModelCure separation Line

TransactionManager.Instance.EnsureInTransaction(doc)

CurveArray = CurveArray()
CurveArray.Append(element.GeometryCurve)
sep_line = doc.Create.NewRoomBoundaryLines(view.SketchPlane, CurveArray, view)
oldCurv = sep_line[0].Location.Curve 
newCurv = Line.CreateBound(oldCurv.GetEndPoint(0), oldCurv.GetEndPoint(1) + oldCurv.Direction.Multiply(0.01))
sep_line[0].Location.Curve = newCurv
TransactionManager.Instance.TransactionTaskDone()
1 Like

hello @c.poupin,

great! thanks a lot, somehow you need to move the line a bit to make it works.

here my final def

def create_room_boundaries(group, view):
    room_boundaries = []

    for member_id in group.GetMemberIds():
        member = group.Document.GetElement(member_id)
        try:
            typ = str(member.CurveElementType)
        except:
            typ = None    
        if typ == "ModelCurve":
            if member.LookupParameter("Linienstil") != None:
                if member.LookupParameter("Linienstil").AsValueString() == "<Verdeckt>":
                    CurveArray = DB.CurveArray()
                    CurveArray.Append(member.GeometryCurve)
                    sep_line = doc.Create.NewRoomBoundaryLines(view.SketchPlane, CurveArray, view)
                    oldCurv = sep_line[0].Location.Curve 
                    newCurv = DB.Line.CreateBound(oldCurv.GetEndPoint(0), oldCurv.GetEndPoint(1) + oldCurv.Direction.Multiply(0.01))
                    sep_line[0].Location.Curve = newCurv
                    room_boundaries.append(sep_line)
    return room_boundaries