Manila Wolf Posted October 25, 2017 Posted October 25, 2017 I am trying to use my acaddoc file to automatically load this lisp and also run it at startup but for some reason I won't work: - (defun c:Maximise ( ) (command "CLEANSCREENON") (command "CLEANSCREENOFF") ) I tried to call it in the acaddoc file using this line: - (load "Maximise.lsp") (c:MAXIMISE) (Incidentally this lisp is indeed in my AutoCAD search path.) I also tried to add this to my Acaddoc file but it still will not toggle clean screen on then off again immediately after startup: - (defun-q mystartup () (command "CLEANSCREENON") (command "CLEANSCREENOFF") ) (setq S::STARTUP (append S::STARTUP mystartup)) "What on earth are you trying to do that for" I hear you say. I just upgraded from Windows 7 and AutoCAD 2009 to Windows 10 and AutoCAD 2016. When I open the AutoCAD window set as maximised in the shortcut, the AutoCAD window always goes behind the windows 10 taskbar. If I toggle the cleanscreen on then off again it fixes the problem. I am hoping to automate the toggle every time I open a drawing. I always use Single drawing interface. SDI = 1. I do not want to change this setting. I am hoping somebody can help. Quote
Aftertouch Posted October 25, 2017 Posted October 25, 2017 Try this: (defun C:Maximise ( ) (command "CLEANSCREENON") (command "CLEANSCREENOFF") (princ) ) (C:MAXIMISE) (princ) Quote
Manila Wolf Posted October 26, 2017 Author Posted October 26, 2017 Good day Aftertouch and thank you for your response. Actually, I am a little unsure as to where to place your suggested code. Is it simply pasted into my Acaddoc.lsp file? Or is it called by S::Startup within the Acaddoc.lsp file? Unfortunately it did not work in either. It is possible I am interpreting it incorrectly as I only understand very basic lisp. Regards and thanks again. Quote
Aftertouch Posted October 26, 2017 Posted October 26, 2017 If you paste the code in the acaddoc.lsp it should work? The defun part creates the new command, the line (C:MAXIMISE) Executes it then. Quote
Manila Wolf Posted October 26, 2017 Author Posted October 26, 2017 Hi Aftertouch, Thank you. I did try that and unfortunately it did not work. After trying I pressed F2 and this is an extract of what is showing: - AutoCAD menu utilities loaded. "Acaddoc.lsp" loading.COMMANDLINE _-PLOTSTAMP _LOG _NO PLOT.LOG Auto-Ortho Reactor enabled.ctab model _VIEWRES _Y 10000 _REGENALL ctab Model CLEANSCREENON CLEANSCREENOFF "Acaddoc.lsp" loaded.*Cancel* Command: *Cancel* COMMANDLINE Command: It seems like CLEANSCREENON and CLEANSCREENOFF are actuated, but it maybe happens before AutoCAD is finally initiated. If I run my Maximise lisp manually after AutoCAD has fully opened, it works. I made myself a toolbutton to run the maximise.lsp. So currently I have to press the button myself each time I open AutoCAD. Quote
Aftertouch Posted October 26, 2017 Posted October 26, 2017 I prefer to have a custom LISP file, wich is called from the 'APPLOAD' Startup Suite. Those are ran when AutoCAD is fully loaded. You can give that a try? Quote
Manila Wolf Posted October 26, 2017 Author Posted October 26, 2017 I did try that Aftertouch. Also could not get it to work. I took out this Autoload line in my Acaddoc:- (autoload "C:/AutoCadTransfer/MarkLisp/Maximise.lsp" '("MAXIMISE")) Then tried this version of the maximise lisp in the Appload startup suite: - (defun C:Maximise ( ) (command "CLEANSCREENON") (command "CLEANSCREENOFF") (princ) ) (C:MAXIMISE) (princ) The F2 readout is the same as when it was loaded direct from the Acaddoc. I fully appreciate your suggestions. I think the whole "behind the taskbar" problem is a Windows 10 issue. I am hoping for a hotfix soon. Quote
Aftertouch Posted October 26, 2017 Posted October 26, 2017 Just a question.... If you execute CLEANSCREEN ON and OFF at the same time.... wouldnt that do just... nothing? Quote
Manila Wolf Posted October 26, 2017 Author Posted October 26, 2017 It actually works. My maximised Autocad session starts up behind or underneath the Windows 10 taskbar. If I execute CLEANSCREENON, then immediately afterwards excecute CLEANSCREENOFF, the window is maximised but no longer behind the taskbar but sitting on top of the taskbar. It is indeed strange. The other alternative that works, is to twice press the windows maximise button at the top right of the screen. Twice in succession I could do that, but my toolbutton associated with maximise lisp means one click instead of two clicks. Quote
Grrr Posted October 26, 2017 Posted October 26, 2017 With Windows 8.1 I have the same issue - when autocad is not running and I have to open some .dwg file, so I just wrote this: ; Maximizes/docks the autocad window at startup ; I have this issue when opening drawings when autocad is not running (defun C:Maximize ( / app ) (setq app (vlax-get-acad-object)) (mapcar (function (lambda (x) (vla-put-WindowState app x))) (list acMin acMax)) (princ) ); defun C:Maximize (vl-load-com)(princ) Unfortunately doesn't work for me on startup (when I define and run the function inside the acad.lsp file, neither if I include it as Maximize.lsp to be loaded as the last .lsp file [auto-run again]). So just ended up manually calling "maximize" right after my dwg opens. Quote
Manila Wolf Posted October 27, 2017 Author Posted October 27, 2017 Hi Grrr, Thank you for contributing. At least you confirmed that I am not the only one having this problem. We have both tried to solve the problem in similar ways but unfortunately we can't find the solution. Quote
Roy_043 Posted October 29, 2017 Posted October 29, 2017 It may work to set up a compatibility mode: https://winaero.com/blog/compatibility-mode-settings-windows-10/ Quote
Manila Wolf Posted November 1, 2017 Author Posted November 1, 2017 Good day Roy_043. Thank you very much for your suggestion. It did look very promising. I tried all different combinations of all the available compatibility options. Unfortunately to no avail. Quote
3dwannab Posted July 12, 2018 Posted July 12, 2018 Both the LISP that Grrr posted and this below worked for me. Right click on ACADs shortcut and change this setting. It hides the taskbar on startup but when opening a dwg it'll go maximised as normal. Quote
tombu Posted July 12, 2018 Posted July 12, 2018 S::STARTUP Function: Postinitialization Execution: https://knowledge.autodesk.com/search-result/caas/ConnectHelp/autocad/enu/online-help/ACD/2012/ENU/pages/WS73099cc142f4875513fb5cd10c4aa30d6b-7f62-htm.html and http://www.cadtutor.net/forum/showthread.php?26336-S-STARTUP-Function The startup LISP files (acad.lsp, acaddoc.lsp, and MNL) are all loaded into memory before the drawing is completely initialized. Typically, this does not pose a problem, unless you want to use the command function, which is not guaranteed to work until after a drawing is initialized. Quote
rkmcswain Posted July 12, 2018 Posted July 12, 2018 Also, you can have multiple parts to S::Startup, in multiple files. Any startup file can contain code for S::Startup, just be sure to use (defun-q....) and concatenate them together. 3rd party developers used to use this all the time, they would add their startup code to any existing S::Startup definition. If another 3rd party tool was added, they would do the same, etc. etc. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.