Free AutoCAD Tutorials - AutoCAD Blog

How to Save AutoCAD Drawing as Read Only

Post image for How to Save AutoCAD Drawing as Read Only

by sunithbabu on July 26, 2013

How to Save AutoCAD Drawing as Read Only – is quite a difficult way to answer. The only way to answer this question is by giving different options for the user to Save AutoCAD Drawing as Read Only. Let’s see some of them below

Save AutoCAD Drawing as Read Only

Some of the different methods are listed below please choose which is appropriate in your case.

Method 1 РUse Save As AutoCAD Drawing Files as DXF, by this method you actually prevent the user to make any changes to your drawing files. Making the Drawing as Read-Only Files

save autocad drawing as read only
Method 2 – Ideally you could right click on the drawing file icon (once saved), go to properties and tick read only. Ahh, well that doesn’t “lock” the drawing or anything. they can still edit it, do a Save As, or simply uncheck the Read Only option for the file once they have it.

Method 3 – In case you are on a Network, you can request your Network Administrator to make a READ only Folder and put all the files into it – Eg., READ capabilities but not WRITE capabilities. that way it’ll never be altered, and the file can still be used for Inserting blocks. However, here if you use the explode blocks this will come back into action.

Method 4 РAlthough there are different ways to do a Read Only format, one simple method is to have your AutoCAD Drawing converted into a Pdf file, there by making all your AutoCAD Drawings Read-Only Mode as you cannot edit the Pdf files and can open in a standard acrobat reader.

Interested in Learning New AutoCAD Tips Daily – Download AutoCAD Tips App from Google Play Store (Free)

Related Posts Plugin for WordPress, Blogger...Number of Views :14581

{ 2 comments… read them below or add one }

John Bisschop July 27, 2013 at 9:15 pm

Method 1 doesn’t actually make a drawing read-only. When saving as a DXF file, the drawing is saved in an ASCII format that any text editor like Notepad can change. Of course, you need to be careful doing this because you can corrupt the drawing. When I have had problems with certain drawings, I have saved them to DXF to allow me to clean them up. I edit the file very carefully with Notepad, load the DXF file back into AutoCAD and save it as a DWG. In any case, you can load a DXF, edit it in AutoCAD and save it as a DXF or DWG. It is NOT read-only!

Reply

Sunith Babu L July 28, 2013 at 5:26 am

The following example is a simple Visual Basic 6 program that reads a DXF file and extracts specific codes and values from a given object in a given section.

‘ ReadDXF extracts specified code/value pairs from a DXF file.
‘ This function requires four string parameters, a valid DXF
‘ file name, a DXF section name, the name of an object in that
‘ section, and a comma delimited list of codes.

Function ReadDXF( _
ByVal dxfFile As String, ByVal strSection As String, _
ByVal strObject As String, ByVal strCodeList As String)
Dim tmpCode, lastObj As String
Open dxfFile For Input As #1
‘ Get the first code/value pair
codes = ReadCodes
‘ Loop through the whole file until the “EOF” line
While codes(1) “EOF”
‘ If the group code is ’0′ and the value is ‘SECTION’ ..
If codes(0) = “0″ And codes(1) = “SECTION” Then
‘ This must be a new section, so get the next
‘ code/value pair.
codes = ReadCodes()
‘ If this section is the right one ..
If codes(1) = strSection Then
‘ Get the next code/value pair and ..
codes = ReadCodes
‘ Loop through this section until the ‘ENDSEC’
While codes(1) “ENDSEC”
‘ While in a section, all ’0′ codes indicate
‘ an object. If you find a ’0′ store the
‘ object name for future use.
If codes(0) = “0″ Then lastObj = codes(1)
‘ If this object is one you’re interested in
If lastObj = strObject Then
‘ Surround the code with commas
tmpCode = “,” & codes(0) & “,”
‘ If this code is in the list of codes ..
If InStr(strCodeList, tmpCode) Then
‘ Append the return value.
ReadDXF = ReadDXF & _
codes(0) & “=” & codes(1) & vbCrLf
End If
End If
‘ Read another code/value pair
codes = ReadCodes
Wend
End If
Else
codes = ReadCodes
End If
Wend
Close #1
End Function
‘ ReadCodes reads two lines from an open file and returns a two item
‘ array, a group code and its value. As long as a DXF file is read
‘ two lines at a time, all should be fine. However, to make your
‘ code more reliable, you should add some additional error and
‘ other checking.

Function ReadCodes() As Variant
Dim codeStr, valStr As String
Line Input #1, codeStr
Line Input #1, valStr
‘ Trim the leading and trailing space from the code
ReadCodes = Array(Trim(codeStr), valStr)
End Function

Reply

Leave a Comment



Previous post:

Next post: