Autolisp: Check Service Pack Version of Autocad

Autolisp: Check Service Pack Version of Autocad

bgumPXZJF
Advocate Advocate
759 Views
2 Replies
Message 1 of 3

Autolisp: Check Service Pack Version of Autocad

bgumPXZJF
Advocate
Advocate

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
760 Views
2 Replies
Replies (2)
Message 2 of 3

ronjonp
Mentor
Mentor

There is also this HERE 🙂

Message 3 of 3

lena.talkhina
Alumni
Alumni

Hello @bgumPXZJF !

 

Great to see you on LISP forum.

Do you find @ronjonp 's comment helpful?


If yes, please click on the "Accept as Solution" button as then also other community users can easily find and benefit from the information.
If not please don't hesitate to give an update here in your topic so all members know what ́s the progression on your question is and what might be helpful to achieve what you ́re looking for. 🙂

Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям! | Do you find the posts helpful? "LIKE" these posts!
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.



Лена Талхина/Lena Talkhina
Менеджер Сообщества - Русский/Community Manager - Russian

0 Likes