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)
)

Important notice to installing CAD (and not only CAD) applications.

Many OS add-ons and also the automatic updates of the Windows operating system (Windows Update, Microsoft Update service) require to perform a restart of the system after the installation (update) is finished. In this way, the changed files (mostly DLL libraries) can be loaded and integrated into the running system.

This necessary restart can be postponed and it usually occurs naturally with the everyday power-off and power-on cycle of your computer. But many users do not switch off their computers at all - they just put them into sleep mode (hibernate). And so the postponed restart can be delayed even by several days.

There are some risks hidden in this routine - you'll postpone possibly urgent security fixes for your OS and there is one more problem. If you install other applications on such "not yet updated" system - e.g. CAD software - the next restart may render non-consistent versions of system libraries and the application may behave in a non-standard way.

Therefore always make sure that your system is not in the postponed-reset mode before you install a new software. When you are prompted to restart, do so and perform the restart as soon as possible. Do not hide the restart reminder dialog, do not stop the update service.

AutoPDF - Automatic publishing of PDF file on every save of the DWG drawing

The Xanadu AutoPDF application can automatically update (save/publish) a file in the PDF publishing format with every save of the DWG drawing. You can set the target folder for published DWFs and optionally also upload them automatically to a FTP or iProject server.

AutoPDF can help in company document management - makes your design data available both for the members of your design team and non-CAD users.

The AutoPDF utility (reactor) can be downloaded from www.xanadu.cz/download, see description in the accompanying documentation and the AutoPDF command.


From the AutoPDF.txt:

On every SAVE/QSAVE/END of your DWG drawing AutoPDF saves/publishes a copy of your drawing to a PDF file. Old version of the PDF file is rewritten with the updated copy. You can setup the target folder for your PDF file and optionally upload it to a FTP or iPROJECT server.
The AutoPDF command can be used to disable/re-enable the auto-publishing functionality (ON/OFF options).
The 'noQS' toggle sets whether the _QSAVE (Ctrl+S) command also publishes PDF or not.
The 'Folder' option sets the target folder/subfolder name.
The 'FolderType' suboption specifies how the 'Folder' name is used - the 'Absolute' setting just uses the 'Folder' name as the target, the default 'Drawing' option saves the PDF copy with the DWG file, 'Current' saves the DWF in the AutoCAD current (Start-In) folder.
The 'Layout' option specifies which layout is published. The default 'Current' means the current layout when the drawing was saved (= mostly Model), 'Model' means "always publish the Model tab".
The 'Upload' option lets you automatically upload the published PDF to a FTP server or your iPROJECT server.
The option 'Now' performs the PDF publishing on demand (not on save) - even when the reactor is switched Off. You can e.g. call "AutoPDF Now" in your menu macros for final plotting.
The 'Status' option lists current AutoPDF settings.

How to explode block attributes keeping their text?

If you explode (EXPLODE) a block with atttributes, the attribute values change back to their AttDef names (tags). Usually, you need to keep their original values - i.e. the filled-in text of the attribute.

In these cases you can use the BURST command from Express Tools. It explodes a block retaining the readable attribute values.

Saturday, June 6, 2009

AutoCAD with updates (Update/SP, Bonus Pack).

To identify AutoCADu 2009 with installed updates (Update 1 or 2, Service Pack) and extension packs like the "Subscription Bonus Packs" you can use the dialog "About AutoCAD".

Run the command ABOUT (Help > About AutoCAD), click the "Product information" button and in the field "Product update" (SP) you can see e.g.:
  • "AutoCAD 2009 - English" (the original version)
  • "AutoCAD 2009 - English Version 2" (Update 1 - SP1 applied)
  • "AutoCAD 2009 - English Version 2.1" (Update 1 applied, Bonus Pack 1 installed)
  • "AutoCAD 2009 - English Version 3" (Update 2 - SP2 applied)
  • "AutoCAD 2009 - English Version 3.1" (Update 2 applied, Bonus Pack 2 installed)
