Announcements

The Autodesk Community Forums has a new look. Read more about what's changed on the Community Announcements board.

Error: circular chain of reference when creating opening on a floor

Anonymous

Error: circular chain of reference when creating opening on a floor

Anonymous
Not applicable

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);

0 Likes
Reply
Accepted solutions (1)
754 Views
2 Replies
Replies (2)

jeremytammik
Autodesk
Autodesk
Accepted solution

Try to regenerate the model after creating the floor and before creating the opening.

 

If that does not help, try to commit the transaction after after creating the floor and create the opening in a new separate transaction.

 

If using two or more transactions, you can group them.

 

Read all about the need to regenerate here:

 

http://thebuildingcoder.typepad.com/blog/about-the-author.html#5.33

 

Cheers,

 

Jeremy

 

 



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

Anonymous
Not applicable

 

Dear Mr.Tammik

 

Thank you for replying, now the problem is solved by regenerating and I can make opening like that

 

Best Wishes

 

TIMOpening.png

 

 

 

 

 

0 Likes

Type a product name