andy_lee Posted May 17, 2014 Share Posted May 17, 2014 (edited) 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 and Pop-up prompts. Edited May 17, 2014 by andy_lee Quote Link to comment Share on other sites More sharing options...
hmsilva Posted May 17, 2014 Share Posted May 17, 2014 Something like this perhaps. (if (<= (atof (getvar 'ACADVER)) 16.1);; "16.1" AutoCAD 2005 (progn (Alert "Need CAD2005 or later" ) (exit) ) ) hope that helps Henrique Quote Link to comment Share on other sites More sharing options...
andy_lee Posted May 17, 2014 Author Share Posted May 17, 2014 Something like this perhaps. (if (<= (atof (getvar 'ACADVER)) 16.1);; "16.1" AutoCAD 2005 (progn (Alert "Need CAD2005 or later" ) (exit) ) ) hope that helps Henrique 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....... Quote Link to comment Share on other sites More sharing options...
hmsilva Posted May 17, 2014 Share Posted May 17, 2014 (edited) 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 Edited May 17, 2014 by hmsilva Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted May 17, 2014 Share Posted May 17, 2014 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) Quote Link to comment Share on other sites More sharing options...
andy_lee Posted May 18, 2014 Author Share Posted May 18, 2014 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 hmsilva, Thank you! like this? (defun c:[color="red"]test[/color] () (if (>= (atof (getvar 'ACADVER)) 16.1);; "16.1" AutoCAD 2005 (progn ;;;;;;;;;;;;;;;;;;;;;;;;My routine is start ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun c:[color="red"]test[/color](/ *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! Quote Link to comment Share on other sites More sharing options...
andy_lee Posted May 18, 2014 Author Share Posted May 18, 2014 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) Thanks ,lee ,how to Judge Express Tools is install ? Quote Link to comment Share on other sites More sharing options...
hmsilva Posted May 18, 2014 Share Posted May 18, 2014 hmsilva, Thank you! like this? (defun c:[color=red]test[/color] () (if (>= (atof (getvar 'ACADVER)) 16.1);; "16.1" AutoCAD 2005 (progn ;;;;;;;;;;;;;;;;;;;;;;;;My routine is start ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (defun c:[color=red]test[/color](/ *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! 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 Quote Link to comment Share on other sites More sharing options...
andy_lee Posted May 19, 2014 Author Share Posted May 19, 2014 One way: Thanks hmsilva, ;;your routine end [color="red"] );; progn ;;I delete this , OK! Otherwise an error[/color] ;; if test AutoCAD version returns nil (Alert "Need CAD2005 or later") );; if (princ) );; test ;;;;;;;;;;;;;;;;My routine is over;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Quote Link to comment Share on other sites More sharing options...
hmsilva Posted May 19, 2014 Share Posted May 19, 2014 You're welcome, andy_lee! Glad you got it to work. Henrique Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.