"A serious error has occurred. " when place component on face

"A serious error has occurred. " when place component on face

mateus.komarchesqui
Enthusiast Enthusiast
1,204 Views
12 Replies
Message 1 of 13

"A serious error has occurred. " when place component on face

mateus.komarchesqui
Enthusiast
Enthusiast

I am having this issue "A serious error has occurred. It is strongly recommended that you use Save As to save your work in a new file before continuing." when I try to place via code a custom family on a beam face.

 

Weird fact is: I only get this error if the beam has never been modified before. If I create an openning on any of it's faces, for instance, and then run my code, it works perfectly. The same occurs with any type of "update" to the beam, placing on face, openning, whatever. It runs smoothly unless the beam is a "virgin" element.

 

What can I do to get it sorted?

1,205 Views
12 Replies
Replies (12)
Message 2 of 13

naveen.kumar.t
Autodesk Support
Autodesk Support

Hi @mateus.komarchesqui ,

 

Are you facing this issue only while using API?
Could you please try and tell me whether you are getting the same error while trying to place a custom family on a beam face via UI?
Which version of Revit are you using?


Naveen Kumar T
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 3 of 13

mateus.komarchesqui
Enthusiast
Enthusiast

Hi there!

 

Yes, I'm facing this issue through the API. 

 

Via UI I am able to place the family without any problem. 

 

Taking the "virginity" of the element can be made though UI by just placing some sort of family in it's face or openning it. And then my code, via API, works normally.

 

Sorry if I wasn't very clear at first. Any doubt I'll answer ASAP.

0 Likes
Message 4 of 13

naveen.kumar.t
Autodesk Support
Autodesk Support

Hi @mateus.komarchesqui .

 

Could you please send us the details about the Revit?
Which Revit version(for example 2022 version 2) are you using?
Also, Could you please send us a non-confidential sample code and non-confidential sample project, and step by step approach to reproduce the issue?


Naveen Kumar T
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 5 of 13

mateus.komarchesqui
Enthusiast
Enthusiast

I am quite sure I'm using revit 2021.1, but I'll confirme it latter on.

 

Right now I'm at the university, latter today I'll be able to send the sample code. Is there any e-mail where I can send it more confidentially? I'm afraid I can't post it in open internet, company policy...

 

About the .rvt project, any project can be used to reproduce the error, just create a new project and place a concrete precast beam of any length anywhere. I thought this error where caused by a corrupted family and tried creating a clean new project, but the error persists.

0 Likes
Message 6 of 13

naveen.kumar.t
Autodesk Support
Autodesk Support

Hi @mateus.komarchesqui ,

 

Please note, To analyze an issue, we want non-confidential information from the customer.

 

If your issue is related to a particular specific sample file, then only, we get confidential information from the customer. (we have a lot of restrictions when it comes to customer's confidential information)

 

From your posts, it looks like your issue is not related to a specific file.

 

Please isolate the issue and send us the below details to analyze this issue.


1)Simple small minimum Non-confidential sample code
2)Simple small minimum Non-confidential Sample file and family file
3)Step by Step approach to reproduce the issue(UI and API)
4)Observed Result vs Expected Result
5)Revit Version details.

 

If you are unable to provide the above details, then please explain your issue with the below details
1)what type of family are you trying to place in beam face
2)what type of beam are you using etc.,,


Naveen Kumar T
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 7 of 13

mateus.komarchesqui
Enthusiast
Enthusiast

1)Simple small minimum Non-confidential sample code

 

 

 

Element beam = doc.GetElement(beamId);
                        
                    Line beamCurve = (beam.Location as LocationCurve).Curve as Line;

                    XYZ start = beamCurve.GetEndPoint(0);
                    XYZ end = beamCurve.GetEndPoint(1);
                    XYZ mid = (start + end) / 2;
                    // Get top face of beam element
                    Face beamTopFace = BeamGeometry.GetBeamVectorFace(beam, Autodesk.Revit.DB.XYZ.BasisZ);
                    
                    XYZ direction = (beamTopFace as PlanarFace).FaceNormal.CrossProduct(XYZ.BasisZ);
                    if (direction.IsZeroLength())
                    {
                        direction = (beamTopFace as PlanarFace).FaceNormal.CrossProduct(XYZ.BasisX);
                    }

                    if (!familySymbol.IsActive)
                    {
                        familySymbol.Activate();
                        doc.Regenerate();
                    }

                    doc.Create.NewFamilyInstance(beamTopFace, mid, direction, familySymbol);

 

 

 


2)Simple small minimum Non-confidential Sample file and family file

Sample project: Project1 (note that the middle beam that has a corner cut doesn't fail he sample code)

sample family: EST-InsertoEstrutural-7TS

 


3)Step by Step approach to reproduce the issue(UI and API)

Via UI the problem doesn't occur. To reproduce via API:

1) select one concrete pre-cast beam (set beamId to the element.Id) that has not been modified in the model, only placed

2) set familySymbol with the structural-connection family

3) run the sample code

4) get the error

 

To avoid error:

1) through UI modify the target (beamId) pre-cast beam (open it's face, place a structural connection, whatever)

2) set familySymbol with the structural-connection family

3) select one concrete pre-cast beam that has not been modified in the model, only placed

4) run the sample code

5) structural connection placed successfully


4)Observed Result vs Expected Result

Observed: Error "A serious error has occurred. " when beam was not modified between placing it in the model and running sample code. (To reproduce select "virgin" beam and run sample code).

 

Expected result: Structural connection family placed in the middle of selected beam without any error. (To reproduce open a corner of the beam's face before running sample code).


5)Revit Version details.

Revit FULL 2021.1.2.

*same occurs to Revit FULL 2022

0 Likes
Message 8 of 13

naveen.kumar.t
Autodesk Support
Autodesk Support

Hi @mateus.komarchesqui ,

 

Thank you for providing the required information. I have some important works to look into. Please give me some time, I will analyse your issue and come back to you.


Naveen Kumar T
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 9 of 13

naveen.kumar.t
Autodesk Support
Autodesk Support

Hi @mateus.komarchesqui ,

 

With the help of the information, you provided I was able to recreate the problem on my end.

I have submitted the case to the Revit Engineering team for further investigation into this issue.

I will come back to you as soon as I receive a response from the Engineering team.


Naveen Kumar T
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 10 of 13

mateus.komarchesqui
Enthusiast
Enthusiast
Perfect! Thank you for all the help!
0 Likes
Message 11 of 13

naveen.kumar.t
Autodesk Support
Autodesk Support

Hi @mateus.komarchesqui ,

 

The development team confirmed the issue and closed  REVIT-190849 ["A serious error has occurred." when place component on face] as a code fix needed.

 

Please make a note of this number for future reference.


Naveen Kumar T
Developer Technical Services
Autodesk Developer Network

0 Likes
Message 12 of 13

BinghuiLi
Participant
Participant

Hi @naveen.kumar.t ,

 

I would like to ask if there is a new update to this question? I have the same situation in version 2023.1.

 

Best Regards,

Binghui Li

0 Likes
Message 13 of 13

naveen.kumar.t
Autodesk Support
Autodesk Support

Hi @BinghuiLi ,

 

Unfortunately, there are no updates from the Engineering team at this time. I have requested an update from them and will notify you as soon as I receive a response. ( REVIT-190849 )


Naveen Kumar T
Developer Technical Services
Autodesk Developer Network

0 Likes