I did, and I tested it and it did not work in 2 drawings I tested it with. The folks I spoke with that came up with this idea verified it as well.
To be sure, I just now tested and unless I use the method posted earlier the layer stays faded.I modified my test to have the regen occur between the double setting of the sysvar and this does work.
(defun c:locktest2 (/ lays *acad doc lay fadeset)
(setq *acad (vlax-get-acad-object)
doc (vla-get-activedocument *acad)
lay (vla-item (vla-get-layers doc) "Layer1")
)
(if (= :vlax-true (vla-get-lock lay))
(vla-put-lock lay :vlax-false)
(vla-put-lock lay :vlax-true)
)
(setq fadeSet (vla-getvariable doc "LAYLOCKFADECTL"))
(vla-setvariable doc "LAYLOCKFADECTL" 0)
(vla-regen doc acActiveViewport)
(vla-setvariable doc "LAYLOCKFADECTL" fadeSet)
(princ)
)
Oh, wait.....are you talking about this?:
it's good... but very heavy...
If so, then yes, it's "heavy". Either posted method requires the use of regen, but short of Autodesk supplying a fix to the API I don't see a better way.