can't solve failure message

can't solve failure message

Anonymous
Not applicable
891 Views
6 Replies
Message 1 of 7

can't solve failure message

Anonymous
Not applicable

Hello everyone.

I need help understanding how to handle the faileur message bellow:

Capture.PNG

I just need to use Revit APi to Cancel this message and proceed.

this is my Transaction that causes the error message

using (Transaction trans = new Transaction(doc, "setParameter"))
            {
                trans.Start();
                for (int i = 0; i < x.Length; ++i)
                {
                    GlobalParameter parameter = doc.GetElement(new ElementId(variables.ElementAt(i))) as GlobalParameter;
                    parameter.SetValue(new DoubleParameterValue(x.ElementAt(i)));
                }                            
                uiApp.Application.FailuresProcessing += new EventHandler<FailuresProcessingEventArgs>(FailureProcess);
                trans.Commit();
}

and then I'm trying to handle the message, I've Tried without success:

RollBackPendingTransaction

ResolveFailures

 

Any ideas?

Thank you

 

 

0 Likes
892 Views
6 Replies
Replies (6)
Message 2 of 7

jeremytammik
Autodesk
Autodesk

Have you researched what is causing the problem and how to solve it manually through the user interface?

 

That would increase your understanding and clarify the issue.

 

Revit is a real-world BIM modeller.

 

Maybe it is trying to prevent you from creating a model that cannot be constructed in reality.

 



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

0 Likes
Message 3 of 7

Anonymous
Not applicable

Hi Jeremy.

 

I'm using a generative algorithm that is assigning values to Global Parameters and evaluate the solutions.

Some of the solutions it tests are not valid because it breaks some constraints in the project(e.g. eq distances and more). I can manually click on "Cancel" each time this message appears and it will work just fine. But it is very annoying. I just need a way of Cancel or RollBack this Transaction when it causes this kind of error, so my algorithm will not consider this solution.

0 Likes
Message 4 of 7

jeremytammik
Autodesk
Autodesk

Oh, in that case the solution is easy.

 

Just read through the articles on detecting and handling dialogues and failures and you will quickly find a viable solution:

 

https://thebuildingcoder.typepad.com/blog/about-the-author.html#5.32

 



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

0 Likes
Message 5 of 7

Anonymous
Not applicable

Thankyou,

I've already went through all the documentation but I still have a case of a failure message that cant be solved. Maybe some kind of error that can't be treated with API ?! I'll try to identify what is causing this error and I'll come back again to this post.

 

0 Likes
Message 6 of 7

ilya.uvarov.uvaTENNT
Explorer
Explorer

Hello, everyone!

I cannot find this Failure in RevitApiDocs too.

Did anyone find this failure?

0 Likes
Message 7 of 7

TripleM-Dev.net
Advisor
Advisor

Hi,

 

Maybe one of these, in the DimensionFailures?

RegenConstraintUnsatisfied Property 

RegenConstraintUnsatisfiedWarn Property 

 

I haven't looked further, there could be more reasons for the "Constraints are not satisfied" message.

 

- Michel

0 Likes