Calling execute method after button click

Calling execute method after button click

an_vuong.nguyen
Contributor Contributor
839 Views
2 Replies
Message 1 of 3

Calling execute method after button click

an_vuong.nguyen
Contributor
Contributor

Hi everyone,

 

I'm trying to call execute method of a class that implements IExternalCommand after clicking button in WPF. Sorry for my non REVIT_API question. But I wonder if anyone has the same problem like me when working on revit api and wpf. This post: https://forums.autodesk.com/t5/revit-api-forum/wpf-button-execute-external-command/td-p/5955892 

has the same question like me. But i did not find solution there. Can anyone help me? 

 

Thank you all

0 Likes
840 Views
2 Replies
Replies (2)
Message 2 of 3

Omar_Amen
Advocate
Advocate

Hi @an_vuong.nguyen,
If your command (class that implements IExternalCommand) already loaded into the revit app, and you can manually run it from (Add-Ins > External Tools),
so I think you can try PostCommand() function which used to excute external commands or Revit built in postable commands!
I hope it helps

0 Likes
Message 3 of 3

Omar_Amen
Advocate
Advocate

another solution you can use...
impalement IExternalEventHandler  instead of IExternalCommand and then anywhere anytime you can raise the event (which has all the command logic [just like IExternalCommand]) 

0 Likes