Hi
I use a dll assembly that provides a new Lisp function comparable to this one (http://"http://forums.autodesk.com/t5/Visual-LISP-AutoLISP-and-General/How-to-set-layer-properties-per-viewport-solution/td-p/2077834") (it allows to write layers overrides)
The problem is that the dll retrieves a "eLockViolation" error if it's triggered by a odcl control, and only in this case.
The error occurence is not systematic, and it seems to depend on the previous user interraction with ACad interface.
For example it doesn't occurs :
- if I place (entsel) just before the function call and if I select an object (my problem is that I don't want to ..)
- if I place (vla-regen doc acActiveViewport) before (same)
(dcl_SetCmdBarFocus) doesn't prevent this error
Any idea ?
Should that be:
http://forums.autodesk.com/t5/Visual-LISP-AutoLISP-and-General/How-to-set-layer-properties-per-viewport-solution/td-p/2077834 (http://forums.autodesk.com/t5/Visual-LISP-AutoLISP-and-General/How-to-set-layer-properties-per-viewport-solution/td-p/2077834)
Without seeing your code, I'd guess ;
Your .NET code needs a Documentlock statement
something like
using (DocumentLock m_doclock= Application.DocumentManager.MdiActiveDocument.LockDocument())
{
// Do your mojo here to modify drawing
}
I'm imagining that the code is being executed in the application context (which requires document locking) from the control, while it runs in a document context from the commandline.
It may be worth a try anyway.
Regards, Kerry
Hi
You're right twice :
-that was the page that I meant ..
-the dll has been updated with your tip, there's no more error
Dll has been made by (gile) on cadxp : http://cadxp.com/index.php?/topic/34232-proprietes-de-remplacement-des-calques/ (http://cadxp.com/index.php?/topic/34232-proprietes-de-remplacement-des-calques/) (POST#3 - in french)
Thanks a lot