Sunday, May 31, 2009

What for is the ^R code in menu macros?

The special character (control sequence) "^R" constrols the versioning of AutoCAD commands.

Menu macros (CUI) use by default the oldest versions of commands (to maintain compatibility). If you need to use the newest version of a particular command (its options and prompts), it is neccessary to use ^R before the command name - e.g.: ^C^C^R_FILLET;.

How to set background color in DWG TrueView?

Colors of the individual elements of the user interface in DWG viewer Autodesk DWG TrueView 2009 and 2010 can be set in the Options dialog.

Display any DWG drawing and right-click in the bottom command window. In the context menu choose "Options...". On the Display tab click on the button Colors. The background color for the modes "2D model space" or "3D parallel projection" can be set through the element "Uniform background"; the crosshairs color through the element "Crosshairs".

DGN import/export error - "You do not have permission to save to this location".

You do not have permission to save to this location. Contact your administrator to save to this location.

This error (during DGNIMPORT/DGNEXPORT) is caused by improper location of the DGN mapping and setup file DGNSETUPS.INI - Windows Vista (UAC) protects files in root disk folders and in the folders Program Files and Windows. Or you have the file in another read-only directory. Direct this file rather to a read-write folder with user files - see OPTIONS > Files, or the variable DGNMAPPINGPATH.

The default location is in the subfolder Support in the folder defined by the ROAMABLEROOTPREFIX variable.

I want to display my drawing the same way it is printed.

If you want to display your drawing layout exactly the same way it is finally plotted out on the paper (lineweights, color shades, monochrome plotting...), check the option for displaying plot styles. They will be applied on the screen as well.

You can find the checkbox "Display plot styles" in the top right corner of the "Page setup manager" dialog - see the command PAGESETUP.

How to delete an object only in a single viewport?

A viewport is only a view to a common (single) model. So you cannot delete an entity from a single viewport.

Of course you can also have objects individually inserted only in paperspace - such objects are not part of the model and can be deleted individually in layouts.

You can also suppress the object display (without deleting it) - since AutoCAD 2008, there are individual layer settings (off/on) per viewport.

Autonumbering of AutoCAD blocks (incremental counter)

sequential numbering

If you need to insert blocks with incrementing numbers in attributes, or automatically renumber existing blocks in your DWG drawing, you can use the free Xanadu InsertC utility. InsertC contains two commands - InsertC and BlockC.

The InsertC command is a "counting" version of the INSERT command. It inserts a specified block and automatically fills its first attribute with a increasing number in a series. You can either specify the block by picking an existing reference, or by entering its name.

The BlockC command takes the selection set of existing blocks and fills (renumbers) their first attributes with a series of incrementing numbers. You can sort the blocks (influence the numbering order) by their selection order, or by their X- or Y- coordinates.

Both autonumbering commands allow to specify the starting value of the counter, the prefix and the postfix for the generated number. You can also use the insertc:Inc LISP variable to set the increment (if other than +1).

The LISP utility InsertC is available for download on www.xanadu.cz/download.

Highlighting object extents by bounding-boxes.

The LISP application Xanadu BBox automatically draws either permanent or temporary bounding boxes (rectangles or circles) to selected objects in an AutoCAD drawing. BoundingBoxes can highlight the extent (boundary) of a given entity.

The BBox command creates bounding boxes as new entities in the current layer. You can choose between Rectangles and Circles.

The BBox1 command is an interactive version. It draws red bounding boxes for all objects which are hoovered-over by your mouse cursor. These temporary lines are not part of the drawing and they are erased on any screen redraw (F7/F7, Redraw).

The free application BBox can be downloaded from www.xanadu.cz/download.

Switching Display configurations from command line.

If you need to switch Display configurations in your AutoCADu Architecture session from a macro, script or directly from the command line, you can use the line command -AecDisplayConfigSetCurrent instead of the interactive select box.

You need to supply the name of an existing Display configuration in this command.

What is the maximum number of vertices in AutoCAD polylines?

The number of polyline vertices (in a Polyline, LWpolyline, 3Dpolyline, Spline) is not limited in AutoCAD, you can use any practical number of polyline nodes (vertex). So you can create and edit curves with more than 100.000 vertices.

With such extremely large polylines, you have to count with slower response in some operations (e.g. displaying grips on grip-editing).

You can try yourself the following AutoLISP code:

(setq x 0 y 0)
(setvar "CMDECHO" 0)
(command "_PLINE")
(repeat 100001
(command (list x y))
(setq x (+ x 1.0) y (+ y 1.0))
)
(command "")
(setvar "CMDECHO" 1)
(vl-load-com)
(vlr-beep-reaction)

For comparison: the maximal number of polyline vertices is limited to 101 in the DGN V7 format, and to 5.000 points in the DGN V8 format.

How to remove unwanted references to .DXE files?

Whenever you use the DATAEXTRACTION command, AutoCAD guides you to create and name a DXE definition file. These .DXE files are automatically added to the list of external references to the current DWG drawing.

As there is no direct method for removing these references, the list may grow in time and can cause problems when transferring the drawing.

In such cases you can use the free Xanadu DXEdel utility with the DXEdel command. This command removes (purges) DXE references from your drawing (save the drawing).

You can download DXEdel from www.xanadu.cz/download.

How to export AutoCAD tables to international CSV or TXT files?

By default, AutoCAD offers table export only to a comma-separated CSV file. The Xanadu TAB2XLS utility adds more commands with options for export of AutoCAD table objects (requires MS Excel).

The TAB2XLS command exports the selected table from your drawing directly to the Excel application, wher it creates a new sheet and saves it to the XLS format (single-click export).

The TAB2CSV command exports a drawing table to a text file in the CSV format (comma separated values) in the international format - depending on your Windows locale settings (in many European countries this means using semicolons as value separators and decimal commas instead of points). The CSV file is created in the drawing's folder.

The TAB2TXT command exports data of the selected table to a tab-delimited text file.

You can download the TAB2XLS utility from www.xanadu.cz/download.

Tips and Tricks Autocad