Monday, June 8, 2009

Drawing file is write protected.

Error when saving your DWG file on a network - Drawing file is write protected.

AutoCAD uses a special file locking for its drawing files. So if you are using a non-standard file server (Novell, Linux...), or when there are timing problems on your LAN (overloaded network, overloaded server, HW error of your LAN card or a faulty active LAN element - hub, router), you may get false "write-protection" errors when working with drawing files stored on a network server.

Save your drawing locally (the SAVEAS command).

Of course you cannot save to a CD or to a write-protected folder.

How to display full path to a DWG drawing in AutoCAD window title?

You can enable showing the full path of your drawing file (disk, folder/directory, filename) in AutoCAD title bar by checking the "Display full path in title" box on the "Open and Save" tab of the OPTIONS dialog.

How to close the drawing without prompts to save?

If you issue the CLOSE, QUIT or END command and your drawing is changed (DBMOD > 0), AutoCAD will prompt you to save the current drawing. Sometimes you may need to just abandon the drawing, regardless whether it was changed or not. This is the case e.g. when performing a script or menu macro.

In these situations you can use the following Lisp/VBA command to close/quit the current drawing, without any asking and not saving any editing:

(command "_VBASTMT" "ThisDrawing.Close, false")

AutoCAD does not show hyperlinks of my drawing objects.

If AutoCAD does not display the link cursor (earth globe) and the tooltip with the link attached to an entity (with the HYPERLINK command), you have probably switched it off with the HYPERLINKOPTIONS command.

Convert entities or entity colors to separate layers.

For some external applications (e.g. rendering applications, CNC, calculation programs), it is neccessary to split the DWG drawing into individual layers grouping the same color (e.g. for subsequent assignment of a rendering material), or even to put each drawing entity into its separate layer.

The applications Xanadu Col2Lay and Xanadu Ent2Lay can help in these situations.

Col2Lay processes the selected drawing entities (objects) and moves (separates) all their individual colors (both individually assigned and "ByLayer") into individual layers. It automatically creates layers named by the ACI colors used - "XCL1" to "XCL255". The original (no more used) layers are purged. The drawing blocks are also converted (except the "ByBlock" color, which is not defined globally).

Ent2Lay has a simpler functionality - it moves the selected entities to new, individually defined layers. So each new layer contains a single entity of the original drawing. The layers are named by the type and handle of the original entity - e.g. "XENT_CIRCLE_1E3", "XENT_LINE_385".

Both free applications can be downloaed from www.xanadu.cz/download.

Two methods for creating Inventor 3D models from 2D views.

The CAD video section on this web site illustrates two methods for making a 3D model of a part from 2D views in a DWG drawing (front, side, top views). Videos use the Czech version of Inventor.

The first video describes the manual process of part modelling from sketches imported from a DWG drawing file.

The second video illustrates the usage of Inventor add-on tool - "2D to 3D Tool" (from Autodesk Labs). This tool simplifies modelling of a 3D part from individual views, which can be read from an existing DWG file made in AutoCAD or AutoCAD Mechanical.

How to isolate a xref layer?

The LAYISO command does not support selection of entities embedded in blocks or xrefs. So you cannot use it to isolate (hide other) layers which are part of an external reference drawing.

By principle, it is not possible to show a single layer from an xref and hide (switch off) all other drawing layers (including the layer where the xref is inserted). By switching off (freezing) the xref insertion layer, you'll switch off the whole xref, regardless of the visibility of its individual layers.

Nevertheless, as a limited solution for this functionality (assumes an xref inserted in the layer 0, not switched off), you can use the following LISP utility - the "LIX" command (save it to the file lix.lsp and load it with APPLOAD):

(defun C:LIX ( / entlay)
(setq entlay(cdr(assoc 8 (entget(car(nentsel "Select an Xref-object to isolate: "))))))
(if (vl-string-search "|" entlay)
(command "._-layer" "_s" "0" "_off" "*" "_n" "_on" entlay "")
(princ "\nThis is not an Xref!")
)
(prin1)
)