Judge cad version,If version i
Judge cad version,If version is too low,not loader and prompt.I have a table routine, need cad 2005 later version,
If routine call command is "test" , so call "test" , frist,judge cad version ,if CAD2005 previous versions, not run andPop-up prompts. Something like this perhaps.
(if (
hmsilva, Thanks, but not that.
Your routine is when "appload", check cad version and Pop-up prompts.
I mean is after appload, after input command in the command bar, after press Enter or space key, check cad version.......
andy_lee,
you shouldn't have edited and removed the code that you had posted at msg #1...
That code is not my code, is yours, I just modified it to work with AutoCAD 2005 or later ones...
If I understood you correctly, perhaps something like this
(defun c:test ()(if (>= (atof (getvar 'ACADVER)) 16.1);; "16.1" AutoCAD 2005 (progn;;; your routine here (Alert "You have the correct CAD version!!!");; just for demo );; progn (Alert "Need CAD2005 or later"));; if);; test
HTH
Henrique Here are some other properties/functions/system variables which may also help:
(vla-get-caption (vlax-get-acad-object))(vla-get-version (vlax-get-acad-object))(getvar 'acadver)(getvar 'product)(getvar 'program)(getvar '_vernum)(ver)(_ver)
hmsilva, Thank you!
like this?
(defun c:test ()(if (>= (atof (getvar 'ACADVER)) 16.1);; "16.1" AutoCAD 2005 (progn ;;;;;;;;;;;;;;;;;;;;;;;;My routine is start ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;(defun c:test(/ *error* dlg p a i l 1p sc e pl h gr rot r)................ ) (princ));;;;;;;;;;;;;;;;My routine is over;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (Alert "You have the correct CAD version!!!");; just for demo );; progn (Alert "Need CAD2005 or later"));; if);; test
1.Command must be the same? your routine command is "test", my routine command must "test" too,
2. if version is right , show "you have the correct cad version" ,this can omit.
I mean if version is low ,show "Need Cad2005 or later" ,if is right , not prompt,Direct calling program.
Thanks!
Thanks ,lee ,how to Judge Express Tools is install ?
One way:
;;;;;;;;;;;;;;;;;;;;;;;;My routine is start ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;(defun c:test (/ *error* dlg p a i l 1p sc e pl h gr rot r) ;; first test AutoCAD version (if (>= (atof (getvar 'ACADVER)) 16.1);; "16.1" AutoCAD 2005 (progn;; if test returns T;; your routine start................;;your routine end );; progn ;; if test AutoCAD version returns nil (Alert "Need CAD2005 or later"));; if (princ));; test;;;;;;;;;;;;;;;;My routine is over;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
HTH
Henrique
Thanks hmsilva,
;;your routine end );; progn ;;I delete this , OK! Otherwise an error ;; if test AutoCAD version returns nil (Alert "Need CAD2005 or later"));; if (princ));; test;;;;;;;;;;;;;;;;My routine is over;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; You're welcome, andy_lee!
Glad you got it to work.
Henrique
页:
[1]