Jump to content

Recommended Posts

Posted

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.

Posted

Try this:

 

(defun C:Maximise ( )
(command "CLEANSCREENON")
(command "CLEANSCREENOFF")
(princ)
)

(C:MAXIMISE)

(princ)

Posted

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.

Posted

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.

Posted

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.

Posted

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?

Posted

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.

Posted

Just a question....

If you execute CLEANSCREEN ON and OFF at the same time.... wouldnt that do just... nothing?

Posted

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.

Posted

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.

Posted

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.

Posted

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. :(

  • 8 months later...
Posted

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.

 

czQfYSG.jpg

Posted

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.

Posted

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.

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...