Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to get Auto-CAD's full name?

6 REPLIES 6
SOLVED
Reply
Message 1 of 7
aqdam1978
3477 Views, 6 Replies

How to get Auto-CAD's full name?

Hi,

 

I am looking for a lisp code to get full name of autocad.

 

for example my autocad is "Auto CAD 2013 SP2"

I know (getvar 'acadver) can give version of AutoCAD but how can I know about service packs? (SP1 or SP2 ...)

I think the easiest way is looking at registery:

HKEY_LOCAL_MACHINE\SOFTWARE\Autodesk\AutoCAD\R19.0\ACAD-B001\Service Packs\AutoCAD 2013\PatchTitle

its value is exactly what I want: "Auto CAD 2013 SP2"

 

So, I prepared this code to get this value:

 

(defun c:GetAcadVer ( / HLM key reg Ver PN )
   (setq 
      HLM "HKEY_LOCAL_MACHINE\\"
      key (vlax-product-key);=>"Software\\Autodesk\\AutoCAD\\R19.0\\ACAD-B001:409"
      reg (substr key 1 (vl-string-search ":" key));=>"Software\\Autodesk\\AutoCAD\\R19.0\\ACAD-B001"
      Ver (car (vl-registry-descendents (strcat HLM reg "\\Service Packs")));=>"AutoCAD 2013"
      PN (vl-registry-read (strcat HLM reg "\\Service Packs\\" Ver) "PatchTitle");=>"AutoCAD 2013 SP2"
   )
)

RESULT:===> "Auto CAD 2013 SP2"

 

But I don't know is there any other solution to find out which service pack is installed?

Does anybody has a idea?

 

Thanks,

Abbas Aqdam

 

 

 

6 REPLIES 6
Message 2 of 7
hmsilva
in reply to: aqdam1978

Hi Abbas,

 

this Jimmy Bergmark post may be useful

 


HTH

Henrique

EESignature

Message 3 of 7
aqdam1978
in reply to: aqdam1978

Henrique,

 

Thank you for your link, but it's not more than my example....

 

Thanks

Message 4 of 7
p_mcknight
in reply to: aqdam1978

Not sure if this will do it for you but...

(getvar "_vernum") on my machine returns
"I.108.0.0 (UNICODE)"

Which if I look it up I know that I.108.0.0 is 2014 service pack 1 while I.18.0.0 is SP0.

G.xxx is 2013, F.xxx is 2012, and so on.  Typically if the first set of numbers is 3 digits the first digit indicates the number of the service pack.  If the first set is two digits it indicates SP0.  the _vernum is a bit easier to get at than all the registry stuff.

Message 5 of 7
aqdam1978
in reply to: p_mcknight

Hi p_mcknight,

 

Thank you for your help.

YES, _VERNUM, Returns a build number for AutoCAD. Itallows you to tell what service pack is installed for AutoCAD.

(see attached PDF file please)

 

AutoCAD version                              Value returned by _VERNUM
----------------------------------------------------------------------------
AutoCAD 2000 (shipping)                              T.0.98 / T.1.07
AutoCAD 2000 (+ Service Pack 1)                      T.1.08
AutoCAD 2000 (+ Service Pack 2)                      T.1.09
AutoCAD 2000i (shipping)                             U.0.90
AutoCAD 2000i (+ Service Pack 1)                     U.1.20
AutoCAD 2000i (+ Service Pack 2)                     U.1.81
AutoCAD 2002 (shipping)                              K.0.30
AutoCAD 2002 (+ Service Pack 1)                      K.0.44
AutoCAD 2004 (shipping)                              V.0.86
AutoCAD 2004 (+ Service Pack 1a)                     V.1.22
AutoCAD 2005 (shipping)                              N.0.63
AutoCAD 2005 (+ Service Pack 1)                      N.0.84
AutoCAD 2006 (shipping)                              Z.54.10
AutoCAD 2006 (+ Service Pack 1)                      Z.77.0
AutoCAD 2007 (shipping)                              A.54.0
AutoCAD 2007 (+ Service Pack 1)                      A.116.0
AutoCAD 2008 (shipping)                              B.51.0 (UNICODE)
AutoCAD 2008 (+ Service Pack 1)                      B.219.0 (UNICODE)
AutoCAD 2009 (shipping)                              C.56.0 (UNICODE)
AutoCAD 2009 (+ Service Pack 1)                      C.111.0 (UNICODE)
AutoCAD 2009 (+ Service Pack 1 (subscription))       C.112.0 (UNICODE)
AutoCAD 2009 (+ Service Pack 2)                      C.608.0 (UNICODE)
AutoCAD 2009 (+ Service Pack 3)                      C.711.0 (UNICODE)
AutoCAD 2010 (shipping)                              D.55.0 (UNICODE)
AutoCAD 2010 (+ Service Pack 1)                      D.215.0 (UNICODE)
AutoCAD 2011 (shipping)                              E.49.0 (UNICODE)
AutoCAD 2011 (+ Update 1.1) Update 1 was replaced.   E.115.0.0 (UNICODE)
AutoCAD 2011 (+ Update 2)                            E.209.0.0 (UNICODE)
AutoCAD 2012 (shipping)                              F.51.0.0 (UNICODE)
AutoCAD 2012 (+ Service Pack 1)                      F.107.0.0 (UNICODE)
AutoCAD 2012 (+ Service Pack 2)                      F.205.0.0 (UNICODE)
AutoCAD 2013                                         G.55.0.0 (UNICODE)
AutoCAD 2013 (+ Service Pack 1)                      G.112.0.0 (UNICODE)
AutoCAD 2013 (+ Service Pack 1.1)                    G.114.0.0 (UNICODE)


Other values:
R.1.601 >  R13c4
P.0.33  >  R14.01
T.1.33  >  Mechanical Desktop 4
T.1.35  >  Mechanical Desktop 4 SP3
T.1.07  >  Architectural Desktop 2
U.0.35  >  AutoCAD 2000i beta
U.1.00  >  Mechanical Desktop 5

AutoCAD 2000i based applications
U.0.90  >  AutoCAD 2000i initial release
U.0.91  >  LT 2000i initial release
U.1.20  >  SP1 on 2000i based product
U.1.81  >  SP2 on 2000i based product

AutoCAD 2000 based applications:
T.0.98  >  AutoCAD 2000 initial
T.1.00
T.1.02  >  GIS
T.1.03
T.1.05  >  ADT2
T.1.07  >  LDDT2
T.1.08  >  AutoCAD 2000 SP1
T.1.09  >  AutoCAD 2000 SP2
T.1.33  >  MDT4
T.1.35

 

But your algorithm is not correct!  look at this samples please:

 

AUTOCAD 2013
SP0   VERNUM=G.55.0.0
SP1   VERNUM=G.112.0.0
SP1.1 VERNUM=G.114.0.0
SP2   VERNUM=G.204.0.0

AutoCAD Architecture 2013
SP0   VERNUM=G.112.0.0
SP1   VERNUM=G.114.0.0
SP2   VERNUM=G.204.0.0

AutoCAD 2009
SP0     VERNUM=C.56.0
SP1     VERNUM=C.111.0
SP1+SAP VERNUM=C.112.0
SP2     VERNUM=C.608.0
SP3     VERNUM=C.711.0

 

so, the fisrt digit does not present service pack number!

 

But, Thank you for your help.

 

Abbas Aqdam 

 

 

Message 6 of 7
aqdam1978
in reply to: aqdam1978

(defun c:GetAcadVer ( / V N )
(setq 
   N (vla-get-caption (vlax-get-acad-object))
   V (getvar '_vernum)
)
(cond
   ((= V "B.51.0 (UNICODE)")    "AutoCAD 2008")
   ((= V "B.219.0 (UNICODE)")   "AutoCAD 2008 SP1")
   ((= V "C.56.0 (UNICODE)")    "AutoCAD 2009")
   ((= V "C.111.0 (UNICODE)")   "AutoCAD 2009 SP1")
   ((= V "C.112.0 (UNICODE)")   "AutoCAD 2009 SP1ss")
   ((= V "C.608.0 (UNICODE)")   "AutoCAD 2009 SP2")
   ((= V "C.711.0 (UNICODE)")   "AutoCAD 2009 SP3")
   ((= V "D.55.0 (UNICODE)")    "AutoCAD 2010")
   ((= V "D.215.0 (UNICODE)")   "AutoCAD 2010 SP1")
   ((= V "E.49.0 (UNICODE)")    "AutoCAD 2011")
   ((= V "E.115.0.0 (UNICODE)") "AutoCAD 2011 SP1.1")
   ((= V "E.209.0.0 (UNICODE)") "AutoCAD 2011 SP2")
   ((= V "F.51.0.0 (UNICODE)")  "AutoCAD 2012")
   ((= V "F.107.0.0 (UNICODE)") "AutoCAD 2012 SP1")
   ((= V "F.205.0.0 (UNICODE)") "AutoCAD 2012 SP2")
   ((= V "G.55.0.0 (UNICODE)")  "AutoCAD 2013")
   ((= V "G.112.0.0 (UNICODE)") "AutoCAD 2013 SP1")
   ((= V "G.114.0.0 (UNICODE)") "AutoCAD 2013 SP1.1")
   ((= V "G.204.0.0 (UNICODE)") "AutoCAD 2013 SP2")
   ((= V "I.18.0.0 (UNICODE)")  "AutoCAD 2014")
   ((= V "I.108.0.0 (UNICODE)") "AutoCAD 2014 SP1")
   ((= V "J.18.0.0 (UNICODE)")  "AutoCAD 2015");<<<???
   (t (strcat N ", Build number is: " V ))
);cond
)

 

Message 7 of 7
aqdam1978
in reply to: aqdam1978

(defun c:GetAcadVer ( / V N )
(setq 
   N (vla-get-caption (vlax-get-acad-object))
   V (getvar '_vernum)
)
(cond
   ((= V "A.54.0")			"AutoCAD 2007")
   ((= V "A.116.0")			"AutoCAD 2007 SP1")
   ((= V "B.51.0 (UNICODE)")		"AutoCAD 2008")
   ((= V "B.219.0 (UNICODE)")		"AutoCAD 2008 SP1")
   ((= V "C.56.0 (UNICODE)")		"AutoCAD 2009")
   ((= V "C.111.0 (UNICODE)")		"AutoCAD 2009 SP1")
   ((= V "C.112.0 (UNICODE)")		"AutoCAD 2009 SP1.1")
   ((= V "C.608.0 (UNICODE)")		"AutoCAD 2009 SP2")
   ((= V "C.711.0 (UNICODE)")		"AutoCAD 2009 SP3")
   ((= V "D.55.0 (UNICODE)")		"AutoCAD 2010")
   ((= V "D.215.0 (UNICODE)")		"AutoCAD 2010 SP1")
   ((= V "E.49.0 (UNICODE)")		"AutoCAD 2011")
   ((= V "E.115.0.0 (UNICODE)")		"AutoCAD 2011 SP1.1")
   ((= V "E.209.0.0 (UNICODE)")		"AutoCAD 2011 SP2")
   ((= V "F.51.0.0 (UNICODE)")		"AutoCAD 2012")
   ((= V "F.107.0.0 (UNICODE)")		"AutoCAD 2012 SP1")
   ((= V "G.55.0.0 (UNICODE)")		"AutoCAD 2013")
   ((= V "G.112.0.0 (UNICODE)")		"AutoCAD 2013 SP1")
   ((= V "G.114.0.0 (UNICODE)")		"AutoCAD 2013 SP1.1")
   ((= V "G.204.0.0 (UNICODE)")		"AutoCAD 2013 SP2")
   ((= V "I.18.0.100 (UNICODE)")	"AutoCAD 2014")
   ((= V "I.108.0.0 (UNICODE)")		"AutoCAD 2014 SP1")
   ((= V "J.51.0.0 (UNICODE)")		"AutoCAD 2015")
   ((= V "J.104.0.0 (UNICODE)")		"AutoCAD 2015 SP1")
   ((= V "J.210.0.0 (UNICODE)")		"AutoCAD 2015 SP2")
   ((= V "M.49.0.0 (UNICODE)")		"AutoCAD 2016")
   ((= V "M.107.0.0 (UNICODE)")		"AutoCAD 2016 SP1")
   ((= V "M.107.0.12 (UNICODE)")	"AutoCAD 2016 SP1 HF3")
   ((= V "M.107.0.19 (UNICODE)")	"AutoCAD 2016 SP1 HF4")
   ((= V "N.52.0.0 (UNICODE)")		"AutoCAD 2017")
   ((= V "N.52.0.1 (UNICODE)")		"AutoCAD 2017 HF1")
   ((= V "N.52.0.7 (UNICODE)")		"AutoCAD 2017 HF2")
   ((= V "N.104.0.0 (UNICODE)")		"AutoCAD 2017 SP1")
   ((= V "N.212.0.0 (UNICODE)")		"AutoCAD 2017.1")
   ((= V "N.301.0.0 (UNICODE)")		"AutoCAD 2017.1.1")
   ((= V "O.61.0.0 (UNICODE)")		"AutoCAD 2018.0.1")
   ((= V "O.72.0.0 (UNICODE)")		"AutoCAD 2018.0.2")
   ((= V "O.107.0.0 (UNICODE)")		"AutoCAD 2018.1")
   ((= V "O.154.0.0 (UNICODE)")		"AutoCAD 2018.1.1")
   ((= V "O.161.0.0 (UNICODE)")		"AutoCAD 2018.1.2")
   ((= V "P.46.0.0 (UNICODE)")		"AutoCAD 2019")
   (t (strcat N ", Build number is: " V ))
);cond
)

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost