Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Error in Background Color Routine

The attached routine by another is used to either to conveniently change background colors: It allows the user to either toggle (BGT) between white/black or to switch to one of three selections: white (BGWHITE), grey (BGGREY), or black (BGBLACK). The error is encountered when black is either toggled or selected.
Being a novice, I do not know how to make the needed changes and would appreciate some guidance.

The following error appears at the command line (when the background desired is to be black):
Error: Automation Error E_FAIL; [IAcadPreferencesDisplay] function [GRAPHICSWINMODELBACKGRNDCOLOR] unspecified error

Thanks,
Clint Hill

Comments

  • I stumbled over the same problem some days ago:
    The type of the "BKGCOLOR"-Variable has changed from int to string in V20. I am not sure if this is intended (I guess it is, to allow for rgb values), but I adapted the code that I use to toggle between a dark and a bright background, see attached lisp file.

    Frankly, I wonder if the old vanilla lisp that I use is not more apt for such simple tasks, since it should be understood and editable by any user that knows how to set a variable...

    lsp
    lsp
    toggle_theme.lsp
    1K
  • edited November 2019

    I better understand the overall situation and greatly appreciate your attached file.

    I am on and will be using v19 for some time.
    It is interesting that the grey and white selections work as designed yet the black color will not and cannot be toggled from white.

    Any further findings would be appreciated.

    Yours,
    Clint

  • The code you posted runs fine on V20 (Linux), so probably there has been an incompatibility in earlier versions.
    If you want to follow the path that I suggested (using simple "setvar" statements), you would have to change the type of the BKGCOLOR-Variable back to integer (e.g. setvar "BKGCOLOR" 7 instead of setvar "BKGCOLOR" "7" ) in the code attached above.

  • I thank you, Knut, and will do just that very thing!

Sign In or Register to comment.
Origami
Origami is the Japanese word for paper folding. ORI means to fold and KAMI means paper and involves the creation of paper forms usually entirely by folding.

Powered by VanillaForums, Designed by Steam