View Full Version : 2018 Configure to release file handles for open drawings?
whackoprogrammer760234
2018-01-03, 03:33 PM
Hey all,
We use several CAD applications at once, alongside AutoCAD. We have a recurring nuisance where we export a DXF to our robot control CAD, and it fails to load the DXF because AutoCAD keeps the file handle open while the drawing is open. We need AutoCAD to not keep file handles open and instead open the file for reading when loading, and once loaded close the file handle while working in memory, likewise for saving open the file handle for writing, and then close it when done. The robot control CAD does not keep file handles open, it just loads the DXF into memory and closes the file handle right after. Basically the file stays "busy" while the drawing is open in AutoCAD, but it really doesn't need to be, other CAD programs don't do that.
Is there a setting in AutoCAD for configuring file handle behavior?
Insight is appreciated. Thanks!
rkmcswain
2018-01-03, 03:55 PM
AutoCAD does not do anything with file locking. True, it does keep the file locked when open, but the O/S is handing the file locks.
There is no setting to tell AutoCAD to not tell the O/S to lock the file. What other CAD programs do not lock the file? I don't see how this would work, because then two people could open the same file and overwrite each others changes.
One thought: I'm not sure of your exact command process when you say you "export a DXF", but if you were to use the SAVE command (not QSAVE, not SAVEAS) - this will write the file to a new file, but leave the CAD application in the previous file.
For example, if you open "a.dwg" and then run the SAVE command and give it the name "b.dwg", then "b.dwg" is created, but AutoCAD keeps "a.dwg" open and locked. The same should apply regardless of the file type.
whackoprogrammer760234
2018-01-15, 04:40 PM
AutoCAD does not do anything with file locking. True, it does keep the file locked when open, but the O/S is handing the file locks.
There is no setting to tell AutoCAD to not tell the O/S to lock the file.
Well of course. AutoCAD makes the system calls to open the file, but doesn't close the handle until the document is closed. I wanted it to close the handle as soon as it's done loading (or saving if writing).
What other CAD programs do not lock the file?
A proprietary CAD program from our production robot's manufacturer. It releases the file handle as soon as it's finished loading the document.
I don't see how this would work, because then two people could open the same file and overwrite each others changes.
Indeed that would be possible under that scenario. Each scenario has an upside and a downside. Hence why I asked if there is a setting that controls this behavior.
One thought: I'm not sure of your exact command process when you say you "export a DXF", but if you were to use the SAVE command (not QSAVE, not SAVEAS) - this will write the file to a new file, but leave the CAD application in the previous file.
For example, if you open "a.dwg" and then run the SAVE command and give it the name "b.dwg", then "b.dwg" is created, but AutoCAD keeps "a.dwg" open and locked. The same should apply regardless of the file type.
I use the "Save As" from the GUI, which is _SAVEAS command. This switches AutoCAD to the new saved file as the open document.
I will have to try the other commands to see if they behave differently.
rkmcswain
2018-01-15, 04:54 PM
I use the "Save As" from the GUI, which is _SAVEAS command. This switches AutoCAD to the new saved file as the open document.
Yeah, that is why I specifically said to not use SAVEAS. You're right, it switches to the new document.
Use SAVE to write a new document but not open it.
Powered by vBulletin® Version 4.2.5 Copyright © 2025 vBulletin Solutions Inc. All rights reserved.