Tips & Tools Weekly (Vol. 12, No. 35)

1 Oct, 2007

This Week's Software Tips

Relative Pathing
Reader Genaro Enierga offers this tip for those CAD users who use relative pathing for attaching xrefs. He explains, "In the _Xattach command, when attaching xrefs using relative paths, sometimes the command gives a message to save the drawing first before you can choose relative path. This is annoying, but using this simple macro solves the problem.

(defun c:xa()
(command "qsave") a
(command "xattach")

"Do an Appload and modify the PGP file -- I used XA as my command. Each time I type in XA, instead of XR, I don't have to save before using relative pathing."

NOTES FROM CADALYST TIP PATROL: This is a good example of using single-line LISP to stop those annoying quirks in AutoCAD. Another option is to use AutoLoad instead of Appload so that it loads on demand. Add this line in the ACAD.LSP or ACADDOC.LSP file:

autoload "XA" '("xa"))

Nested Fields
Leon Brumin
reminds users that fields can be nested: "When inserting fields into text or tables, there are field names, such as Formula, under the Objects Field category. Right-click in the formula Edit box and you can insert another field, which can be Objects Area or Diesel expression. Even better, you can right-click and insert a field again, such as

Obj_1.Area + Obj_2.Area * Obj_3.Length.

Also, you can enter one or more of the standard formulas. Here's a full list of other functions taken from Land Desktop's 3D Help that also work for plain AutoCAD."

+                  addition
-                   subtraction
*                   multiplication
/                    division
^                   exponent
(                    open parenthesis
)                    closed parenthesis
ABS             absolute value of a number
ACOS          arccosine of a number
ASIN            arcsine of a number
ATAN           arctangent of a number
COS            cosine of a number
COSH          hyperbolic cosine of a number
EXP             e raised to the power of a number
LOG             logarithm of a number to a specified base
LOG10        base-10 logarithm of a number
POW10       number raised to a power of 10
ROUND      rounds to the closest integer
SIN               sine of a number
SINH            hyperbolic sine of a number
SQRT           square root of a number
SQR             square of a number
TAN              tangent of a number
TANH           hyperbolic tangent of a number
TRUNC        number truncated to an integer

"Note that parentheses ( ) should be used with formulas as required by standard mathematical notation. Now your formulas can look like this: cos(sin(Obj.Angle)+atan(PI))."

NOTES FROM CADALYST TIP PATROL: Fields can be a very powerful function, indeed. We hope this tip gets people interested enough in fields to look more closely at how to implement them into their work practices.

UCS Coordinates: The Real World
Frequent tipster Leonid Nemirovsky (visit his AutoLISP Web site) sends this tip: "The coordinate system in a custom UCS is different from the coordinate system in real-world UCS. While in custom UCS, this small routine gives you real-world coordinates of a selected point:"

(defun c:trucs ()
(setq pt (getpoint"\nPick a point to translate from users UCS to World
UCS: "))
(if (= pt nil)(exit))
(setq pt1 (trans pt 1 0))
(alert (strcat “Selected point at WCS = “ (rtos (car pt1) 2) " " (rtos (cadr pt1) 2)))

NOTES FROM CADALYST TIP PATROL: This is a slick little routine. We updated the alert prompt to be a bit more user friendly. Another suggestion is that this point could be assigned to a variable that could then be processed by another routine to do something that you required the WCS point for in the first place, such as input text showing the coordinate of that point or similar.

Mtext Default
Also from Len comes this tip: "The Mtext default settings for line spacing is Atleast -- in other words AutoCAD will respace mtext slightly in case when you include "( )" or " ".

"To prevent this, set the TSPACETYPE variable to 2. This sets spacing to Exact globally (all new text is set to exact). To change one piece of Mtext, use the Change Property box. It's also possible to change spacing of MText globally by setting the TSPACEFAC variable to a different than default settings, such as increasing the size from 1.0 to 1.2. (all new text is set to new spacing)."

NOTES FROM CADALYST TIP PATROL: Mtext is a good tip and beats exploded mtext. Nothing looks worse than mtext with irregularly spaced lines. I have a line in my ACADDOC.LSP that sets TSPACETYPE to 2 whenever opening a drawing. Also, remember the TSPACEFAC system variable is a factor of the text height and not drawing units. It's not saved anywhere, so if you need to use any setting other than 1, you must also set this either in your ACADDOC.LSP or in a menu macro. Note that the ACADDOC is loaded on opening every drawing, while ACAD.LSP can be loaded when starting AutoCAD or on opening every drawing by setting the ACADLSPASDOC system variable.

Note to readers: Follow-up tips have not been tested by the Cadalyst Tip Patrol.

Follow-Up: Purge Stubborn Layers
Reader Tommy Holder wrote to recommend that users "turn on, thaw, and unlock all layers so you do not delete them!" before using the purge tip in the September 24 edition.

Follow-Up: Keep Files Clean
After reading the follow-up tip on how to keep your files clean in the September 24 edition, Sean Thompson thought he'd share the procedure his company uses. "One of my drafters brought this tip to my attention, which I believe he found on AUGI's forum, although I don't know who originally created it. I've modified it only slightly from its original state. This is an easy button for cleaning excess junk from a drawing."

To begin, open the CUI and create a new command in the Command list, such as Clean Drawing. In the macro line, place this text string:


Select an image so that you have an icon, and you're all set. You can now use this button in anything that you can edit. Put it in menus, toolbars, or even the Dashboard if you use AutoCAD 2008. Note that Overkill only works if you have Express Tools installed.  If you don't have Express Tools, you can leave the macro as is, but the Command line will tell you that Overkill is an unknown command. You can also just leave off this part:


Follow-Up: Backup Plan
After reading the September 24 edition, Lloyd Beachy offers this additional suggestion for backing up files: "USB flash drives are great tools for backing up your custom support files.  Rather than using Windows Explorer, you can perform this task with a custom BAT file (text file with a .BAT extension). With a BAT file, you can back up specific files or entire folders -- regardless of their original locations.  It also provides documentation showing where the files were located in case you ever have to restore them.  Once the BAT files are created, all you need to do is plug in the USB drive and double-click the BAT file.  The rest is automatic.

"Below is the sample code for the BAT file.  It deletes the old backup folder before the new one is created.  This example uses E:\ for the USB drive."

Del "E:\CAD\Backup\" /q
mkdir "E:\CAD\Backup\"
Copy "C:\My Custom Files\" "E:\CAD\Backup\"
mkdir "E:\CAD\Backup\Support\"
Copy "C:\My Support Folder\acad.pgp" "E:\CAD\Backup\Support\"
Copy "C:\My Support Folder\acad.lin" "E:\CAD\Backup\Support\"

Follow-Up: Mtext Combo
Reader Merv Ruge responded to the Tip Patrol's comments in the September 10 edition. The Patrol noted that the Mtext routine "would even be better if you could combine an unlimited number of mtext entities."

Merv remembered that, back in November 1998, Cadalyst published Dtext to Mtext (DTOM.LSP) by David Adie that combines an unlimited number of text entities. Just select them in the order you wish them to be strung together. Thanks for the great recall, Merv!

STAAD.Pro Tip: Reverse a Group of Members
For users of Bentley's STAAD.Pro structural analysis and design software, Vaidas Guogis uploaded a useful tip onto his Web site: How to Change a Member's Direction. He sometimes finds it useful to change direction for a group of members in a STAAD. Pro model before adding releases or offsets. Although this option is not built into the software it is possible to perform this action manually.

Submit Your tip, code, or shortcut for your favorite CAD software. If we publish your tip, we'll send you a Cadalyst T-shirt, and each month Cadalyst editors will randomly select one published tip and send a $100 gift card to its author. Please submit only code and other tips that are your original work (or provide the original source so we can include proper credit) and tell us which software version you use. By submitting code, you grant Cadalyst the right to print and distribute your code in print, digitally and by other means. Cadalyst and individual authors retain all rights to the code; published code is not to be used for commercial purposes.

Tips & Tools Weekly software tips for AutoCAD are reviewed by Cadalyst staff and the Tip Patrol before publication. Use all tips at your own discretion, please, and watch later editions of this newsletter for updates and corrections. We're sorry, but editors and Tip Patrol members cannot provide assistance with technical problems; please refer to Cadalyst'sHot Tip Harry-Help discussion forum.

Sincere thanks to our volunteer Tip Patrol members: Brian Benton, Don Boyer,
Mitchell Hirschklau, R.K. McSwain, Kevin Sawyer, Ivanhoe Tejeda, and Billy Wooten.

Back to Top

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .


Web-Based Community Portal for Autodesk Users
Autodesk's Media & Entertainment 3D community portal, known as AREA, is designed for artists using Autodesk 3ds Max, Autodesk Maya, Autodesk MotionBuilder, Autodesk VIZ, and the Autodesk FBX universal 3D asset-exchange file format. The site provides access to tips, tutorials, discussion forums, blogs, downloads, galleries, member portfolios, and feature stories. Read more

Back to Top

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Deals & Freebies

Adobe Offering Free Footage with Purchase
Adobe is offering 15 royalty-free stock footage clips to customers who purchase a full retail or upgrade version of Adobe Creative Suite 3 Production Premium or Adobe Creative Suite 3 Master Collection from the Adobe Store or a participating reseller before November 30, 2007. The clips (a value of $2,985), available in NTSC and PAL, were chosen specifically from Artbeats' award-winning library. Click here to learn more.

Back to Top

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Opportunities & Honors

CAD Enhancement Recognized as Certified Jammer
CAD Enhancement (CEI), a Minnesota-based CAD consulting firm, received the designation of "Certified Jammer" from the online CAD community The designation reportedly was awarded based on CEI's demonstration of expertise in multiple CAD platforms and commitment to community involvement. Read more Receives Award from Web Marketing Association
Web site was recognized for the second consecutive year as a leading resource for industrial buyers and sellers among B2B and directories/search engines. Read more

Back to Top

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

The Week's New CAD and Related Products

Hardware: Multisensor Measurement System
Brown & Sharpe Optiv measurement systems feature optical, camera, laser, and tactile probing options in various configurations. Read more

Hardware: INFINITE 5012 Measuring Arm
ROMER product includes WiFi connectivity, onboard battery power, and an integrated tungsten counterweight that reportedly delivers light-touch ergonomics and fluid motion. Read more

Hardware: Quantum FaroArm
FARO eight-foot dimensional measurement arm reportedly measures to within the width of a human hair. Read more

General Software: PDMWorks Enterprise 2008
Product data management solution from SolidWorks features new capabilities for managing and routing bills of materials and replicating data across sites. Read more

General Software: Rhino Plugin for Complex Surface Modeling
T-Splines tool generates organic models for architecture, animation, industrial design, marine, automotive, aerospace, and consumer product applications. Read more

General Software: PerformancePoint Server 2007
Microsoft application is designed to enable companies to drive performance through monitoring, analyzing, and planning business using one integrated solution. Read more

General Software: progeCAD 2008 Professional
Updated IntelliCAD-based software from progeSOFT can read, edit, and write all versions of AutoCAD drawing files. Read more

General Software: SmartDraw 2008
Business-presentation software automates the task of creating flowcharts, organizational charts, mind maps, project charts, bar charts, and other graphics. Read more

General Software: AcceliCAD 2008 v2
Release from Autodsys features full compatibility with AutoCAD 2008 DWG files and enhanced functionality for attribute editing and block creation. Read more

AEC: ISS Foresight v6.5
ISS 3D CAD program allows for rapid prototyping of several variables from a single project and includes a database of 3D elements and forestry ecosystems. Read more

MCAD: Plugins for Reverse Engineering
SYCODE AutoCAD and Rhino tools allow users to reconstruct the geometry of objects from point clouds. Read more

PLM: ENOVIA MatrixOne PLM FastTrack
Dassault launches PLM Solution for midmarket apparel. Read more

PLM: SpaceClaim PLM Integration Module
J2xPLM platform provides direct access to leading PLM systems from within SpaceClaim Professional 2007. Read more

PLM: v5.18 of PLM Portfolio
Latest release features Dassault's v5 SOA openness and delivers enhanced intellectual property (IP) protection and collaboration between users and engineers. Read more

Training: i-Train Video Series
Cadsoft training videos now include support for Cadsoft's Envisioneer v4 building information modeling software. Read more

Back to Top

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Mark Your Calendar

An Evening with Autodesk Industry Specialist Kim Renshaw
October 12, 2007
Philadelphia, Pennsylvania
Synergis is offering the Sustainable Design Lecture Series to support the Sustainable Design movement. Attendees will learn the current challenges facing businesses, discern some of the perceived barriers to becoming more sustainable, and get an early look at the potential impact to the AEC business process and the subsequent changes just on the horizon. Read more

Using GreenBuilding Studio for WholeBuilding Energy Analysis
November 9, 2007
Philadelphia, Pennsylvania
At this Sustainable Design Lecture Series event, Peter Gehring, director of building solutions at Synergis, will discuss how attendees can use a Web-based energy engineering analysis solution that integrates with today’s 3D-CAD/BIM applications. The conversation will focus on a building information model from Revit Architecture.
Read more

Building Performance Analysis Using Revit MEP
December 7, 2007
Philadelphia, Pennsylvania
This Sustainable Design Lecture Series event sponsored by Synergis will focus on using the integrated IES Virtual Environment (VE) analysis platform within Revit MEP to conduct preliminary building performance analysis. Peter Gehring will lead the discussion and will also cover preparing the Revit building information model for export to the IES VE software application for more robust building performance analysis. Read more

For a complete list of CAD meetings, conferences, training sessions, and more, check out our calendar of events on

Back to Top

AutoCAD Tips!

Lynn Allen

In her easy-to-follow, friendly style, long-time Cadalyst contributing editor and Autodesk Technical Evangelist Lynn Allen guides you through a new feature or time-saving trick in every episode of her popular AutoCAD video tips. Subscribe to the free Cadalyst Video Picks newsletter and we'll notify you every time a new video tip is published. All exclusively from Cadalyst!

Follow Lynn on TwitterFollow Lynn on Twitter

Download Cadalyst Magazine Special Edition