
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Unable to create opening on a created floor, posted error "circular chain of reference"
Problem is floor can be create while not the opening, here are the codes:
CurveArray curveArray = new CurveArray();
curveArray.Append(Line.CreateBound(new XYZ(-50, 50, 3000/304.8), new XYZ(50, 50, 3000 / 304.8)));
curveArray.Append(Line.CreateBound(new XYZ(50, 50, 3000 / 304.8), new XYZ(50, -50, 3000 / 304.8)));
curveArray.Append(Line.CreateBound(new XYZ(50, -50, 3000 / 304.8), new XYZ(-50, -50, 3000 / 304.8)));
curveArray.Append(Line.CreateBound(new XYZ(-50, -50, 3000 / 304.8), new XYZ(-50, 50, 3000 / 304.8)));
CurveArray curveArray1 = new CurveArray();
curveArray1.Append(Line.CreateBound(new XYZ(10, 30, 3000 / 304.8), new XYZ(30, 30, 3000 / 304.8)));
curveArray1.Append(Line.CreateBound(new XYZ(30, 30, 3000 / 304.8), new XYZ(20, 10, 3000 / 304.8)));
curveArray1.Append(Line.CreateBound(new XYZ(20, 10, 3000 / 304.8), new XYZ(10, 30, 3000 / 304.8)));
ElementId levelid = new ElementId(2787);
Level level = doc.GetElement(levelid) as Level;
FloorType floorType = floorTypeFilter(doc, "常规 - 300mm");
Floor newFloor = doc.Create.NewFloor(curveArray,floorType , level, false);
Element NewFloor = newFloor as Element;
Opening opening = doc.Create.NewOpening(newFloor, curveArray1, false);
Solved! Go to Solution.