@Anonymous wrote:
..... An even slicker one arrived from a reply today. It uses (getvar 'lastprompt). .... going to test the next couple days.
....
So now it's not working again for me, which makes me wonder what I did differently when it seemed like it did work. It works when there are no unreconciled Layers, but when there are, it doesn't feed in the * to reconcile them all, but only the "" Enter. So I put in a what's-the-last-prompt-really variable:
(defun C:RAL () ; = Reconcile All Layers
(command "_.layer" "_rEconcile")
(if (wcmatch (setq test (getvar 'lastprompt)) "*list*")
(command "*" ""); then
(command ""); else
); if
(princ)
); defun
and when I check what that got, it's the latest basic one, including the rEconcile option that the routine gave it:
Command: !test
"Enter an option [?/Make/.../Xref]: _rEconcile"
And yet, by that point in the command, the name-Layers-to-reconcile prompt must have "arrived." I guess I don't understand exactly what the LASTPROMPT System Variable does. Help says:
This string is identical to the last line seen at the Command prompt and includes any user input.
the end of which explains the rEconcile option that the routine fed in being shown there. But the command-line history shows:
Command: RAL
_.layer
Current layer: "0"
Enter an option [?/Make/.../Xref]: _rEconcile
Enter name list of layer(s) to turn reconcile or <select objects> or [?]:
[this would be where the routine is checking for the LastPrompt, but it's feeding in "" instead of what it should: "*" followed by ""]
No unreconciled layers selected.
Enter an option [?/Make...
which indicates that the blue part has been "seen at the Command prompt," because it's the Enter fed in, in response to that, that's causing the line under that. But somehow (getvar 'lastprompt) is not seeing it that way, but is recognizing the next-to-last prompt instead.
I imagine there's a way to get it to "see" the right one, but I haven't found it yet. Maybe it has something to do with the nil return from the first (command) function, but I don't think so, because if I just do this manually:
(command "_.layer" "_rEconcile")
the nil return doesn't affect anything, but it just repeats the prompt:
Command: (command "_.layer" "_rEconcile")
_.layer
Current layer: "0"
Enter an option [?/Make/.../Xref]: _rEconcile
Enter name list of layer(s) to turn reconcile or <select objects> or [?]: nil
Enter name list of layer(s) to turn reconcile or <select objects> or [?]:
Kent Cooper, AIA