Hi,
I'm creating a palette with a usercontrol in it. The usercontrol contains a button for starting a Userform.
When I start the userform from the commandline its works.
When I start the userform with the usercontrol-button in the palette i always get an eLockViolation error.
I think the document must be locked and I can't understand why. What must I do to unlock the document.
Many thanks for your help
Jürgen
Solved! Go to Solution.
Solved by AlexanderRivilis. Go to Solution.
The Short of it is that AutoCad locks the document before executing you code from the command. If you execute the command from a userform, you are responsible for locking the document.
What I do is create a command line version of the command first, and then use SendStringToExecute to execute the command. This solves a ton of potential problems like context switch to another document during the executing of your command, and mimics AutoCad functionality.
Bottom line, study up on Application Context and Document context. AutoCad helps manages context switches for you when you execute in the document context, but you are responsible for managing that if you execute in the application context, which can be a major challenge.
HomeBoy Out
Hi,
I'm sure that AutoCAD locks the drawing, when we make start an command which is written in .Net wthin a specific drawing.
When we are using palettes AutoCAD doesn't know which drawing is meant, so we must lock it.
Regards Juergen