Here is the LISP:
(defun c:DES_PtExpWithdragLoc ( / )
(vl-load-com)
(getdoc)
(vl-cmdf "netload" "C:\\Data\\_Autodesk Custom\\C3DLispTools.dll");load the dll that Jeff Mishler wrote. Thanks, Jeff!
(setq fl (open (strcat (filenamegetter) "_withDragStateLocation.txt") "w"))
(write-line "PtNumber, Easting, Northing, Elevation, Raw Description, IsDragged, Dragx, Draxy, Dragz" fl)
(setq pts (vlax-get c3ddoc 'Points)
cnt (vlax-get pts 'Count)
ctr 0)
(while (< ctr cnt)
(setq pt (vlax-invoke pts 'Item ctr)
pte (vlax-vla-object->ename pt)
East (vlax-get pt 'Easting)
North (vlax-get pt 'Northing)
Elev (vlax-get pt 'Elevation)
RawDs (vlax-get pt 'RawDescription)
Num (vlax-get pt 'Number)
)
(if (islabeldragged pte)
(progn
(setq LblLoc (pointlabellocation pte)
lblX (car lblloc)
lblY (cadr lblloc)
lblZ (caddr lblloc)
)
(setq Dragged 1)
)
(setq Dragged 0)
)
(if (= dragged 1)
(write-line (strcat (rtos num 2 0) "," (rtos east 2 4) "," (rtos north 2 4) "," (rtos Elev 2 3) "," RawDs "," (itoa dragged) "," (rtos lblx 2 4) ","
(rtos lbly 2 4) "," (rtos lblz 2 4))
fl)
(write-line (strcat (rtos num 2 0) "," (rtos east 2 4) "," (rtos north 2 4) ","
(rtos Elev 2 3) "," RawDs "," (itoa dragged))
fl)
)
(setq ctr (1+ ctr))
)
(close fl)
(princ)
)
(defun filenamegetter ( / pref)
(setq pref (getvar "DWGPREFIX")
dwgnm (substr (getvar "dwgname") 1 (- (strlen (getvar "dwgname")) 4))
)
(setq dwgnm (strcat pref dwgnm))
)
;thanks to Jeff Mishler for the following code.
(defun getAecAppNumber (/ );c3dnumber c3dproduct c3drelease)
(setq C3Dproduct (strcat "HKEY_LOCAL_MACHINE\\"
(if vlax-user-product-key
(vlax-user-product-key)
(vlax-product-key)
)
)
C3Drelease (vl-registry-read C3Dproduct "Release")
C3Dnumber (substr
C3Drelease
1
(vl-string-search
"."
C3Drelease
(+ (vl-string-search "." C3Drelease) 1)
)
)
)
)
(defun getdoc ( / )
(setq appno (getaecappnumber))
(setq acadapp (vlax-get-acad-object)
c3dapp (vla-getinterfaceobject acadapp (strcat "AeccXUiLand.AeccApplication." appno))
C3Ddoc (vla-get-activedocument C3Dapp)
)
) ;end function
Tim Corey
MicroCAD Training and Consulting, Inc.
Redding, CA
Autodesk Gold Reseller
New knowledge is the most valuable commodity on earth. -- Kurt Vonnegut