You can also use the _VERNUM system variable - the "Update 1" level will show "C.111.0", the "Update 1" plus Bonus Pack will return _VERNUM=C.112.0, the "Update 2" reports _VERNUM=C.608.0 and with the "Bonus Pack 2" then _VERNUM=C.662.0.

AutoCAD compatible with Windows Vista?

The following CAD applications are compatible with the operating system Microsoft Windows Vista: AutoCAD 2009 (Vista logo certified; and the 2009-family), AutoCAD 2008, AutoCAD LT 2008, AutoCAD Architecture 2008, AutoCAD Mechanical 2008, AutoCAD Civil 3D 2008, Revit 2008, Inventor 2008 SP1 and other Autodesk software from the 2008-family.

AutoCADu 2008 (and 2009) compatibility applies for both 32-bit and 64-bit versions of Windows Vista Home Basic, Home Premium, Ultimate, Business and Enterprise.
For AutoCAD 2007 and AutoCAD LT 2007 Autodesk has released Service Pack 2 which makes them compatible with the 32-bit version of Windows Vista.

How to uninstall a specific AutoCAD or Inventor Service Pack?

You can use the standard function "Programs and functions" (Add/Remove programs) in Windows Control panels to uninstall a specific Service Pack of an Autodesk CAD application.
Use the option "Show updates" and select the requested Service Pack to remove. Then click the Uninstall button or use the context menu.
In older Inventor versions you had to uninstall and reinstall the main CAD application.

Array along a path.

To create an array of elements/blocks along a given path (e.g. chairs around an oval table) you can use the standard commands DIVIDE / MEASURE with the options Block and Align. This way they work like the command ARRAY applied on a curve.

In some cases you will need to first create an auxiliar offset curve to the original linework with the OFFSET command.
In detail:
Use the "MEASURE" command if you need to array the blocks at a distance from one and other which you enter as part of the process. If you wanted to divide the path into a number of segments, and then array the blocks at the points at which the path divides, then use "DIVIDE". It works in the same way, only you choose the number of segments to split the path into as opposed to the length of each segment.
  1. Create the block, the thing you want to array (the BLOCK command)
  2. Draw the path, for example, an ellipse.
  3. Use the command: MEASURE
  4. Select the object which forms the path
  5. Type "b" (for block) enter
  6. Type the name of the block you want to array enter
  7. Type or leave "y" in to align the block against the object enter
  8. Type the desired length of segment enter
  9. Done.
(detail by "idiosyn85")

How to convert an AutoCAD DWG to CorelDRAW CDR file?

There is no reliable standalone converter but newer versions of CorelDRAW (10, 11, 12, X4) directly support import of DWG files (in older AutoCAD formats). Due to the complexity of the DWG format this import might be unreliable - so convert your drawing data rather via the exchange formats DXF, WMF, EPS, or PLT (HPGL). All these formats can be exported from AutoCAD and reliably imported into CorelDRAW.

Similarly for backward conversions of .CDR into .DWG files, do not use the DWG export offered in CorelDRAW. It does not create official DWG-format files and such "forged" drawing files may cause problems during further processing. Again, use rather the AutoCAD text format - DXF, or WMF.

Replacement for the applications MdiTab, DocBar, CxDocBar etc. in AutoCAD 2009.

Since AutoCAD version 2009 you can easily switch between windows of the opened DWG drawings with the internal visual tool "Quick View". See the book icon in AutoCAD status bar, or the command QVDRAWING.

You can pin-down the drawings thumbnails (see QVDRAWINGPIN) and size them with the Ctrl+mouse scroll combination.
Another option of switching between DWGs are the drawing thumbnails in the function "Opened drawings" under the "scarlet A" in the upper left corner of the AutoCAD window.
So there is virtually no need for "switching" ARX applications like MdiTab, DocBar, OverCAD Tabs, CxDocBar, Drawing Tabs or similar.

