@Kent1Cooper wrote:
A prompt can certainly be added before the LIST command is called. Maybe this evening....
And also incorporating the QAFLAGS suggestion from @cadffm, try this:
(defun C:LGDO (/ source data txtline) ; = Log of Geometric Data Only
(if (findfile (getvar 'logfilename)); log file already exists
(progn ; then
(setq source (open (getvar 'logfilename) "w")); empty any current content
(close source)
); progn
); if
(prompt "\nTo Export their Properties,")
(if (setq ss (ssget '((0 . "*LINE,ARC,CIRCLE,ELLIPSE"))))
; [will provide its own "Select objects:" prompt]
; *LINE covers Line/Polyline/Spline
(progn ; then
(setvar 'qaflags 2)
(setvar 'logfilemode 1); turn on log file recording
(command "_.list" ss "")
(setvar 'logfilemode 0); turn off
(setvar 'qaflags 0)
); progn
); if
(setq
source (open (getvar 'logfilename) "r"); log file just created
data (open "X:/Your/File/Path/YourFilename.txt" "w"); reduced-content file <-- EDIT this
); setq
(while (setq txtline (read-line source)); step through lines in file
(if
(not
(wcmatch
(vl-string-left-trim " " txtline); remove leading spaces
"`[ A*,_.li*,Sel*,Spa*,Col*,Line*,Tra*,Thi*,Han*,Pre*,Ent*,Com*"
;; beginnings of unwanted-line content [could be more]
); wcmatch
); not
(write-line txtline data); then -- put line into geometric data file
); if
); while
(close source)
(close data)
(princ)
); defun
[Ideally, it ought to have an *error* handler added, to ensure that QAFLAGS gets reset if anything goes wrong, but the likelihood of that is small, since it's set up to change it only if there's a valid selection, and only for long enough to pull the information from the selection. But I can add it if you want, and don't know how to.]
Kent Cooper, AIA