Real time output during function execution

Real time output during function execution

pmcmm1
Enthusiast Enthusiast
882 Views
2 Replies
Message 1 of 3

Real time output during function execution

pmcmm1
Enthusiast
Enthusiast

Hi guys,

 

I've been using pyRevit for a while now, and the time has come that I gotta move toward C# to get my code stronger and easier to deploy. C# is definitely slower to code but I'm pretty sure that time will be saved when it comes to maintenance.

 

Anyway, my question is that all my codes were developed around the output window that were providing real time information to the user of what the code was doing.

Ive seen some workarounds, like using System.Windows.Markup.IComponentCollector, but this is not really what I am looking for as it is not a workaround.

 

Is there any simple option that I am missing? Like casting a command line?

 

Thanks,
Pedro

0 Likes
Accepted solutions (1)
883 Views
2 Replies
Replies (2)
Message 2 of 3

opferjohn
Contributor
Contributor
Accepted solution

You could use a Windows Form.  In your code you could open in at the start of your function and update the displayed text on the form as your function executes.  When your function is done executing you can call FormName.Close() to close the form.  Make sure to use the Show() function to display the form rather than the ShowDialog() function as the ShowDialog() function halts the program execution until it is closed.

0 Likes
Message 3 of 3

pmcmm1
Enthusiast
Enthusiast

that was really easy! I was using the right command but I was always starting up a new window.

 

Thanks for the help!

0 Likes