Work easier with AutoCAD groups.

AutoCAD LT - unlike the full AutoCAD with its GROUP command - contains simplified versions of commands for manipulating object groups - PKFSTGROUP and QKUNGROUP.
Many users are satisfied with these quick and simple versions of the group commands and the full dialog-based command GROUP slows them down. In addition, for ungrouping you have to specify the name of a group.

So we have prepared a free LISP utility GRP.vlx with the commands GRP and UNGRP. It can be used as a replacement of AutoCAD LT's group commands. You can use CUI to assign the GRP and UNGRP commands to keyboard shortcuts (recommended: Ctrl+Shift+G and Ctrl+Shift+U), or add them to your shortcut menu (context).
Both commands accept also pre-selected objects (grip-selection). They use unnamed groups.
Export/import of user settings in AutoCAD.

If you want to transfer (export and import) settings of the the current user profile in AutoCAD, you can use the functions Export and Import on the Profiles tab in the dialog of the OPTIONS command.

You can export the settings and then import them - e.g. on another computer or from a backup - to/from a file with the .ARG extension.
This file contains the AutoCAD settings hive from the Windows Registry.

Choosing between the new and old Layer Manager dialog.

AutoCAD 2009 introduced a new modeless (always active) dialog of the Layer Manager. If you want to use rather the old, classic modal version of the Layer dialog for the LAYER command, use the following methods.
  • To switch between the old/new layer dialog, use the LAYERDLGMODE variable (1=new)
  • To run the old dialog version (regardless of the variable setting), use the CLASSICLAYER command (you can even display both dialogs at the same time)
  • Tu run the new dialog version (even when the variable is off), use the command LAYERPALETTE

Select all specific texts in a drawing.

You can use severel methods to select all texts of a specific type (value) in a drawing. Let us have a drawing containing three separate text objects (Dtext/Mtext): Adam,Bravo,Charlie. Our goal is to select the text entities Adam and Bravo.

The simplest way is to use the FILTER command. In the filter type choose Text, value and in the X field enter [AB]* (see wildcard characters in Help). Click the "Add to list" button and use the filter.

Another option is to use a filter in the AutoLISP selection function - (ssget). For the requested type of selection, this function would read:

