Many that know me, know that I like to dabble from time to time with programming AutoCAD. Ok, maybe it is not just dabbling, but rather pushing things right to the edge. If you have an old program or have a need for file name structure of 8.3 then you might enjoy the routine below. It is an example of how AutoLISP or Visual LISP can use COM objects to extend the functionality of the language. The sample shows how to use the File System Object.
;; Begin Code
(defun GetShortName ( strFileName / wshFSO fileObj)
(vl-load-com)
(setq wshFSO (vlax-create-object "Scripting.FileSystemObject"))
(setq fileObj (vlax-invoke-method wshFSO 'GetFile strFileName))
(vlax-get-property fileObj 'ShortPath)
)
;; End Code
Happy coding...
Sincerely,
Lee
I would like to know how to write a line of Lisp code to "read" the xref attachements in a dwg and place the names in a titleblock. There are at times up to 9 different xrefs attached to a dwg. We have a place in our TB to name all the xrefs. Updating the names of these xrefs manually has become very tedious.
Please advise.
Thank You
Posted by: Kimberly Day | Friday, June 02, 2006 at 03:36 PM