Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RevitRibbonControl non-public break main Ribbon. #292

Closed
ricaun opened this issue Sep 23, 2024 · 7 comments
Closed

RevitRibbonControl non-public break main Ribbon. #292

ricaun opened this issue Sep 23, 2024 · 7 comments
Labels
bug 🐛 An unexpected issue that highlights incorrect behavior need more info 📌 More info are needed to investigate this

Comments

@ricaun
Copy link
Contributor

ricaun commented Sep 23, 2024

RevitLookup version

2025.0.9

Steps to reproduce

If the option non-public is enable in RevitLookup and you snoop the Ribbon inside the Component manager the main Revit ribbon stop working.

Here is a video: RevitLookup - Snoop RevitRibbonControl breaks main Ribbon.

RevitLookup - RevitRibbonControl

I don't know yet what specific non-public member in RevitRibbonControl that is breaking the UI, gonna make some tests later.

@ricaun ricaun added bug 🐛 An unexpected issue that highlights incorrect behavior unverified ⌛ Needs more investigation to conclude it's an actual bug labels Sep 23, 2024
@Nice3point
Copy link
Collaborator

Most likely the private members contain a method or property that causes this glitch. Which does not return a value, but changes something in the normal behavior. The only thing to do is to figure out what the method is and forcibly disable it

@Nice3point Nice3point added need more info 📌 More info are needed to investigate this and removed unverified ⌛ Needs more investigation to conclude it's an actual bug labels Sep 23, 2024
@ricaun
Copy link
Contributor Author

ricaun commented Sep 23, 2024

Which does not return a value

The void methods is ignore right?

@Nice3point
Copy link
Collaborator

The void methods is ignore right?

Yes, but we have a methods like Focus() that returns bool

@ricaun
Copy link
Contributor Author

ricaun commented Sep 23, 2024

The void methods is ignore right?

Yes, but we have a methods like Focus() that returns bool

The Enter() that returns bool breaks the UI.

Here is a quick command to break the Revit ribbon.

[Transaction(TransactionMode.Manual)]
public class Command : IExternalCommand
{
    public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elementSet)
    {
        var ribbon = UIFramework.RevitRibbonControl.RibbonControl;
        var type = ribbon.GetType();
        var method = type.GetMethod("Enter", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Instance); // System.Windows.Media.Visual
        var result = method.Invoke(ribbon, null);
        Console.WriteLine($"{method} \t {result}");

        return Result.Succeeded;
    }
}

@ricaun
Copy link
Contributor Author

ricaun commented Sep 23, 2024

Maybe the methods should be only executed if the use click, is related to this issue as well: #239

@Nice3point
Copy link
Collaborator

Yes, I plan to take the Lookup engine out as a new project and develop it separately, it will be easier to test and implement such functionality. It will be possible to add Lazy evaluation and Force evaluation for similar cases

@Nice3point
Copy link
Collaborator

Nice3point commented Sep 23, 2024

The Enter() that returns bool breaks the UI.

Oh great, thanks for research 🎉

@Nice3point Nice3point moved this to Pre-release in RevitLookup roadmap Sep 29, 2024
@Nice3point Nice3point closed this as completed by moving to ✅ Done in RevitLookup roadmap Sep 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 An unexpected issue that highlights incorrect behavior need more info 📌 More info are needed to investigate this
Projects
Status: ✅ Done
Development

No branches or pull requests

2 participants