Starting in December, we will archive content from the community that is 10 years and older. This FAQ provides more information.
Hi,
In my model there are a few familyinstances with an aligned dimension attached to them. When I rotate one of these familyinstances I receive an error dialog: "Error - cannot be ignored. The References of the highlighted Dimension are no longer parallel." Now I have the option to click 'remove references' or click 'cancel' (the button 'ok' is inaccessible / grayed out). 'Remove references' removes the references and Revit continues.
However when I try to suppress this warning (FailureDefinitionId = BuiltInFailures.DimensionFailures.LinearConstraintNotParallel) by using FailuresAccessor.delete(FailureMessageAccessor) in order to delete the references a new error dialog pops up. It is the same one as "Error - cannot be ignored. The References of the highlighted Dimension are no longer parallel" only without the button 'remove references'. Because the OK-button is not accessible I can only click 'Cancel' which rolles back previous transactions. Is there a way to get the warning suppressor to act like the 'normal user input'?
regards,
Raymond
Raymond,
If the IFailureProcessor doesn't solve your problem, you may try following approaches to suppress the dialog:
There are several different possible ways to suppress unwanted dialogues in Revit:
http://thebuildingcoder.typepad.com/blog/2010/08/suppress-unwanted-dialogue.html
Besides, we also can use windows API to suppress dialog, it's more powerful:
http://thebuildingcoder.typepad.com/blog/2009/10/dismiss-dialogue-using-windows-api.html
Hope this is helpful.
this is not a warning, but an error, so it shouldn't be deleted. The error(s) must be Resolved, and the failureProcessingResult must be set.
try this:
failuresAccessor.ResolveFailures(fmas); if (failuresAccessor.CanCommitPendingTransaction()) { return FailureProcessingResult.ProceedWithCommit; } if (failuresAccessor.CanRollBackPendingTransaction()) { return FailureProcessingResult.ProceedWithRollBack; } return FailureProcessingResult.Continue;
thanks for the response but I have tried this solution already. When resolvefailures is hit the error window (as described) shows up immediately (before hitting the next codeline). It seems to me the error is defined, but has no implemented error handler.
Dismissing the whole error window using the windows API seems a buggy and tricky solution to me.
here is my test code that works Revit 2016 and 2018.
public class ReferencesNotParallelSwallower : IFailuresPreprocessor { public FailureProcessingResult PreprocessFailures(FailuresAccessor a) { bool HasErrors = false; IList<FailureMessageAccessor> fmas = a.GetFailureMessages(); if (fmas.Count == 0) { return FailureProcessingResult.Continue; } foreach (FailureMessageAccessor f in fmas) { FailureSeverity failureSeverity = f.GetSeverity(); if (failureSeverity == FailureSeverity.Error && f.GetFailureDefinitionId().Guid.ToString() == "8a9ff20d-fdc2-4f98-87e6-2aa8b71b0c83") { HasErrors = true; } } if (!HasErrors) { return FailureProcessingResult.Continue; } a.DeleteAllWarnings(); a.ResolveFailures(fmas); return FailureProcessingResult.ProceedWithCommit; } }
The most important lines are the last two lines.
this is a different issue altogether.
you probably have defined a DialogBoxShowing eventhandler, and not written any code in the body.
I expect you have a method somewhere that looks like this:
void ThisApplication_DialogBoxShowing(object sender, DialogBoxShowingEventArgs e) { throw new NotImplementedException(); }
remove the line -- throw new NotImplementedException(); --( or the complete method ) .
Can't find what you're looking for? Ask the community or share your knowledge.