|
|
|
Using hybrid scripting, you can prepare a universal MsgBox function for AutoLISP, with optional buttons, icons and auto-dismiss feature (after N seconds). This function will work in both full AutoCAD and in AutoCAD LT (2024+).
;Universal MessageBox - see www.cadforum.cz
;(msgbox "Message" "Title" Mode[0..5 + icon 16/23/48/64] AutoDismiss[secs or 0])
(defun MsgBox (message title options time / WshShell)
(if (not title)(setq title "AutoCAD"))
(if (not options)(setq options 0)) ; plain msgbox, OK
(if (not time)(setq time 0)) ; no auto-dismiss
(if (setq WshShell (vlax-create-object "WScript.Shell")) ; full ACAD:
(vlax-invoke WshShell 'Run
(strcat "mshta.exe vbscript:close(CreateObject(\"WScript.Shell\").Popup(\""
message "\"," (itoa time) ",\"" title "\"," (itoa options) "))")
) ; else LT:
(startapp (strcat "mshta.exe vbscript:close(CreateObject(\"WScript.Shell\").Popup(\""
message "\"," (itoa time) ",\"" title "\"," (itoa options) "))"))
)
(if WshShell (vlax-release-object WshShell))
)
Then use e.g.:
(MsgBox "Hello world! Are you ready?" nil 33 4)
|
|
ACADACLT2024
|
* CAD
|
26.1.2024
24606×
|
|
|