0 Members and 1 Guest are viewing this topic.
(setq date (rtos (getvar 'cdate) 2 4)) (setq note (getstring T "\nEnter note: ")) (setq anXrec (entmakex '((0 . "XRECORD") (100 . "AcDbXrecord") (cons 300 date) (cons 301 note) ) ) )
1–369 (except 5 and 105) These values can be used by an application in any way
(setq anXrec (entmakex ((0 . "XRECORD") (100 . "AcDbXrecord") (cons 300 date) (cons 301 note) ) ) )
(setq date (rtos (getvar 'cdate) 2 4)) (setq note (getstring T "\nEnter note: ")) (setq lst (list '(0 . "XRECORD") '(100 . "AcDbXrecord") (cons 300 date) (cons 301 note) ) ) (setq anXrec (entmakex lst))
(defun get-or-create-Dict (/ adict) (if (not (setq adict (dictsearch (namedobjdict) "NOTES_DICT"))) (progn (setq adict (entmakex '((0 . "DICTIONARY")(100 . "AcDbDictionary")))) (if adict (setq adict (dictadd (namedobjdict) "NOTES_DICT" adict))) ) (setq adict (cdr (assoc -1 adict))) ) )(defun get-next-record (/ adict rec cntr) (setq adict (get-or-create-Dict) cntr "1" ) (if (dictsearch adict cntr) (while (setq rec (dictsearch adict cntr)) (setq cntr (itoa (1+ (atoi cntr)))) ) ) cntr )(defun get-or-make-Xrecord (date note cnt / adict date note anXrec) (cond ((setq adict (get-or-create-Dict)) (cond ((not (setq anXrec (dictsearch adict cnt))) (setq anXrec (entmakex (list '(0 . "XRECORD") '(100 . "AcDbXrecord") (cons 300 date) (cons 301 note) ) ) ) (if anXrec (setq anXrec (dictadd adict cnt anXrec))) ) (setq anXrec (cdr (assoc -1 (dictsearch adict cnt)))) ) ) ) )(defun add-rec (/ date note recnum) (setq date (rtos (getvar 'cdate) 2 4)) (if (setq note (getstring T "\nEnter note: ")) (if (setq recnum (get-next-record)) (get-or-make-Xrecord date note recnum) ) ) )
(defun get-or-create-Dict (name / myDict dict) (setq myDict (dictsearch (namedobjdict) name)) (or (setq myDict (cdr (assoc -1 myDict))) (and (setq dict '((0 . "DICTIONARY") (100 . "AcDbDictionary"))) (setq myDict (entmakex dict)) (setq myDict (dictadd (namedobjdict) name myDict)) ) ) myDict)(defun create-xNote (date txt xname / myDict xdat xrec) (and (setq myDict (get-or-create-Dict "MARK_NOTES")) (not (dictsearch myDict xname)) (setq xdat (list '(0 . "XRECORD") '(100 . "AcDbXrecord") (cons 300 date) (cons 301 txt) ) ) (setq xrec (dictadd myDict xname (entmakex xdat))) ) xrec)(defun get-all-xNotes (/ xnote myDict xnotes) (and (setq myDict (get-or-create-Dict "MARK_NOTES")) (while (setq xnote (dictnext myDict (not xnote))) (setq xnotes (cons xnote xnotes)) ) ) xnotes)(defun get-all-xNames (/ myDict dict xnames) (and (setq myDict (get-or-create-Dict "MARK_NOTES")) (setq dict (entget myDict)) (while (setq dict (member (assoc 3 dict) dict)) (setq xnames (cons (cons (cdar dict) (cdadr dict)) xnames) dict (cdr dict) ) ) ) xnames)(defun parse-all-xNotes (/ xnotes xrec) (foreach n (get-all-xNames) (setq xrec (entget (cdr n))) (setq xnotes (cons (list (cons 2 (car n)) (assoc 300 xrec) (assoc 301 xrec)) xnotes ) ) ))
(cons (cons (cdar dict) (cdadr dict))
Wanna "encrypt" it? I've got that string->binary representation progy. (It converts bothways.)