ok, here's the magic...at least one method of doing it.
First I added another variable what-next
This is the variable that will be checked to see if it loops or not.
; defined function as treecircle
(defun c:treecircle
; localize variables
(/ clicked dialogResult what-next)
(setq dialogResult (load_dialog "treecircle.dcl"))
(if (not dialogResult)
(exit)
)
; setup for dialog loop
(setq what-next 1) ; start with higher than 0
(while (> what-next 0) ; loop as long as value is greater than 0
(new_dialog "treecircle" dialogResult)
Notice the while loop occurs after the load_dialog function. So the dialog only needs to be loaded once. It stays in memory until it's unloaded.
After the while statement then run the new_dialog function to make the dialog appear on the screen. This is the function that needs to repeat in the loop or else you won't see the dialog again.
Then I added additional action statements to pass the value declared when start_dialog runs & done_dialog function closes the dialog (note the matching uppercase on OK & CANCEL which is how you've included these keys in the dcl):
; include actions statements before start dialog
(foreach tile '("C10""C15""C20")(action_tile tile "(setq clicked $key)(done_dialog 1)")) ; this sets value in clicked variable & then closes dialog
(action_tile "OK" "(done_dialog 1)") ; OK button close dialog but continue loop
(action_tile "CANCEL" "(done_dialog 0)") ; CANCEL button close dialog & end loop
; start dialog
; (start_dialog dialogResult)
; this is the proper method
(setq what-next (start_dialog)) ; save done_dialog return value
Now the condition statement tests need to be moved up right after start_dialog function so these can run in the while loop. After circle functions are completed, since the what-next value continues to be greater than 0 then it'll loop back up top and run new_dialog again. But if not, like when the CANCEL button is clicked which sets the what-next value to 0 then the while loop ends and the unload_dialog function is called to remove the dcl from memory and close the routine:
; check return value
(if(> what-next 0) ; if greater than 0
(progn
(cond ; test to see what if anything was selected:
((= clicked "C10") (princ(strcat"\nDraw Circle " clicked "..."))(c:C10))
((= clicked "C15") (princ(strcat"\nDraw Circle " clicked "..."))(c:C15))
((= clicked "C20") (princ(strcat"\nDraw Circle " clicked "..."))(c:C20))
(t(alert"Nothing Selected"))
) ; cond
) ; progn
; else is 0
(alert"Function Cancelled")
) ; if
) ; while
; unload dialog
(unload_dialog dialogResult)
(princ)
) ; defun