API bug in Document.Regenerate()?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
further to this post I made a little while back I have done some more investigation and have kind-of narrowed it down to a bug in the API (I say kind-of because although I can watch it happen and recreate it reliably in my production code I am as yet unable to reproduce it in isolation using minimal example code that would be suitable for posting here). whatever is happening is definitely triggered by Document.Regenerate() though, which is why I am blaming the API.
the basic outline of the problem is as follows:
- I obtain the PlanarFace that was created in a wall by the opening cut of a door instance and store it in a variable (specifically the head face which has face normal of 0, 0, -1)
- I then place some line-based family instances on some other wall faces created by the same door without any problems
- I call Document.Regenerate()
- I then attempt to place a line-based family instance on the head face and CreateFamilyInstance fails.
- If I remove the Regenerate call and try again it all works perfectly.
stepping through with the debugger I put a watch on both the Normal and Origin property of the PlanarFace object and vaerified that they remained unchanged all of the way through untill after the Document.Regenerate() call where the values for both instantly changed. It's as if the object now references a completely different face.
Another strange behaviour is that if I call Document.Regenerate() before obtaining the Face objects then subsequent calls do not trigger the bug, it seems to only happen for the first regen call within a transaction.