0 Members and 1 Guest are viewing this topic.
http://en.wikipedia.org/wiki/.dwgNo info on 2011 yet.There are many ways to do it.Drawing versionhttp://www.theswamp.org/index.php?topic=6774.msg333989#msg333989ACAD versionCode: [Select] ((= (rtos(atof(getvar "ACADVER"))2 2) "15.00") 2000)) ((= (rtos(atof(getvar "ACADVER"))2 2) "15.05") 2000i)) ((= (rtos(atof(getvar "ACADVER"))2 2) "15.06") 2002)) ((= (rtos(atof(getvar "ACADVER"))2 2) "16.00") 2004)) ((= (rtos(atof(getvar "ACADVER"))2 2) "16.10") 2005)) ((= (rtos(atof(getvar "ACADVER"))2 2) "16.20") 2006)) ((= (rtos(atof(getvar "ACADVER"))2 2) "17.00") 2007)) ; 7 8 9 ((= (rtos(atof(getvar "ACADVER"))2 2) "18.00") 2010))
((= (rtos(atof(getvar "ACADVER"))2 2) "15.00") 2000)) ((= (rtos(atof(getvar "ACADVER"))2 2) "15.05") 2000i)) ((= (rtos(atof(getvar "ACADVER"))2 2) "15.06") 2002)) ((= (rtos(atof(getvar "ACADVER"))2 2) "16.00") 2004)) ((= (rtos(atof(getvar "ACADVER"))2 2) "16.10") 2005)) ((= (rtos(atof(getvar "ACADVER"))2 2) "16.20") 2006)) ((= (rtos(atof(getvar "ACADVER"))2 2) "17.00") 2007)) ; 7 8 9 ((= (rtos(atof(getvar "ACADVER"))2 2) "18.00") 2010))
my versionCode: [Select](atoi (substr (ver) 13))
(atoi (substr (ver) 13))
Thanks CAB, et al, it's the ACAD version I need, so RTOS (ACADVER) is the way to go.I'll probably read the wikilink just to be geeky, though ^_^Ronjonp, If I read your method right it searches for the acad.exe file and extrapolates the version from the path? Could this differential between two different versions on the same computer (I have both R2011 and R2010 installed)?dJEQuote from: CAB on January 11, 2011, 09:04:09 AMhttp://en.wikipedia.org/wiki/.dwgNo info on 2011 yet.There are many ways to do it.Drawing versionhttp://www.theswamp.org/index.php?topic=6774.msg333989#msg333989ACAD versionCode: [Select] ((= (rtos(atof(getvar "ACADVER"))2 2) "15.00") 2000)) ((= (rtos(atof(getvar "ACADVER"))2 2) "15.05") 2000i)) ((= (rtos(atof(getvar "ACADVER"))2 2) "15.06") 2002)) ((= (rtos(atof(getvar "ACADVER"))2 2) "16.00") 2004)) ((= (rtos(atof(getvar "ACADVER"))2 2) "16.10") 2005)) ((= (rtos(atof(getvar "ACADVER"))2 2) "16.20") 2006)) ((= (rtos(atof(getvar "ACADVER"))2 2) "17.00") 2007)) ; 7 8 9 ((= (rtos(atof(getvar "ACADVER"))2 2) "18.00") 2010))
Quote from: Chris on January 11, 2011, 03:34:55 PMpersonally I prefer this:Code: [Select](atoi (vl-string-right-trim " (en)" (vl-string-left-trim "Visual LISP " (ver))))Code: [Select](defun getacadversion (/) (vl-list->string (vl-remove-if-not (function (lambda (x) (and (> x 47) (< x 58)))) (vl-string->list (ver))) ))
personally I prefer this:Code: [Select](atoi (vl-string-right-trim " (en)" (vl-string-left-trim "Visual LISP " (ver))))
(atoi (vl-string-right-trim " (en)" (vl-string-left-trim "Visual LISP " (ver))))
(defun getacadversion (/) (vl-list->string (vl-remove-if-not (function (lambda (x) (and (> x 47) (< x 58)))) (vl-string->list (ver))) ))
Quote from: ElpanovEvgeniy on January 11, 2011, 04:07:19 PMmy versionCode: [Select](atoi (substr (ver) 13))Bravo
Quote from: Lee Mac on January 11, 2011, 04:26:27 PMQuote from: ElpanovEvgeniy on January 11, 2011, 04:07:19 PMmy versionCode: [Select](atoi (substr (ver) 13))Bravo X2
Thanks CAB, et al, it's the ACAD version I need, so RTOS (ACADVER) is the way to go.I'll probably read the wikilink just to be geeky, though ^_^Ronjonp, If I read your method right it searches for the acad.exe file and extrapolates the version from the path? Could this differential between two different versions on the same computer (I have both R2011 and R2010 installed)?...
Quote from: ronjonp on January 11, 2011, 04:38:33 PMQuote from: Lee Mac on January 11, 2011, 04:26:27 PMQuote from: ElpanovEvgeniy on January 11, 2011, 04:07:19 PMmy versionCode: [Select](atoi (substr (ver) 13))Bravo X2X3He has a way of making us all look/feel stupid and happy, at the same time.
Quote from: alanjt on January 11, 2011, 04:39:26 PMQuote from: ronjonp on January 11, 2011, 04:38:33 PMQuote from: Lee Mac on January 11, 2011, 04:26:27 PMQuote from: ElpanovEvgeniy on January 11, 2011, 04:07:19 PMmy versionCode: [Select](atoi (substr (ver) 13))Bravo X2X3He has a way of making us all look/feel stupid and happy, at the same time.X4 - I'm changing my code.