There is an undocumented feature (to my knowledge) that allows lisp programmers to attach ldata to a non-graphical object.
Layer "0" object in the layers collection has the unusual ability to store ldata.
So if you want to store values in a drawing and retrieve them when you come back...
Merry Christmas
P=
Code:
;__________________________________________________________________________________________________________
;
; This Function stores variable values (strings, integers, reals, lists... not vla-objects or entitynames)
; Written By Peter Jamtgaard copyright 2014 all rights reserved
;_________________________________________________________________________________________________________
;
; Syntax: (VariableStore (list 'A 'B 'C)); Where A, B and C are variables you wish to store for example
;_________________________________________________________________________________________________________
(defun VariableStore (lstOfSymbols / lstOfSublists)
(and
lstOfSymbols
(setq lstOfSublists (mapcar '(lambda (X)(list X (eval (eval X)))) lstOfSymbols))
(vlax-ldata-put (vla-item (vla-get-layers
(vla-get-activedocument
(vlax-get-acad-object))) "0")
"Variables"
lstOfSublists
)
)
)
;_________________________________________________________________________________________________________
;
; Syntax (VariableReStore)
;_________________________________________________________________________________________________________
(defun VariableReStore (/ lstOfSublists objLayerZero)
(and
(setq objLayerZero (vla-item
(vla-get-layers
(vla-get-activedocument
(vlax-get-acad-object))) "0")
)
(setq lstOfSublists (vlax-ldata-get objLayerZero "Variables" ))
(mapcar '(lambda (X)(set (car X) (cadr X))) lstOfSublists)
; (vlax-ldata-put objLayerZero "Variables" nil); <- Can delete ldata using this command if desired.
)
)
(vl-load-com)