I'm having a difficulty understanding on how to convert strings to list.
The end product i would like a list like this
(("2019/06/18 08:07:33" "username" "Finished" "test1")
("2019/06/18 08:07:33" "username" "Finished" "test2")
("2019/06/18 08:07:33" "username" "Finished" "test3"))
Comments are stored dwgprops
2019/06/18 08:07:33 username Finished test1
2019/06/18 08:07:33 username Finished test2
2019/06/18 08:07:33 username Finished test3
I use a function retrieve the comments into a string.
Command: (getcomments)
"2019/06/18 08:07:33\tusername\tFinished\ttest1\r\n2019/06/18 08:07:33\tusername\tFinished\ttest2\r\n2019/06/18 08:07:33\tusername\tFinished\ttest3"
I'm confused on how to convert them into a list.
(defun getcomments( / acadObj acDocSumInfo )
(vl-load-com)
(setq acadObj (vlax-get-acad-object))
(setq acDoc (vlax-get-property acadObj 'ActiveDocument))
(setq acDocSumInfo (vlax-get-property acDoc 'SummaryInfo))
;(setq dwgpropcomments (vlax-get-property acDocSumInfo 'Comments))
(vlax-get-property acDocSumInfo 'Comments)
)
(defun foo( / pos )
(setq str (getcomments))
(while (vl-string-search "\r\n" str)
(if (vl-string-search "\r\n" str)
(setq pos (vl-string-search "\r\n" str))
);end if
(if (= nil (vl-string-search "\r\n" str))
(princ (strcat "\n"str))
(progn
(princ (strcat "\n"(substr str 1 pos)))
(setq str(substr str (+ pos 3) (strlen str)))
)
)
);end while
);end defun
(defun test(str / lst)
(while (vl-string-search "\t" str)
(if (vl-string-search "\t" str)
(progn
(setq pos (vl-string-search "\t" str))
(setq lst (append (list(substr str 1 pos)) lst))
(setq str (substr str (+ 2 pos) (strlen str)))
);end prog
);end if
);end while
(setq lst (list(append (list str) lst)))
(princ lst)
)