;;;===================================================================;
;;;===================================================================;
;;; Demmand loading of settings done from acad.lsp file for company ;
;;; standards. ;
;;;===================================================================;
;;;===================================================================;
(
;; first test run for a proced that will run a list of commands.
;; TODO: add error trapping on the hookanddo portion of this app.
push->lst
list-pop
plug-in
plug-in
pop-out
hook
popout-hook-and-do
fill-list-from-file
)
;; //-- Begin Support Procedures --//
(defun push
->lst
(sym lst
) ;; push-lst
;; put an item first into existing list.
;;
;; Ex: (push->lst 'one 'masterlist)
;; > (ONE)
;; > !masterlist
;; > (ONE)
;;
;; Notes: One benifit for using this method is that
;; the list is created for you. better then;
;; (setq masterlist (cons ... masterlist))
;; This results in less confusion in final code.
;;
;; By: John (Se7en) K
;; (inspired by Vladimir Nesterovsky)
(defun list
-pop
(lst
/ ~tval
) ;; list-pop
;; remove the first item from a list and redefne the var
;; containing that list For example:
;; Given a list called "masterlist" with the
;; value of: (TWO ONE)
;;
;; !masterlist
;; (TWO ONE)
;;
;; (list-pop 'masterlist)
;; TWO
;;
;; (list-pop 'masterlist)
;; ONE
;;
;; !masterlist
;; nil
;;
;; By: John (Se7en) K
;; (inspired by Vladimir Nesterovsky)
;; NOTE: Removed the next two procedures because first
;; testing phase is over and they are not needed.
;;
;; (defun plug-in ( proced )
;; ;; add an item to a global list
;; (push->lst proced 'proced-list) )
;;
;; (defun pop-out ( )
;; ;; remove an item from a global list
;; (list-pop 'proced-list) )
;; hook
;; this function will take an argument and turn it into a
;; lambda expression to evaluate. (You can assign an variable
;; and assign it at a later time if you wish.)
;;
;; By: John (Se7en) K
;; (inspired by Vladimir Nesterovsky)
;;
;; Ex: (hook '(+ 1 2))
;; > ((LAMBDA nil (+ 1 2)))
;;
(defun popout
-hook
-and
-do
( / x
)
(defun fill
-list
-from
-file
( filename
-str
/ fp
) ;; fill-list-from-file
;;
;; (fill-list-from-file "c:\\test.dat")
;; > ((ALERT "test2") (ALERT "test1"))
;;
;; TODO add a filter for the path variables
;; -ie ACAD => (setenv "ACAD" (strcat <pathstr> (getenv "ACAD")))
;;
my-lst
)
;; //--End Support Procedures--//
;; NOTE: I have removed the next four lines because the first test
;; was sucessfull, I am now moving on to the next phase of
;; of the procedure; reading from a file and filling the list
;; from there.
;;
;; (setq m-list '((alert "test1") (alert "test2") (alert "test3")))
;; build the list of things to do
;; build the list by using the ``fill-list-from-file'' proced
;; (mapcar 'plug-in m-list)
;; plug each of those items in the list into a master list
;; c:\test.dat contains:
;; (alert "test4")
;; (alert "test5")
;; (alert "test6")
;; (alert "test7")
(fill-list-from-file "c:\\test.dat")
(popout-hook-and-do))
;; evaluate each item in the list
)
)