RevitiAPI: CrossFitting creation problem – InvalidOperationException: failed to insert cross.

中文链接

By Aaron Lu

I was asked a problem about create Cross Fitting,

I remember that the cross fitting creation method Document.Create.NewCrossFitting needs 4 connectors as arguments, the order of those connectors is not arbitrary, as Jeremy said in this post http://thebuildingcoder.typepad.com/blog/2014/10/newcrossfitting-connection-order.html, it should be main-main-side-side rather than main-side-main-side.

But when I got the file and test it, it always throws InvalidOperationException: failed to insert cross, no matter what order I tried.

Autodesk.Revit.Exceptions.InvalidOperationException: failed to insert cross.

It is wired. But fortunately I found the cause: the Routing Preference is not set for Cross.

After setting it, the problem has gone!

Pick the pipe > Edit type > Routing Preferences > Cross > select "All"

as below:

CreateCrossFailedBecauseOfRoutinePreferenceSetting

 


Comments

One response to “RevitiAPI: CrossFitting creation problem – InvalidOperationException: failed to insert cross.”

  1. I’d like to thank the author for writing such an insightful and informative blog post about revit api debuging that is not just useful to the readers but also revealing.

Leave a Reply

Discover more from Autodesk Developer Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading