Revit API Forum
Welcome to Autodesk’s Revit API Forums. Share your knowledge, ask questions, and explore popular Revit API topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

CutFailures CannotCutJoinedElement

1 REPLY 1
SOLVED
Reply
Message 1 of 2
desdinova
372 Views, 1 Reply

CutFailures CannotCutJoinedElement

2017-03-20_23-16-00.png

 

Hello friends

I want to delete this warning with api.

 

void ControlledApplication_FailuresProcessing(object sender, Autodesk.Revit.DB.Events.FailuresProcessingEventArgs e)
        {
            FailuresAccessor a = e.GetFailuresAccessor();

            IList<FailureMessageAccessor> failures = a.GetFailureMessages();

            foreach (FailureMessageAccessor f in failures)
            {
                FailureDefinitionId id = f.GetFailureDefinitionId();

                if (id == BuiltInFailures.CutFailures.CannotCutJoinedElement)
                {
                    a.DeleteWarning(f);
                }
            }

        }

The code above didn't work for me.

How can i solve the problem.

Thanks in advance...

 

I also try

 

 

 using (Transaction t = new Transaction(doc, "Join"))
{
t.Start();

FailureHandlingOptions failureHandlingOptions = t.GetFailureHandlingOptions();
failureHandlingOptions.SetFailuresPreprocessor(new CannotCutJoinedElementFailuresPreprocessor());
t.SetFailureHandlingOptions(failureHandlingOptions);

My code here...

t.Commit();
  }

 

 

 

1 REPLY 1
Message 2 of 2
mwilson1
in reply to: desdinova

Your screenshot shows a picture of an error message, not a warning. Your code is attempting to resolve a warning here:

 

a.DeleteWarning(f);

Your need to resolve the error with something like what is posted here:

 

http://thebuildingcoder.typepad.com/blog/2010/11/failure-api-take-two.html

 

if (fs == FailureSeverity.Warning)
                    {
                        failuresAccessor.DeleteWarning(failure);
                    }
                    if (fs == FailureSeverity.Error)
                    {
                        failuresAccessor.ResolveFailure(failure);
                    }

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Rail Community