I created a sample file from a project I'm working on. The embedded macro creates a floor from a room's boundary. I've used this code on hundreds of rooms but then came across a couple of places where I receive a InteropServices.SEHException (0x80004005) External component has thrown an exception. When the code is run on Room 1, you will get the exception. Change the roomNum variable to 2 to run on the other room and it works fine. Thanks for any help.
I created a sample file from a project I'm working on. The embedded macro creates a floor from a room's boundary. I've used this code on hundreds of rooms but then came across a couple of places where I receive a InteropServices.SEHException (0x80004005) External component has thrown an exception. When the code is run on Room 1, you will get the exception. Change the roomNum variable to 2 to run on the other room and it works fine. Thanks for any help.
Just came through this while searching for something... I know it is very old now, but I would prefer to give a piece of advice since there are many reasons that lead to this exception, I don't think you will get an answer unless you explain more by Code. You need to show which line caused the exception and under what condition besides the whole context.
Hope this helps.
Just came through this while searching for something... I know it is very old now, but I would prefer to give a piece of advice since there are many reasons that lead to this exception, I don't think you will get an answer unless you explain more by Code. You need to show which line caused the exception and under what condition besides the whole context.
Hope this helps.
Hi @Moustafa_K . I haven't found a solution to these rooms (other than creating the floor manually). But I thought the title would clue in on where the exception is. Create.NewFloor
Hi @Moustafa_K . I haven't found a solution to these rooms (other than creating the floor manually). But I thought the title would clue in on where the exception is. Create.NewFloor
Hi,
I tested your Revit File on Revit 2021, and it appears to be a bug in Revit API since it works perfectly on 2022.
Worth noting on Revit 2022 the Method of creation has changed to be a static call from Floor Class
public static Floor Create(Document document, IList<CurveLoop> profile, ElementId floorTypeId, ElementId levelId);
also noting, the old method did indeed give the same Error on Revit 2022.
Hi,
I tested your Revit File on Revit 2021, and it appears to be a bug in Revit API since it works perfectly on 2022.
Worth noting on Revit 2022 the Method of creation has changed to be a static call from Floor Class
public static Floor Create(Document document, IList<CurveLoop> profile, ElementId floorTypeId, ElementId levelId);
also noting, the old method did indeed give the same Error on Revit 2022.
Thanks for testing. At least I know its not just me. I suppose there wouldn't be any hope of it being corrected in earlier versions. I'll try in 2022 to confirm that the new methods work. Thanks!
Thanks for testing. At least I know its not just me. I suppose there wouldn't be any hope of it being corrected in earlier versions. I'll try in 2022 to confirm that the new methods work. Thanks!
Just to share something could be a temporary solution
I just realized the in Room 1, when room boundary segments are extracted from the Walls, it creates 6 lines instead of 5. the extra line is a connection between the 2 curved joint walls. this extra arc is of length < 0.007 which is less than 1/16 inch (the max precision unit in Revit) which causes this error when it comes to creating a floor. I bet the new method in 2022 recovered that.
So if you change these 2 curved walls to one curved wall. It would work fine.
hope this helps
Just to share something could be a temporary solution
I just realized the in Room 1, when room boundary segments are extracted from the Walls, it creates 6 lines instead of 5. the extra line is a connection between the 2 curved joint walls. this extra arc is of length < 0.007 which is less than 1/16 inch (the max precision unit in Revit) which causes this error when it comes to creating a floor. I bet the new method in 2022 recovered that.
So if you change these 2 curved walls to one curved wall. It would work fine.
hope this helps
I did suspect that it had something to do with the two arc walls. Thanks for confirming!
I did suspect that it had something to do with the two arc walls. Thanks for confirming!
Can't find what you're looking for? Ask the community or share your knowledge.