Friday, October 29, 2010

AreaText.lsp updated for 64-bit AutoCAD

The freeware AutoLISP AreaText.lsp has been updated to run on 64-bit AutoCAD as well.

On the x64 platform, creating a Field expression from lisp (or VB) requires that you use the 64-bit ObjectID as a string so the source code had to be updated accordingly using this function I got from ADN:

(defun Get-ObjectIDx64 (obj / util) (setq util (vla-get-Utility (vla-get-activedocument (vlax-get-acad-object)))) (if (= (type obj) 'ENAME)(setq obj (vlax-ename->vla-object obj))) (if (= (type obj) 'VLA-OBJECT) (if (> (vl-string-search "x64" (getvar "platform")) 0) (vlax-invoke-method util "GetObjectIdString" obj :vlax-False) (rtos (vla-get-objectid obj) 2 0) ) ) )
Now just load AreaText.lsp using APPLOAD and run the command AT, select a polyline and specify where you want the text and you can get a result like this:

If you want other units or formats or scaling of the text see the post Customize AreaText.LSP for AutoCAD.


Some of the latest blog posts

Subscribe to RSS headline updates from:
Powered by FeedBurner