[Request] Locking: Enhanced-Locking of Geometry
-
I have created a model for a client. Part of the structural elements should/must NOT be altered. Other elements can be altered.
The client is being given the model so they can alter or move certain structural and mechanical elements. I want to make sure they don't alter the core, structural geometry.
I have used SU's out-of-the-box locking but that does not prevent someone from unlocking things.
I was thinking of one of the following methods to use:
1-Apply a password to geometry when locking. Only the "project administrator" and certain team members would be given the password. Also, what about an option to enhance-lock/enhance-unlock geometry by picking a layer name? Objects added to that layer would not automatically be locked.
OR
2- A script that would disable (overide) SU's built-in unlocking function. If the script is loaded in the SU/plugin's directory, the user could not lock or unlock geometry. Or, if loaded, unlocking/locking could be activated via a password.
#2 seems to have more appeal to me because it eliminates the risk of forgetting a password.
If an "enhanced-locked" object is clicked/selected could there be a message displayed next to the cursor ?. The message could be changed by manually editing the .Rb file.
-
Unfortunately, none of these options are technically doable with the SketchUp Ruby API.
-
Thank you for the quick reply, Tom
-
Sorry it could not be of any help.
You could throw the idea at Google... -
You could do this using an observer that spots objects on a specific layer and prevents them being edited - grouped/locked etc. The password of the [un]locking is saved as a model attribute... but [the BIG BUT] if the .rb/.rbs file that is needed to auto-load and add that observer and thereby 'lock' things can be easily removed from the Plugins [or Tools] folder and then on a restart the locking is inactive and you are as you were before. So this is no use for securing your SKP data if it's to be distributed to others a sthey simply don't laod the script! ... BUT it might have some use 'internally' in-house to ensure that the uninitiated cannot tamper with some aspect of your SKPs... however you still need to have a .rbs auto-loading - perhaps one that also offers some other unique functionality so that disabling it is not acceptable to your own users either...
-
@tig said:
You could do this using an observer that spots objects on a specific layer and prevents them being edited - grouped/locked etc. T
How would you "lock" it?
-
This is all very hypothetical... even 'academic'...
An observer would perhaps look for changes to entities and find all on layer XXXX that are not 'grouped' and always ensure that all objects on that layer are part of a special humungous group that is locked [preventing if from being changed]. Thereby if you changed an object's layer to XXXX the it's auto-locked.
A second observer looks at the group and prevents it from being unlocked - sogroup.locked if not group.locked?
.
A third observer looks at layers and if layer XXXX is renamed it's renamed back as XXXX...
A fourth observer looks at the special group and if its layer changed it reverted to...
etc etc
A convolution of observers could do it BUT as I said somewhat pointless since simply removing the script so it doesn't auto-load stops everything working anyway... -
Observing for changes is one thing, but it's the preventing change that I find to be the main issue.
-
You can readily do
group.locked if not group.locked?
once somehthing has changed and been observed, as you would have given 'group' a special attribute etc...
My HolePuchTool has various observers, including a selection observer - so it a selection contains an instance with a certain attribute then the selection is adjusted to include all other entities with the matching attribute. So if you highlight a cutting-component that's been punched all of the geometry to its reveals are highlighted to, so when you move one the others move - thus it's like them being grouped - however if you select part of the reveal all of the reveal geometry is selected but the instance isn't - to allow for adjustments etc
...
but as I said it's all pretty much academic for locking'.
Advertisement