I wasn't able to test your code.
Do you run it in VBA inside acad?
Maybe some SendKey and "Esc"?
Registered forum members do not see this ad.
Is there a way to Cancel the open command ?
What i have is this
Code:Private Sub ACADApp_BeginOpen(FileName As String) If FileName = something Then 'code for cancel open End If End Sub
I wasn't able to test your code.
Do you run it in VBA inside acad?
Maybe some SendKey and "Esc"?
Just curious, why?
Maybe redefining the Open command is another possibility?
sorry but i was out.
What i want is when someone tries to open a drawing at a specific path a message will ask the user if he wants the drawing to open in read-only or not state.
So i thought that i could do this with the "BeginOpen" event.
The code should do this.
1.Check the path of the drawing that is about to open
2.Ask if it should open read-only
3.Then open the drawing
About redefining the Open command i don't know how it can be done , maybe a little help.
Think about setting the property for theses files or folders to "Read only" in Windows Explorer. Isn't that easier?
If you use Lisp to define a command like this:
(defun c:OPEN()
...
)
Then you can use the command UNDEFINE to make AutoCAD forget about the normal OPEN command..
Use REDEFINE to get back the normal command.
After a long search i found that you can't stop the open command from the "beginopen" event.
The only thing you can do is redefine the open command.
Raggi_Thor thanks for your help.
What about setting some folders or files (drawings) to read only for certain users? Isn't that what you really want?
Yes but what i want is to protect drawings from those who will have full access. Very often someone opens a drawing for viewing or to plot something , make changes and when he closes the drawing instead of pressing "no" to the question about saving , he presses "yes" and the drawing get all mess up.
The only thing that i want now is to find a way to "browse" for a drawing through VBA. Can you help?
First I want to be sure you understand what I am saying about setting file properties in the Windows explorer.
If you right click on a file or a folder and select Properties and then you can check the Read Only attribute. This can be set for all files in a folder and sub folders if you like.
When you open a drawing that is read only, it behave exactly the way you want. The save command does not work as normally.
Registered forum members do not see this ad.
I understand. But making the files read-only for everyone means that if you want to make changes you would have to go to the files properties and uncheck the read-only option.
With network-users you can assign read-only privileges to certain users ,but what about others that have full access??? They can still modify a drawing by mistake. That is what i'm trying to prevent.
Bookmarks