How to find if on accoreconsole or GUI

How to find if on accoreconsole or GUI

kazfukuoka
Enthusiast Enthusiast
483 Views
6 Replies
Message 1 of 7

How to find if on accoreconsole or GUI

kazfukuoka
Enthusiast
Enthusiast

Hi Community,

I want to do initialization at startup only if AutoCAD
is started with GUI, not for accoreconsole.

 

For example, in pseudo code,
(if (not ACCORECONSOLE) (command "FileDia" "1"))

Is there any way to do this?

0 Likes
Accepted solutions (1)
484 Views
6 Replies
Replies (6)
Message 2 of 7

paullimapa
Mentor
Mentor

ok, not tested..but I know accoreconsole does not support (layoutlist) so you can try this:

(if (not (layoutlist))(princ"accore")(princ"gui"))

Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 3 of 7

kazfukuoka
Enthusiast
Enthusiast

Thanks. But on accoreconsole, it goes as follows.

Command: (if (not (layoutlist))(princ"accore")(princ"gui"))
; error: no function definition: LAYOUTLIST

Probably we need something like (ifdef layoutlist).

0 Likes
Message 4 of 7

paullimapa
Mentor
Mentor

how about this which would return nil if the function does NOT exists which means you're running accoreconsole:

(member (type layoutlist) '(subr usubr exrxsubr))

 


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes
Message 5 of 7

paullimapa
Mentor
Mentor
Accepted solution

or would accoreconsole allow this:

(if layoutlist (princ"gui")(princ"accore"))

Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
Message 6 of 7

kazfukuoka
Enthusiast
Enthusiast
Thank you, it works beautifully.
0 Likes
Message 7 of 7

paullimapa
Mentor
Mentor

glad to have helped...cheers!!!


Paul Li
IT Specialist
@The Office
Apps & Publications | Video Demos
0 Likes