Message 1 of 12
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have been going at this code for over a week trying to get this to work...
I have a pretty big LISP file with individual routines defined within it to assist my coworkers in their drafting process. I realized as this routine is expected to grow and it would take a bit for my coworkers to memorize all of the commands, I made a quick DCL with a handful of image slides to make it easier for them. This is where I'm stuck though..
I want the original DCL to close before opening the next programs DCL, anything I've tried has given me all types of error codes, or has been able to run but the original DCL was stuck on the screen. Below is my code and a snip of the first DCL.
(defun c:BNS()
; code here works as normal
)
(defun c:ULT (/ Dcl_Id% what_next cnt)
(vl-load-com)
(setq Slides@ (list nil "BNS" "BTOOLS" "LYRFRZ" "VPLU" "WIP" "WIP" "CMD7" "CMD8" "CMD9") ;; NAME OF THE .SLD FILE
Slide1$ (nth 1 Slides@)
Slide2$ (nth 2 Slides@)
Slide3$ (nth 3 Slides@)
Slide4$ (nth 4 Slides@)
Slide5$ (nth 5 Slides@)
Slide6$ (nth 6 Slides@)
Folder$ (strcat "Z:/" "5. Documents/Programs/Autodesk/Auto & Visual LISP/Programs/AutoLISP Ultimate/AutoULT Slides/")
Return$ "")
(setq *commands_to_execute* '((c:ULT) (c:BTOOLS) (c:LYRFRZ)))
(setq Dcl_Id% (load_dialog "AutoLISP Ultimate.dcl"))
(setq what_next 2)
(while (>= what_next 2)
(if (null (new_dialog "autoULT" Dcl_Id%))
(exit)
)
(set_tile "Title" "AutoLISP Ultimate")
(start_image "Slide1")(setq X# (- (dimx_tile "Slide1") 2))
(setq Y# (- (dimy_tile "Slide1") 2))(end_image)
(start_image "Slide1")(slide_image -12 -3 175 Y# (strcat Folder$ Slide1$))(end_image) ; -X= << || -Y= ^^
(start_image "Slide2")(slide_image 0 -6 X# Y# (strcat Folder$ Slide2$))(end_image)
(start_image "Slide3")(slide_image 0 -7 X# Y# (strcat Folder$ Slide3$))(end_image)
(start_image "Slide4")(slide_image -2 -6 X# Y# (strcat Folder$ Slide4$))(end_image)
(start_image "Slide5")(slide_image -2 -6 X# Y# (strcat Folder$ Slide5$))(end_image)
(start_image "Slide6")(slide_image -2 -6 X# Y# (strcat Folder$ Slide6$))(end_image)
(action_tile "Slide1" "(setq Return$ Slide1$) (c:BNS) (done_dialog 4)")
(action_tile "Slide2" "(setq *command_index* 1)(setq *commands_requested* t)")
(action_tile "Slide3" "(progn (done_dialog 4)(setq Return$ (strcat \"c:\" Slide3$)))")
(action_tile "Slide4" "(progn (done_dialog 4)(setq Return$ (strcat \"c:\" Slide4$)))")
(action_tile "accept"
"(setq *commands_requested* nil)
(done_dialog 1)
(if (setq idx *command_index*)
(progn
(mapcar '(lambda (cmd) (if (= idx (car cmd)) (eval (cadr cmd)))) *commands_to_execute*)
(setq *command_index* nil)
)
)"
)
; (action_tile "accept" "(done_dialog 1) (princ \"OK button clicked\")")
(setq what_next (start_dialog))
(cond
((= what_next 4)
(done_dialog 4)
)
((= what_next 0)
(prompt "\nuser cancelled dialog")
)
)
)
(unload_dialog Dcl_Id%)
(if (= what_next 4)
(progn
(setq Return$ Slide1$)
(c:BNS))
)
(princ)
)
Solved! Go to Solution.