Sample code showing a progress bar during rhino command

Hi All,

I’ve got a request to add a progress form to a rhino command. This would essentially just be a progressbar with possibly a cancel button.

Trouble is I don’t have much experience with threads and this type of code, and most examples seem to use a background worker from a form (which I don’t know if I can use from a rhino command).

I’ve set up the stub code for a command, if anyone can assist with how to interact with the progress form from that it would be greatly appreciated. Or any references to samples relevant also would be great.

Thanks in advance,

Jon (8.5 KB)

Depending on what you are doing, you might not need any fancy treading stuff. Often, just displaying a modeless form instead of a model form (form.Show vs form.ShowDialog). Then in your time consuming loop, just call into your form to increment a progress meter. While you are there, you can check to see if a cancel button was press and then take the appropriate action.

Cheezy modeless form example.

Thanks Dale, seems to work as I need. I was over complicating things.

Hope you’re well.