Overwriting a layer state from command prompt?

I am using v14 and am attempting to create a macro to save my current layer settings as a layer state named "1". This is so I can temporarily lock or turn some layers off, and then quickly restore them. I already have a macro to restore layer state 1. But, when I attempt to use the command line to save layer state "1", it says the layer name already exists and then prompts me for a new name. I would need to overwrite the existing layer state named "1".

It looks like it is not possible using just the command line options. But, I am posting here in case there is an alternative that I am unaware of. There have been hidden options that are not on the command prompt, though they are rare.

-Joe

Comments

  • The command doesn't accept Overwrite, but if you use Delete and then Save you get the same effect. You can do both without exiting the State option of the -Layer command.

  • That is a great idea. Thank you.

    There is one minor issue, in that the Save Layer state always opens the command prompt history window. I have been trying to find a way to toggle it off. Function key 2 does it, but I don't know how to put that into an expression. I looked up the word "Function" on Autodesk's web help for Diesel functions, but I could not turn up anything.

    Part of the challenge that that some of the possible search terms are so widely used, that I cannot drill down to what I am seeking. Do you know of any command prompt equivalent to using the F2 key, or even a way to send a "F2" keystroke itself?

    -Joe

  • Try this: (graphscr)

  • No amount of searching through the help file would have helped me find that command. And I did spend quite a while searching. That is why computers will never replace man. Thank you.

    Here is the macro I created, for anyone interested.
    ^c^c-la;State;Delete;1;Save;1;;;;Graphscr;

    Note that if a layer state named "1" does not already exist, then the macro will fail.

    The Graphscr (or its corollary Textscr) don't have what I could consider a good descriptions in the help file. In my v14 says it, "brings the drawing window (graphics screen) to the foreground." But, in reality it closes or opens those windows. They don't move to the b

    -Joe

This discussion has been closed.