Here is a simple example of how to read a TXT file into lisp and then do something with the contents. In this example, the TXT file contains coordinates, and the code will draw either points or lines.
One thing to keep in mind. Most times when you open a file for read or write, you should open the file, perform the entire operation, then close the file. Keep the code to a minimum while the file is open. This way if you run into an unhandled error, the file isn't stuck open, and in the case of shared files, you are not locking the file for an extended amount if time.
Here is a sample of the TXT file we are reading with the code. It contains X and Y values, separated by commas.
3121284.38296466,882181.92380207
3121277.99413417,882267.69275572
3121275.35443066,882375.23306138
3121272.51513517,882482.87407333
3121262.35874024,882580.84966059
3121233.10972356,883133.60346681
3121224.47339393,883240.46739907
Here is the code. Keep in mind that this code was left in a simple form to help show the steps involved. It is not optimized and there is no error checking and/or restoring of changed sysvars. These are topics for a different tutorial.
(defun c:foo ( / fn fp lst l)
;; Prompt the user to select a .TXT file.
(setq fn (getfiled "Select ASCII file" "" "txt" 4))
;; Prompt the user for what type of entity to draw
(initget "L P")
(setq e (getkword "\nWhat type of entity [Line/] "))
;; Open the file and create an empty list
(setq fp (open fn "r") lst '())
;; Iterate the file, writing each line to
;; the list
(while (setq l (read-line fp))
(setq lst (cons l lst))
)
;; Close the file.
(close fp)
;; Reverse the list
(setq lst (reverse lst))
;; At this point, the data is stored in
;; a variable and the file is closed.
;; Turn off OSMODE
(setvar "osmode" 0)
;; Draw the requested entity type
(cond ((eq e "L")
;; iterate the list and create lines
(command "._line")
(foreach item lst
(command item)
)
(command "")
)
;; --or--
(t
;; Set a couple of variables
(setvar "pdmode" 34)
(setvar "pdsize" -1.0)
;; Iterate the list and draw a point
;; entity at each coordinate
(foreach item lst
(command "._point" item)
)
)
)
;; Close quietly
(princ)
)
PermaLink Posted 7/13/2008 07:24:00 PM Comments (0)
Autodesk and Bentley announced they will be exchanging software libraries to help expand the interoperability between each others drawing format. More details in the link below.
PermaLink Posted 7/09/2008 07:19:00 AM Comments (0)
Starting with AutoCAD 2008, you now have direct access to the Layer States Manager, without opening the LAYER dialog first.
In AutoCAD 2008, click the button on the far right of the LAYERS toolbar.
In AutoCAD 2009, click the button shown below:
Once you get the Layer States Manager dialog open, don't forget to click the
button to expand the dialog and reveal more options.
Labels: AutoCAD, AutoCAD 2008, AutoCAD 2009, Tips
PermaLink Posted 7/03/2008 06:05:00 AM Comments (0)
In certain situations, you can install SP2 for Land Desktop 2008, and the program will report that SP2 is installed, but in fact it is not really installed. I have confirmed this with Autodesk support. However, the exact circumstances regarding how this occurred has not been determined.
So how can you check to see if SP2 has really been applied? According to Autodesk support, you can test for SP2 by looking at the version of this file:
C:\Program Files\AutoCAD Civil 3D Land Desktop Companion
2008\AeccAlnSvrLoader.dll. (Your path may vary)
If you have SP2, this file version will be 17.1.396.0
This is for Land Desktop Companion 2008. I do not know if the same rules apply for plain Land Desktop, but I suspect it would be the same.
PermaLink Posted 6/06/2008 12:38:00 PM Comments (0)
Release Notes
Labels: Free, Other software
PermaLink Posted 5/20/2008 05:39:00 PM Comments (1)
If you try to open a dialog in AutoCAD but nothing happens, there is a chance that the dialog is open, but it's just "off your screen". You can use a windows trick to move it back.
When the dialog is supposed to be visible, but you can't see it, press ALT+Space, then "M", then use the arrow keys to move the dialog.
Click on image below to see full size.

Labels: Tips
PermaLink Posted 5/20/2008 06:30:00 AM Comments (2)
I frequently see the question "What is the difference between AutoCAD and AutoCAD LT?" Autodesk provides a comparison matrix that highlights some of the differences. (That particular document compares the 2008 versions).
But there really doesn't seem to be a comprehensive comparison of what the actual differences are. I imagine many new LT users figure out a command is missing when they go to use a familiar command and it tells them...
Command: XCLIP
Unknown Command "XCLIP". Press F1 for HELP.
Below I have listed a quick summary of major differences, a quick summary of the new features in LT, and then a list of 323 commands and 175 system variables that are available in AutoCAD, but not available in AutoCAD LT 2009.
General list of what is missing in LT...
Here is a summary of the major features that are not included in LT 2009.
- Sheet Set Manager
- Network licensing
- CAD standards management
- Most 3D tools and commands
- Express tools
- Action recorder
- Support for Autolisp, VBA, .NET and other programming languages.
New for LT 2009...
Besides the normal UI upgrade to match AutoCAD, the following previously unavailable features have been added to LT 2009.
- Image referencing
- Non-rectangular viewports
- Truecolor
- Fields
- 64-bit support
List of unavailable commands in LT 2009
Below is a list of 323 commands that are available in AutoCAD 2009, but not available in AutoCAD LT 2009.
*SCROLL
-3DCONFIG
-ACTSTOP
-ACTUSERMESSAGE
-ARCHIVE
-DWFADJUST
-EATTEXT
-INTERFERE
-MLEDIT
-OPENSHEETSET
-PARTIALLOAD
-PARTIALOPEN
-PUBLISH
-REFEDIT
-SHADEMODE
-VBALOAD
-VBARUN
-VISUALSTYLES
..ACADSTATUS
3D
3DALIGN
3DARRAY
3DCLIP
3DCONFIG
3DCORBIT
3DDISTANCE
3DDWF
3DDWFPUBLISH
3DFACE
3DFLY
3DFORBIT
3DMESH
3DORBIT
3DORBITCTR
3DRENDER
3DROTATE
3DSIN
3DSOUT
3DSWIVEL
3DWALK
ACISIN
ADCCUSTOMNAVIGATE
ACTRECORD
ACTSTOP
ACTUSERINPUT
ACTUSERMESSAGE
AI_BOX
AI_CIRCTAN
AI_CONE
AI_CUSTOM_SAFE
AI_DIM_TEXTABOVE
AI_DIM_TEXTCENTER
AI_DIM_TEXTHOME
AI_DISH
AI_DOME
AI_FMS
AI_INVOKENFW
AI_MOLC
AI_PRODUCT_SUPPORT
AI_PRODUCT_SUPPORT_SAFE
AI_PSPACE
AI_PYRAMID
AI_SELALL
AI_SPHERE
AI_TORUS
AI_TRAINING_SAFE
AI_WEDGE
ALIASEDIT
ALIGN
ALIGNSPACE
ALLPLAY
AMECONVERT
ANIPATH
APPLOAD
ARCHIVE
ARCTEXT
ARX
ASSIST
ASSISTCLOSE
ATTIN
ATTOUT
ATTREDEF
ATTSYNC
BACKGROUND
BATTMAN
BCOUNT
BEXTEND
BLOCK?
BLOCKREPLACE
BLOCKTOXREF
BORROWLICENSE
BOX
BREAKLINE
BREP
BROWSER2
BSCALE
BTRIM
BURST
CAMERA
CDORDER
CHECKSTANDARDS
CHURLS
CLIPIT
COMPILE
CONE
CONVERTOLDLIGHTS
CONVERTOLDMATERIALS
CONVTOSOLID
CONVTOSURFACE
COPYM
CYLINDER
DATAEXTRACTION
'DBCCLOSE
'DBCONNECT
DBLIST
'DDGRIPS
'DDSELECT
DIMEX
DIMIM
DIMREASSOC
DISTANTLIGHT
DVIEW
DXBIN
EATTEDIT
EATTEXT
EATTEXTEDIT
EATTEXTUPDATE
EDGE
EDGESURF
EDITTIME
EDITSHOT
EXOFFSET
EXPLAN
EXPRESSMENU
EXPRESSTOOLS
EXTRIM
EXTRUDE
FILTERS
FINISH
FLATSHOT
FLATTEN
FOG
FREESPOT
FREEWEB
FS
FSMODE
GATTE
GETSEL
GIFIN
GRADIENT
HELIX
HYPERLINKOPEN
IMAGEAPP
IMAGEEDIT
IMPRESSION
IMPRINT
INTERFERE
JOGSECTION
LAYERP
LAYERPMODE
LAYOUTMERGE
LAYTRANS
LAYVPMODE
LIGHT
LIGHTLIST
LIGHTLISTCLOSE
LIVESECTION
LOAD
LOFT
LSP
LSPSURF
MATERIALASSIGN
MATERIALATTACH
MATERIALMAP
MATERIALS
MATERIALSCLOSE
MENU
MINSERT
MIRROR3D
MKLTYPE
MKSHAPE
MLEDIT
MLINE
MLSTYLE
MOCORO
MOVEBAK
MPEDIT
MSTRETCH
MVSETUP
NAVSMOTION
NAVSMOTIONCLOSE
NAVVCUBE
NCOPY
NETLOAD
NEWSHEETSET
NEWSHOT
NEWVIEW
OLDMTPROP
OLELINKS
OPENSHEETSET
OVERKILL
PAINTPROP
PARTIALOAD
PARTIALOPEN
PFACE
PLANESURF
PLJOIN
PLT2DWG
POINTLIGHT
POLYSOLID
PRESSPULL
PROPULATE
PSBSCALE
PSELECT
PSFILL
PSTSCALE
PYRAMID
QDIM
QLATTACH
QLATTACHSET
QLDETACHSET
QQUIT
REDEFINE
REDIR
REFCLOSE
REFEDIT
REFSET
RENDER
RENDERCROP
RENDERENVIRONMENT
RENDEREXPOSURE
RENDERUNLOAD
RENDERUPDATE
RENDERWIN
RENDSCR
REPLAY
REPURLS
RETURNLICENSE
REVERT
REVOLVE
REVSURF
ROTATE3D
RPREF
RPREFCLOSE
RTEDIT
RTEXT
RTUCS
RULESURF
SAVEALL
SAVEIMG
SECTION
SECTIONPLANE
SEQUENCEPLAY
SETIDROPHANDLER
SHAPE
SHEETSET
SHEETSETHIDE
SHELL
SHOWURLS
SHP2BLK
SKETCH
SLICE
SOLDRAW
SOLIDEDIT
SOLPROF
SOLVIEW
SPHERE
SPOTLIGHT
SSX
STANDARDS
STATS
'STATUS
STLOUT
SUNPROPERTIES
SUNPROPERTIESCLOSE
SUPERHATCH
SWEEP
SYSVDLG
TABSURF
TARGETPOINT
TBCONFIG
TCASE
TCIRCLE
TCOUNT
TEXTFIT
TEXTMASK
TEXTUNMASK
TFRAMES
THICKEN
TJUST
TORIENT
TORUS
TRACE
'TREESTAT
TSCALE
TUTCLEAR
TUTDEMO
TXT2MTXT
UNDEFINE
VBAIDE
VBALOAD
VBAMAN
VBARUN
VBASTMT
VIEWPLAY
VISUALSTYLES
VISUALSTYLESCLOSE
VLIDE
VLISP
VPSCALE
VPSYNC
VSCURRENT
VSSAVE
WALKFLYSETTINGS
WEBLIGHT
WEDGE
XCLIP
XDATA
XDLIST
XEDGES
XLIST
XOPEN
XREFCLIP
List of unavailable system variables in AutoCAD LT 2009
Below is a list of 175 system variables that are available in AutoCAD 2009, but not available in AutoCAD LT 2009.
*_TOOLPALETTEPATH
_LINFO
_SERVER
3DCONVERSIONMODE
3DDWFPREC
ACADPREFIX
ACADVER
ACIS15
ACISOUTVER
APSTATE
ASSISTSTATE
AXISMODE
AXISUNIT
BINDTYPE
CAMERADISPLAY
CAMERAHEIGHT
CMATERIAL
CMLJUST
CMLSCALE
CMLSTYLE
COMPASS
CPROFILE
CPUTICKS
CSHADOW
CURRENTPROFILE
DBCSTATE
DBGLISTALL
DEFAULTLIGHTING
DEFAULTLIGHTINGTYPE
DEMANDLOAD
DRAGVS
DWGWRITE
DXEVAL
ENTERPRISEMENU
FACETRATIO
FFLIMIT
FLATLAND
FULLOPEN
GFANG
GFCLR1
GFCLR2
GFCLRLUM
GFCLRSTATE
GFNAME
GFSHIFT
GTAUTO
GTDEFAULT
GTLOCATION
HPASSOC
IMPLIEDFACE
INTERFERECOLOR
INTERFEREOBJVS
INTERFEREVPVS
LASTPROMPT
LAYOUTREGENCTL
LAZYLOAD
LEGACYCTRLPICK
LIGHTGLYPHDISPLAY
LIGHTINGUNITS
LIGHTLISTSTATE
LIGHTSINBLOCKS
LINEARBRIGHTNESS
LINEARCONTRAST
LISPINIT
LOFTANG1
LOFTANG2
LOFTMAG1
LOFTMAG2
LOFTNORMALS
LOFTPARAM
LOGEXPBRIGHTNESS
LOGEXPCONTRAST
LOGEXPDAYLIGHT
LOGEXPMIDTONES
LOGEXPPHYSICALSCALE
LOGINNAME
LONGFNAME
MATSTATE
MENUCTL
MENUNAME
NOMUTT
OFFSETGAPTYPE
OSNAPZ
PFACEVMAX
PLOTID
PLOTTER
PLQUIET
POPUPS
PROJECTNAME
PSOLHEIGHT
PSOLWIDTH
PSQUALITY
PSVPSCALE
PUBLISHCOLLATE
QAUCSLOCK
QUEUEDREGENMAX
RE-INIT
REFEDITNAME
RENDERPREFSSTATE
RENDERUSERLIGHTS
RIASPECT
RIBACKG
RIEDGE
RIGAMUT
RIGREY
RITHRESH
SAVEIMAGES
SCREENBOXES
SCREENMODE
SHADOWPLANELOCATION
SHOWHIST
SHPNAME
SKETCHINC
SKPOLY
SOLIDCHECK
SOLIDHIST
SPACESWITCH
SSFOUND
SSLOCATE
SSMAUTOOPEN
SSMPOLLTIME
SSMSHEETSTATUS
SSMSTATE
STANDARDSVIOLATION
STARTUPTODAY
STEPSIZE
STEPSPERSEC
SUNPROPERTIESSTATE
SUNSTATUS
SURFTAB1
SURFTAB2
SURFTYPE
SURFU
SURFV
TBCUSTOMIZE
TEMPPREFIX
TEXTOUTPUTFILEFORMAT
UCSDETECT
UCSVP
UNDOONDISK
USERS1
USERS2
USERS3
USERS4
USERS5
VSBACKGROUNDS
VSEDGECOLOR
VSEDGEJITTER
VSEDGEOVERHANG
VSEDGES
VSEDGESMOOTH
VSFACECOLORMODE
VSFACEHIGHLIGHT
VSFACEOPACITY
VSFACESTYLE
VSHALOGAP
VSHIDEPRECISION
VSINTERSECTIONCOLOR
VSINTERSECTIONEDGES
VSINTERSECTIONLTYPE
VSISOONTOP
VSLIGHTINGQUALITY
VSMATERIALMODE
VSMONOCOLOR
VSOBSCUREDCOLOR
VSOBSCUREDEDGES
VSOBSCUREDLTYPE
VSSHADOWS
VSSILHEDGES
VSSILHWIDTH
VSSTATE
WHIPTHREAD
WRITESTAT
XFADECTL
XREFNOTIFY
If you spot a mistake or would like to add something, leave a comment please. Thanks.
Labels: AutoCAD, AutoCAD 2009, AutoCAD LT, Tips
PermaLink Posted 5/07/2008 11:57:00 AM Comments (8)
On this day, May 5 in 1961, Alan Shepard became the first American in space while aboard the Freedom 7 spacecraft.
The launch was at 9:34AM and the entire flight was over in 15 and a half minutes. A maximum altitude of about 115 miles was reached at the 5 minute mark. Shepard experienced over 11.5 g's during reentry.
...and so began the space race....
PermaLink Posted 5/05/2008 01:09:00 AM Comments (0)
So you have installed SP1 and you know how to fix drawings with a bloated scale list. But what if you have dozens or hundreds or thousands of "infected" drawings each containing hundreds of scale list entries?
Autodesk has released a tool to fix these bloated drawings. You can select any number of drawings and batch process them.
You have heard about this tool, haven't you? If not, that means you are not reading Shaan Hurley's Between the Lines blog. Here is the link to the Scale List Cleanup Utility. While you are there, I suggest subscribing to this blog to keep up to date with the latest happenings at Autodesk.
Labels: AutoCAD, AutoCAD 2008, Free, News, Notices, Tips, Utilities
PermaLink Posted 4/29/2008 06:58:00 AM Comments (1)
More details can be found on the Through the Interface blog.
Labels: API, AutoCAD, News, Notices, Programming, Wishlist
PermaLink Posted 4/22/2008 06:55:00 AM Comments (0)
- Carlson Survey 2009 with IntelliCAD (includes IntelliCAD engine) - $1500
- Carlson Survey 2009 for AutoCAD (you supply or purchase your own AutoCAD) - $1500
- Carlson Survey 2009 with AutoCAD OEM (includes AutoCAD OEM engine) - $3750
More details
Labels: Carlson Software 2009, IntelliCAD, News, Notices
PermaLink Posted 4/15/2008 04:37:00 PM Comments (0)
I'm at the convention center in downtown Lexington, KY for the Carlson Silver Anniversary User Conference. So far it's been somewhere between Autodesk University and an AUGI CAD Camp. This is a 2-day conference with nine sessions offered.
In the opening keynote address, Bruce Carlson, president of Carlson Software talked about the addition of IntelliCAD to the platform choice for Carlson Software. This comes on the heels of the announcement this past January that Carlson could no longer sell Autodesk products. Bruce also emphasized how Carlson is a nimble company that can and has always responded quickly to customer input.
Dave Carlson, executive vice-president of development, gave a brief overview of Carlson 2009. The IntelliCAD engine is now built in. This means that when you install Carlson, you do not need AutoCAD, although it will still run on AutoCAD if you desire. Support for AutoCAD includes versions 2000 through 2009, and you can install unlimited platform versions of Carlson per single license, on the same machine.
A few more highlights that were mentioned:
- Carlson is a member of the ODA
- Carlson is now using a common code base for both the AutoCAD and IntelliCAD engines.
- Some AutoCAD features are not present in the IntelliCAD version of Carlson, including Sheet Set Manager and Tool Palettes
- Some routines run much slower in the IntelliCAD version but that this issue should be resolved in the upcoming release of IntelliCAD 7.
- Simplicity Systems, acquired by Carlson in 2002, will be releasing a Microstation compatible survey module on April 21.
- With regard to their mining products, the concept of 4D design is being promoted. 4D being the traditional 3D, plus timing.
- A 5D concept was also mentioned, this being 4D plus costing.
- Carlson is working closely with Bentley and ESRI for more integration.
- Carlson has a short term goal of being able to write to ESRI Geodatabases from all field and office products.
- Carlson still loves AutoCAD and AutoCAD Map and they are still an active ADN member. They have no plans to drop these platforms from their product development.
This evening we were treated to an excellent dinner. Maureen Slocum, Vice President, Group Publisher spoke about about a new marketing partnership between Carlson and CENews to premier in the next month or so. David Lorenzo, Development Director, IntelliCAD Technology Consortium also spoke about the relationship of the ODA and the IntelliCAD Technology Consortium, and how Carlson fits into the mix.
PermaLink Posted 4/14/2008 08:00:00 PM Comments (0)
New to 2009 is the default icon mode for the drawing tool buttons. You know what these are, the SNAP GRID ORTHO POLAR OSNAP, etc. buttons down in the status bar. They take up less room as icons, but you will need to figure out what each one does.
Out of the box, they look like this:
If you right click on any button, you will get this menu:
Uncheck the Use Icons item to restore the previous TEXT buttons, like this:
Polar Tracking, Object Snap, and Object Tracking include a context menu to quickly change settings without having to open a dialog.
New to this bunch of tools is the QP, or Quick Properties button. Heidi Hewett has put together a nice article on Quick Properties.
Labels: AutoCAD, AutoCAD 2009, New Features, Tips
PermaLink Posted 4/01/2008 05:30:00 PM Comments (2)
The capabilities of DWG TrueConvert were added to DWG TrueView starting with DTV2008. However, I have seen a few people still wanting to download the the old standalone DWG TrueConvert 2007. Well, until they pull the plug on this download, you can get it here.
http://download.autodesk.com/global/DWGTrueConvert/DWGTrueConvert.exe
Labels: Add-on utilities, Free, News, Notices, Tips, Viewers
PermaLink Posted 4/01/2008 12:25:00 PM Comments (0)
DWG TrueView 2009 is now available!
The big news is that measuring commands are now available. The DIST and AREA commands are at your fingertips... Some of the other new AutoCAD 2009 features are in there also, such as the ViewCube and SteeringWheel and of course the new UI.
Autodesk DWG TrueView Home Page
Compare to other Autodesk Viewers
PermaLink Posted 3/26/2008 12:42:00 PM Comments (2)
AutoCAD 2009 is now out. If you are interested in the Autodesk version of the new features, look below. If you are on an older release and only considering making the move to AutoCAD 2007 or 2008 and you want a summary of the changes, take a look at the NFW for these releases.
- New Features Workshop - AutoCAD 2007
- New Features Workshop - AutoCAD 2008
- New Features Workshop - AutoCAD 2009
Labels: Free, New Features, Notices, Tips
PermaLink Posted 3/25/2008 12:16:00 PM Comments (0)
See the animation below.

This tool is visible by default no matter what workspace is current, unlike the Workspaces toolbar in earlier versions.
Labels: AutoCAD 2009, CUI, New Features
PermaLink Posted 3/04/2008 06:06:00 AM Comments (0)
Autodesk AutoCAD is still among the most pirated software applications according to the Software Industry Association. How many of these unregistered applications do you see on machines of co-workers, relatives, or even your own machine?
There is also a related article in the February edition of Cadalyst magazine.
PermaLink Posted 2/27/2008 06:30:00 AM Comments (0)