+ Reply to Thread
Results 1 to 10 of 10
  1. #1
    Senior Member andy_lee's Avatar
    Computer Details
    andy_lee's Computer Details
    Operating System:
    win7
    Using
    AutoCAD 2010
    Join Date
    Apr 2014
    Location
    Singapore
    Posts
    192

    Default Judge cad version,If version is too low,not loader and prompt.

    Registered forum members do not see this ad.

    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.
    Last edited by andy_lee; 17th May 2014 at 05:25 pm.
    Best wishes!
    andy lee

  2. #2
    Super Member hmsilva's Avatar
    Discipline
    Multi-disciplinary
    Using
    AutoCAD 2016
    Join Date
    Dec 2012
    Location
    Cascais, Portugal
    Posts
    531

    Default

    Something like this perhaps.

    Code:
    (if (<= (atof (getvar 'ACADVER)) 16.1);; "16.1" AutoCAD 2005
      (progn
        (Alert
          "Need CAD2005 or later"
        )
        (exit)
      )
    )
    hope that helps
    Henrique

  3. #3
    Senior Member andy_lee's Avatar
    Computer Details
    andy_lee's Computer Details
    Operating System:
    win7
    Using
    AutoCAD 2010
    Join Date
    Apr 2014
    Location
    Singapore
    Posts
    192

    Default

    Quote Originally Posted by hmsilva View Post
    Something like this perhaps.

    Code:
    (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.......
    Best wishes!
    andy lee

  4. #4
    Super Member hmsilva's Avatar
    Discipline
    Multi-disciplinary
    Using
    AutoCAD 2016
    Join Date
    Dec 2012
    Location
    Cascais, Portugal
    Posts
    531

    Default

    Quote Originally Posted by andy_lee View Post
    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


    Code:
     (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
    Last edited by hmsilva; 17th May 2014 at 08:15 pm.

  5. #5
    Quantum Mechanic Lee Mac's Avatar
    Computer Details
    Lee Mac's Computer Details
    Operating System:
    Win 7 Pro / Win 10 Pro / Linux Mint
    Discipline
    Multi-disciplinary
    Lee Mac's Discipline Details
    Discipline
    Multi-disciplinary
    Details
    Custom Programming / Software Customisation
    Using
    AutoCAD 2018
    Join Date
    Aug 2008
    Location
    London, England
    Posts
    19,501

    Default

    Here are some other properties/functions/system variables which may also help:
    Code:
    (vla-get-caption (vlax-get-acad-object))
    (vla-get-version (vlax-get-acad-object))
    (getvar 'acadver)
    (getvar 'product)
    (getvar 'program)
    (getvar '_vernum)
    (ver)
    (_ver)
    Lee Mac ProgrammingTwitterExchange App StoreDropbox (500MB free)

    With Mathematics there is the possibility of perfect rigour, so why settle for less?

  6. #6
    Senior Member andy_lee's Avatar
    Computer Details
    andy_lee's Computer Details
    Operating System:
    win7
    Using
    AutoCAD 2010
    Join Date
    Apr 2014
    Location
    Singapore
    Posts
    192

    Default

    Quote Originally Posted by hmsilva View Post
    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


    Code:
     (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?

    Code:
    (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!
    Best wishes!
    andy lee

  7. #7
    Senior Member andy_lee's Avatar
    Computer Details
    andy_lee's Computer Details
    Operating System:
    win7
    Using
    AutoCAD 2010
    Join Date
    Apr 2014
    Location
    Singapore
    Posts
    192

    Default

    Quote Originally Posted by Lee Mac View Post
    Here are some other properties/functions/system variables which may also help:
    Code:
    (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 ?
    Best wishes!
    andy lee

  8. #8
    Super Member hmsilva's Avatar
    Discipline
    Multi-disciplinary
    Using
    AutoCAD 2016
    Join Date
    Dec 2012
    Location
    Cascais, Portugal
    Posts
    531

    Default

    Quote Originally Posted by andy_lee View Post
    hmsilva, Thank you!

    like this?

    Code:
    (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!
    One way:
    Code:
    ;;;;;;;;;;;;;;;;;;;;;;;;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

  9. #9
    Senior Member andy_lee's Avatar
    Computer Details
    andy_lee's Computer Details
    Operating System:
    win7
    Using
    AutoCAD 2010
    Join Date
    Apr 2014
    Location
    Singapore
    Posts
    192

    Default

    Quote Originally Posted by hmsilva View Post
    One way:
    Thanks hmsilva,

    Code:
    ;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
    Best wishes!
    andy lee

  10. #10
    Super Member hmsilva's Avatar
    Discipline
    Multi-disciplinary
    Using
    AutoCAD 2016
    Join Date
    Dec 2012
    Location
    Cascais, Portugal
    Posts
    531

    Default

    Registered forum members do not see this ad.

    You're welcome, andy_lee!
    Glad you got it to work.

    Henrique

Similar Threads

  1. Replies: 6
    Last Post: 22nd Apr 2014, 06:03 am
  2. Version 2012 to version 2007: Got An Opener?
    By David Devitt in forum AutoCAD General
    Replies: 16
    Last Post: 5th Feb 2013, 01:49 pm
  3. Replies: 14
    Last Post: 26th Nov 2012, 03:39 pm
  4. Updating misc CAD files/ info version to version
    By Mark KEC in forum CAD Management
    Replies: 3
    Last Post: 21st May 2012, 01:54 pm
  5. Replies: 9
    Last Post: 16th Nov 2010, 03:56 pm

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts