@abdul.raufJJ89F wrote:
.... can you also suggest me some way to filter out the properties which are not required? ....
I was unaware of the LOGFILENAME System Variable brought up by @dlanorh in Message 6 [I don't usually deal in these things], which very conveniently includes the whole file-path and everything, so it's easy to find that file. On the assumption that you do not want an ongoing log file for the current drawing [because this empties it out before it does its thing], this seems to work [minimally tested]:
(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
(setvar 'logfilemode 1); turn on log file recording
(command-s "_.list"); do command to end
(setvar 'logfilemode 0); turn off
(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
Make sure you have permissions for the folder location.
It depends on you to select only appropriate kinds of things for your purposes. It could also be made to skip certain objects, such as Text, for which geometric information is irrelevant.
I included some things to exclude in addition to the ones you listed [linetype scale, for example], but there may be some other properties things could have, reported in LIST but that you don't want. It's easy to add them to the exclusions string.
Kent Cooper, AIA