Author Topic: Partial CUI Load ACADDOC  (Read 1041 times)

0 Members and 1 Guest are viewing this topic.

capsochist

  • Newt
  • Posts: 24
Partial CUI Load ACADDOC
« on: September 22, 2020, 05:27:19 PM »
Hi there,

I have the following block of code in my ACADDOC.lsp file which checks a few system variables upon startup. I am wondering how to add a block of code that checks whether a Partial CUI is loaded at startup in the same way as opposed to writing (
Code - Auto/Visual Lisp: [Select]
  1. command "menuload" "acad"
) which doesn't check that it is loaded, but instead just force loads it regardless.


Code - Auto/Visual Lisp: [Select]
  1. (foreach sys
  2.    '(
  3.         (pdfshx     0)
  4.         (epdfshx    0)
  5.         (imageframe 2)
  6.         (pdfframe   2)
  7.         (pellipse   1)
  8.         (fontalt        "arial")
  9.     )
  10.     (if (getvar (car sys)) (apply 'setvar sys))
  11. )

BIGAL

  • Swamp Rat
  • Posts: 1409
  • 40 + years of using Autocad
Re: Partial CUI Load ACADDOC
« Reply #1 on: September 22, 2020, 08:17:06 PM »
To quote Autodesk.

(menugroup groupname)

If groupname matches a loaded menu group name, the function returns the groupname string; otherwise, it returns nil.

Write a If to check if not then menuload.
A man who never made a mistake never made anything

capsochist

  • Newt
  • Posts: 24
Re: Partial CUI Load ACADDOC
« Reply #2 on: September 22, 2020, 08:55:47 PM »
this  seems to work...

Code - Auto/Visual Lisp: [Select]
  1. (if (not (menugroup "acad"))
  2.         (progn
  3.         (command "menuload" "acad"))
  4. )
« Last Edit: September 22, 2020, 09:11:01 PM by capsochist »