Message 1 of 3
Autolisp: Check Service Pack Version of Autocad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I just wanted to share the code I wrote to accomplish this .
Prompts the user if they do not have the latest Autocad MEP 2019 service pack installed.
;===========================================================
; 10/Sep/2020 01:48 PM[Thursday] AUTHOR: Brandon Gum
;--
;DESCRIPTION:
;Get the service pack information for Autocad MEP.
;If they dont have the 1st 2019 Update prompt user.
;Working 10/Sep/2020 02:26 PM[Thursday]
;===========================================================
(defun BG:_getservicepack (/ i regkey version)
(setq regkey (strcat "HKEY_LOCAL_MACHINE\\" (vlax-machine-product-key)))
(and (setq i (vl-string-search ":" regkey)) (setq regkey (substr regkey 1 i)))
(setq version (car (vl-registry-descendents (setq regkey (strcat regkey "\\ProductInfo\\")))))
(if (and (wcmatch version "*MEP 2019*")(/= version "AutoCAD MEP 2019.0.1"))
(alert "You do not have the latest Autocad MEP 2019 update.\nPlease update your Autocad NOW through the 'Autodesk Desktop App'")
;Else
(princ (strcat "\nCorrect Service Pack in Use: " version))
;(vl-registry-read (strcat regkey versoin) "SPNum")
);end of if
(princ);quiet close
);end of defun