[Closed] Disable user properties
Is there a way to make User Properties, inside of Object Properties, read-only except through script?
Basically so a user cannot change the values by hand.
Or has anyone found a work around for this problem?
Thanks
you can’t protect User Properties from changing by hand.
there is AppData mechanism (see mxs -> AppData). it might be what you are looking for…
Hey Denis,
Unfortunately it has to be User Properties. Just trying to find a way for people to not get the urge to try and “fix things” by changing it by hand. You know how it is.
Thanks
encrypt the  User Properties text…  I would like to see anyone who wants manually fix:
“wqi1bCEDkaYPMNfSyMbnI9JaUZF2DKbUrPcP+VyrwU+W0ES3aD2pZib4UHcZc93k0oKYCqmFEcGEltBDXws”
people…
Maybe use DialogMonitorOPS to detect if the object properties window is opened and then automatically close it?
here is another idea – to use callbacks:
fn UserPropNotification type:#pre = 
(
	nodes = callbacks.notificationParam()
	format "% change >>
" (type as string)
	for node in nodes do
	(
		format "	%: %
" node.name (getUserPropBuffer node)
	)
)
callbacks.removescripts id:#UserProp
callbacks.addscript #preNodeUserPropChanged "UserPropNotification type:#pre" id:#UserProp
callbacks.addscript #postNodeUserPropChanged "UserPropNotification type:#post" id:#UserProp
                      
 fn notification act:enabled = 
 (
 	hwnd = DialogMonitorOPS.GetWindowHandle()
 	if (win = UIAccessor.isWindow hwnd) and (text = UIAccessor.GetWindowText hwnd) == "Object Properties" do
 	(
 		tb = for w in (windows.getchildrenhwnd hwnd) where w[4] == "Edit" do exit with w[1]
 		EM_SETREADONLY = 0x00CF
 		windows.SendMessage tb EM_SETREADONLY 1 0
 	)
 	true
 )
 -- enable Watcher
 DialogMonitorOPS.RegisterNotification notification id:#UserPropWatcher
 DialogMonitorOPS.enabled = on
 
 -- disable Watcher
 DialogMonitorOPS.enabled = off
 DialogMonitorOPS.unRegisterNotification id:#UserPropWatcher
 
 
using DialogMonitorOPS set user property text box to READ ONLY.
I like it! well done!