Three times per session?
Three times per specific DWG file?
Three times total access to the routine?
Post is not clear on this.
Session:
Introduce a session gremlin. Format can be USER_[RoutineName]
and not declared as a local variable inside the defun section.
(defun c:AA bla bla bla
(or USER_AA (setq USER_AA 0))
(if (> (setq USER_AA (1+ USER_AA)) 3)
(progn (alert "Program usage has reached it's limit.")(exit)))
(defun *error* bla bla bla
bla bla bla...
Specific DWG:
Look into VLAX-LDATA-PUT and VLAX-LDATA-GET to access the file's dictionary.
Follow the format as shown in the Session section above (checking for file name
[or a portion of the name] should be included as part of the recorded information).
External file or registry methods for the last one - depending on user or group.
???
Scot-65
A gift of extraordinary Common Sense does not require an Acronym Suffix to be added to my given name.