@DeEng
Ok - here are some thoughts:
1) It's very difficult to diagnose the problem if a) we don't have any way to run it, and 2) we don't understand the purpose. However - I can see the following:
2) The first obvious thing I see wrong with the code is this line:
(action_tile "btn_exit" "(exit)")
You should never use "exit" here as it stops all code processing and sends to the error handler, which doesn't allow the dialog to close or unload properly. It should rather be:
(action_tile "btn_exit" "(done_dialog)")
3) The second obvious thing i see is that you MUST close the dialog before you run (command). You are trying to run the LINE command while the dialog is still open which is not allowed. You have to close the dialog before you can do the LINE command. Your defun (AnalyzeAdditionalLines) tries to run while the dialog is open, hence the main problem I think. I suggested changing:
(action_tile "btn_open_model" "(open_model_file)")
(action_tile "btn_open_card" "(open_card_file)")
to this:
(action_tile "btn_open_model" "(done_dialog)(open_model_file)")
(action_tile "btn_open_card" "(done_dialog)(open_card_file)")
Or you have to rearrange your function (AnalyzeAdditionalLines) to run after the dialog closes. You can use an argument (done_dialog n) with an integer that can be captured with (start_dialog), such as (setq retval (start_dialog )) and use a conditional statement example (cond ((= ret 1) (do_this1)) ((= ret 2) (do_this2)...) etc to do different things after the dialog closes, then optionally re-load the dialog after within a (while) loop such as (while (> ret 0) ....)