XDSoft 发表于 2021-1-16 00:49:34

STARTUP 系统变量和StartUpType 环境变量

问题:

The STARTUP system variable and the StartUpType environment variable

解答:

With the value of the STARTUP system variable set to 0, the user is only given the option of using a template.If it was set to 1, this would enable a user to 1) start a drawing from scratch, 2) use a template, or 3) use a wizard.You can of course control this programatically.

(defun-q MyStartup ( / app doc)
   (vl-load-com)
   (setq app (vlax-get-acad-object)
         doc (vla-get-activedocument app)
   ) ;setq
   (if (= (substr (vlax-variant-value
   (vla-getvariable doc "ACADVER")) 1 2) "17")
      (vla-setvariable doc "STARTUP"
       (vlax-make-variant 1 vlax-vbInteger))
   )
   (princ)
)
(setq S::STARTUP (append S::STARTUP MYSTARTUP))

You can change the default option for the dialog by setting the StartUpType variable as shown below:

;To start from Scratch
(setenv "StartUpType" "Scratch")

;To use a Template
(setenv "StartUpType" "T?emplate")

;To use a Wizard
(setenv "StartUpType" "Wizard")


/db_自贡黄明儒_ 发表于 2021-1-17 15:26:12

这段代码很实用。
页: [1]
查看完整版本: STARTUP 系统变量和StartUpType 环境变量