Is it possible to put rhino in semi-locked state where user can visualize the model, rotate it, pan, etc. but cannot make any change to the model, open/ save other models, close rhino, etc. ?

Tags: locked, rhino

Views: 145

Replies to This Discussion

Sorry, no. Why do you need to do this?

 -- Dale

I am developing a plugin in which there is some background processing involved.. Now until that background process is complete, I want to restrict modifications to the rhino model.. But at the same time it is good to atleast allow user to visualize it..

I have seen the read-only mode in rhino in which if rhino finds .rhl file, it wont allow user to modify the model but simply allow him to visualize it.. But user can still close the rhino application or close the currently open model.

If such a feature were available, I believe it can be used in tandem with other operations in rhino. Many say that it is better user experience.

This feature is available in Solidworks. It is not available in UI menu, but it is part of API.


Thanks for your help.. I am glad that the forum is so active and thanks to you we get answers so quickly.

Hi Varun,

Why not have the command start the background process and not let the command end until the background process is complete?

 -- Dale

Hello Dale,

Can you explain how to not let the command end? How do we do that?

Regards
Varun

I guess I need more about what you are doing. What kind of calculaton are you making? What do you want to see in the UI - the existing model or new geometry? Hopefully you won't be accessing the Rhino document from your calculation thread, as Rhino is not thread safe.

More details would be appreciated.

Thanks,

 -- Dale

Hello Dale, 

Before it starts a background thread, it creates a copy of the currently open document.. Then in the background it is uploading this document to the server. So we want to restrict user from editing this document till the upload is complete. (He should still be able to visualize it, pan, zoom, etc)

Another use case is to download a document from the server in background and when the download is complete, open this downloaded document. 

Regards

Varun

Hi Varun,

Like I mentioned, from within a command start your background process. But, do not let the command finish until the background process is complete. While your background thread is running, have the main thread poll to see if it still running, and if so call Rhino.RhinoApp.Wait. This will keep the Windows message pump alive so views will update and windows will repaint. 

Sorry I don't have sample that demonstrates this, but it should take much if you understand threading.

 -- Dale

RSS

Translate

© 2014   Created by McNeel Admin.

Badges  |  Report an Issue  |  Terms of Service