KennanChan / Revit.Async

Use task-based asynchronous pattern (TAP) to run Revit API code from any execution context.
MIT License
223 stars 51 forks source link

Is there a way to trigger the SaveFamilyCommand() with a MouseEventArgs ? #15

Closed MathieuJsrd closed 2 years ago

MathieuJsrd commented 2 years ago

Hi, Thanks a lot for this awesome repo!

The title is my question : Is there a way to trigger the SaveFamilyCommand() with a MouseEventArgs ?

In the current case, the trigger is the TestWindow Button to save a family. I would like to change the trigger with a MouseEventArgs but because the SaveFamilyCommand is a ICommand class, I have some trouble achieving this...

KennanChan commented 2 years ago

I failed to get the point of "trigger the SaveFamilyCommand with a MouseEventArgs". Could you pls be more specific?

KennanChan commented 2 years ago

If you are using UI events to drive your application(like a winform application), you can definitely use Revit.Async in the event handler to call Revit APIs. In this way you just care nothing about the ICommand abstraction or the WPF command mechanism.