(ssget "_X" '((0 . "TEXT,MTEXT")(1 . "A*,B*")))

You can enter this LISP expression directly on the "Select objects" prompt.

How to model a 3D thread (screw) in AutoCAD?

Although 3D threads (nut/bold) are usually not modelled in detail and CAD applications like Inventor have internal functions for representing threads, sometimes you may need to really model a true 3D thread in AutoCAD.

The easiest way is to use a combination of the HELIX and SWEEP modelling commands.

First prepare a profile of a single thread (e.g. a filleted triangle), 3DROTATE it to be perpendicular to the sweep path, and then sweep this profile along a 3D spiral created by the Helix command.

In older versions of AutoCAD you can also use the 3DSPIRAL Lisp utility (see the Download section).

You can also use of the threaded blocks in our CAD blocks library.

How to convert 2D SOLID objects to 3D faces?

If you need to (e.g. for rendering) convert 2D objects of the type SOLID to 3D faces, use an intermediate conversion to REGION or a conversion to Surfaces.

The REGION command can convert Solids to Regions - then you can explode them or use them for modeling.

But you can also directly use the CONVTOSURFACE command and get the entity of the type Surface (PLANESURFACE). You can render it directly or use the THICKEN command to assign it a minimal thickness making it a 3D Solid body (3DSOLID).

To directly convert 2D Solids to 3D Faces or PFaces you can use the Xanadu Sol2Face utility - see www.xanadu.cz/download.

How to set transparent color for my own AutoCAD icons?

If you need to create a partially "transparent" toolbar icons, you cannot use standard ways of PNG format with alpha-channel or transparent GIF files - AutoCAD supports only icons in the BMP format which doesn't work with transparency.

But you can use a trick - the color with the hue of 192-192-192 (RGB) used in icons is interpreted by AutoCAD as "transparent".

Entering angles always in degrees.

If you combine work in different angle units (e.g. degrees and grades), you will probably need to setup your macros and LISP applications so that they use angles in a common, consistent format - in degrees, or alternatively in degrees, minutes and seconds.

By default, relative coordinates are entered as:

@length< angle

which counts with the angle value in the currently set angle units - if you switch to grades or radians, this format will no longer work.

Therefore use a special coordinate format:

@length<< angle

which always uses angles entered in degrees (even when you have e.g. grades as current angle units).

Another option - allowing to enter angles also in surveying minutes and seconds - is the format:

@length< angledminutes'seconds"

giving e.g.:

@500<45d15'25"
@500<45d

This format interprets the angles always in degrees. Similarly you can force entering grades (100g) or radians (1.5r) wherever AutoCAD prompts for angles.

Arithmetic expressions in AutoCAD dimensions.

If you need to use an arithmetic expression in the text (value) of a dimension (addition, subtraction, subtraction, multiplication, etc.) you can use fields and the process described in the video in the Tutorial section in the Czech version of this web site.

Text aligned along a line.

You have several options when you want to draw texts aligned (rotated) in a direction of existing lines (polylines, arcs, curves - e.g. utility lines, electric conductors, parcels, street network, etc.) in your AutoCAD drawings:
  1. Trivial - manually rotate (ROTATE) text by entering the rotation angle by picking two points on a line
  2. The same, only using the Perpendicular osnap - it allows to specify the direction of the baseline by picking a single point. An example of a menu macro for this function:
*^C^C_change;\;;;;;_per;\;_rotate;_p;;@;90d;
  1. Rotating your texts with a single command can by also accomplished with the Express Tool TORIENT
  2. The Align parameter in dynamic blocks also offers an automatic aligning along lines. Using this approach you can prepare a label block which automatically rotates itself when inserted on a line
  3. To label utility networks you can also use complex linetypes (linetypes with text)
  4. More advanced options for labelling lines (parcel segments, pipe networks, etc.) are available in AutoCAD Civil 3D (Label pipes, Line/Arc labels). You can define your own styles and predefined contents or generate labels automatically from the properties of the labelled line. The text reacts also to subsequent changes of the line.
  5. Using LISP applications you can automate the above mentioned methods to insert repeating texts or insert texts with a single click.

AutoCAD reports FATAL ERROR: Out of memory - shutting down

Make sure you have enough RAM, enough virtual memory (swap size) and plenty of free disk space on your swap disk.

When working with really large DWG drawings we would recommend using the 64-bit version of AutoCAD (on a 64-bit OS) and an adequate workstation.

But in many cases, the "/3GB" mode of the plain 32-Windows will help to increase the available memory (see the Tips).

My cursor crosshair displays rotated. Why?

Crosshair displayed under an angle in the current view may be caused by several settings and situations. Possible reasons for rotated CAD cursor:
  1. The SNAPANG variable settings (cursor angle), enter 0
  2. The SNAPSTYL variable settings (isometric settigns), choose 0
  3. Rotated user coordinate system (UCS), return to the world UCS using UCS Enter Enter
  4. 3D display - oblique 3D view, return to the plan view using the PLAN command

You may want to convert the solid to a Brep.

When attempting to perform a boolean operation on 3D solids (union, subtract...), AutoCAD displays the message "You may want to convert the solid to a Brep".

Switch off the history of edits on your 3D solid using the SOLIDHIST variable, with the BREP command, or with the "History" option in the Properties window (Ctrl+1).

Does my processor support SSE2 and EM64T, required by the 2010-family CAD application?

The CPU instruction set extension - SSE2 (Streaming SIMD Extensions 2) can accelerate some computations used in CAD software applications. This extension is supported in all current processor types (sice Pentium-4) by Intel and AMD. The SSE2 support is required for AutoCAD since version 2010, for Inventor 2009, Revit 2009 and 3ds Max since 2009.
  • Processors with SSE2 support:
Intel Pentium 4, Xeon, Celeron, Celeron D (NetBurst), Intel Pentium M and Celeron M, Intel Core CPU (Core Duo, Core Solo), Intel Core 2 CPU (Core 2 Duo, Core 2 Quad), Intel Core i7, Intel Atom, AMD Athlon 64, Sempron 64, Turion 64 (K8), AMD Phenom, AMD Opteron, Transmeta Efficeon, VIA C7, VIA Nano and newer.
  • Processors without SSE2:
AMD CPU with Socket-A (before Athlon 64), Intel Pentium-III, Pentium-II, their Celeron versions and other CPUs older than Pentium-4, Via C3, Transmeta Crusoe.

If you want to use the 64-bit version of the given CAD software, your processor must also support the EM64T technology (Extended Memory 64 Technology), labeled also as "Intel 64" or "AMD64". This technology is also standard in all modern microprocessors by Intel and AMD.
  • Examples of processors supporting the 64-bit technologies:
Intel Xeon, Intel Pentium 4, Intel Pentium D, Intel Pentium Extreme Edition, Intel Pentium Dual Core, Intel Celeron and Celeron D, Intel Core 2, Intel Atom 200 and 300, Intel Core i7, Athlon 64, AMD Opteron and newer.

How to detect all DWG files containing Xrefs?

If you want to know (without opening the individual files) which of your DWG drawings contain references to Xrefs, you can use the Xanadu DBXscanXref batch utility.

The free LISP utility DBXscanXref scans all DWG files in a given folder (and its subfolders) and generates a report with a list of all DWG files containing external references, the number of xrefs and optionally also their names (paths). The files are not opened individually.

Just appload these utilities and start the "DBXscanXref" command. Browse to the folder you want to process and click "Save".

You can download the application from www.xanadu.cz/download, see the accompanying TXT file.


Sample of a report:

Xanadu DBXscanXref report (verbose mode)
----------------------------------------
Timestamp: 20090325.1323

Start processing root folder C:\My Projects\

Start processing folder C:\My Projects\
-- C:\My Projects\BasinAreas.dwg
-- C:\My Projects\BIG_LOM.dwg
2 xref(s)
Legend1.dwg
Site Plan Xanadu.dwg
-- C:\My Projects\GPS Data.dwg

---- processing finished ----

How to get World coordinates from the ID command?

The ID command returns coordinates in the current UCS. If you want to get XYZ coordinates of the picked point always in the global, world UCS (WCS) - regardles of the active user coordinate system - you can use the following simple LISP macro.

Just save it to WID.LSP, load it with Appload and start the WID command (similar to ID):

;World ID
;3/2009 - www.xanadu.cz
(defun C:WID ( / pt)
(setq pt (getpoint "\nPick a point to ID in World UCS: "))
(if pt
(prompt (strcat "\nWorld X = " (rtos (car (trans pt 1 0)) 2)
" Y = " (rtos (cadr (trans pt 1 0)) 2)
" Z = " (rtos (caddr (trans pt 1 0)) 2)))
)
(princ)
)

How to copy views from another drawing?

If you need to import existing view definitions from an older DWG file to your current drawing, you can use the free utility Xanadu CopyViews.

Appload the CopyViews.vlx file, start the CopyViews command and specify the source drawing. All its named views are copied over to your current drawing.

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

AutoCAD reports PSELECT as an "Unknown command".

If PSELECT doesn't work in your AutoCAD, you have probably not opened the Properties window. This command is defined by default only for this window.

Open the Properties palette (Ctrl+1) at least once in your AutoCAD session and repeat the PSELECT command.

If you want to enable the PSELECT command automatically in every AutoCAD session, load the ARX extension acopm.arx - using the briefcase in Appload or with another ARX loading method.

How to make your AutoCAD slower?

Usually you want to do just the opposite. But there are situations where you need to pause and wait for something - to display a slide, to read a message or result, to debug your code.

If you want to pause the execution of your menu macros, scripts or LISP utilities, you can use the DELAY command. On its prompt enter the number of milliseconds to wait. Be carefull when entering large numbers - AutoCAD will really "hang" (freeze) for the specified time (may be good for office pranks :-).

DELAY 0 is also the best "NOP" (no operation) command - it doesn't do anything.

Where are the landscape objects for AutoCAD 3D render?

With the change of the rendering engine in AutoCAD 2007 (and higher) the special "landscape" objects (trees, shrubs, cars, people..) are no longer available (the former LSNEW, LSLIB commands).

There are some workarounds for adding entourage objects to your 3D scenes for rendering:
  • Use full 3D models of entourage objects
  • Add the entourage pictures only as 2D images to the rendered picture (postprocessing in Photoshop)
  • Use an alternative rendering tool - e.g. 3ds Max, Piranesi...
  • Use the simplified, render-ready RPC objects from ArchVision
  • Make simplified (planar, crossed) models with materials using texture maps and opacity maps (orient them to your camera) - see below
How to add opacity-based planar models to your scene for rendering:
  • Run the MATERIALS editor.
  • In the Materials tool palette, click "Create new material" and name it.
  • In the Template drop-down list, select Advanced.
  • Select the Diffuse Map check box.
  • Select Texture Map from the drop-down list.
  • Click the "Select Image" button and select the image you want to use for your entourage object (tree, people...).
  • In the "Material Scaling" section, set the "Scale units" to "Fit to Gizmo" and set U and V tile to 1.00 (in version 2007: Adjust Bitmap > Bitmap Scale > Fit to object).
  • In the Opacity section, click "Select Image", and then browse to a opacity image file (black will not show, white will show the diffuse map image).
  • In the "Material Scaling" section, set the "Scale units" to "Fit to Gizmo" and set U and V tile to 1.00 (in version 2007: Adjust Bitmap > Bitmap Scale > Fit to object).
  • And finally - create a 3D face in your DWG scene and apply the new material to it. Now you can render the drawing.

Cannot offset this object.

Creating offset (parallel curve) to a polyline may fail when the geometry of the polyline is wrong (self-crossing line, duplicate vertices, etc.). The offset may also fail only to a single side.

Try to simplify the polyline - delete excessive or duplicate vertices - and repeat the OFFSET command. The offset curve will be then created.

Displaying layout name in dynamic text fields.

If you want to copy a text or block into multiple layouts in your drawing, you may want to use an automatic text which will display the name of the respective layout (paperspace).

You can use the Field functionality for this - just insert a field and use the "Other" category, and the "System variable" CTAB value. Or just copy the following line (field code) as a DText:

%<\AcVar ctab>%

The same text will then read e.g. "Layout1" in the first (default named) layout, "Layout2" in the second, etc. This applies both for modelspace and paperspace text entities.

Break curve at all listed distances (stations).

You have a list of stations (distances from start) and you want to BREAK a selected curve multiple times at the listed points.

You can use the Xanadu BrkList utility. BrkList can be used as a generalized (non-linear) MEASURE command. The BrkList command prompts for a list of stations (distances measured from start) and then performs multiple BREAKs on a selected curve in the specified points (stations). It also places POINT entities at the break points. Optionally, placing points or breaking the line can be suppressed.

The list of stations can be entered either as a comma delimited sorted list - e.g.:

100,150.2,324.86,551

or read-in the list from a text file (each station on a single line) which can be exported e.g. as a CSV file from Excel (a result of a calculation).

Supported object types:
LINE ARC POLYLINE LWPOLYLINE 3DPOLYLINE SPLINE ELLIPSE HELIX

You can download the free LISP utility from www.xanadu.cz/download

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