Results 1 to 6 of 6

Thread: autocad version

  1. #1
    I could stop if I wanted to
    Join Date
    2006-04
    Posts
    466
    Login to Give a bone
    0

    Default autocad version

    how do I find out the current autocad version running using autolisp? system varibles?
    Last edited by aaronic_abacus; 2020-06-01 at 06:23 AM.

  2. #2
    Active Member
    Join Date
    2015-12
    Location
    Western Europe
    Posts
    57
    Login to Give a bone
    0

    Default Re: autocad version

    sysvar "acadver". But you will need to translate as it returns a number+ as a string. If you have express tools loaded type _.sysvdlg

  3. #3
    I could stop if I wanted to
    Join Date
    2006-04
    Posts
    466
    Login to Give a bone
    0

    Default Re: autocad version

    thanks dlanor, I tested across different autocad versions and got different numbers.
    Last edited by aaronic_abacus; 2020-06-01 at 11:33 AM.

  4. #4
    Certifiable AUGI Addict
    Join Date
    2001-03
    Location
    Tallahassee, FL USA
    Posts
    3,658
    Login to Give a bone
    0

    Default Re: autocad version

    Try:
    Code:
    ; Autocad version information
    ; BY: Tom Beauford - 7/11/2005
    ; Beaufordt@LeonCountyFL.gov
    ; LEON COUNTY PUBLIC WORKS SURVEY & R/W SECTION
    ; (load "ver_name.lsp") ver_name
    ;=============================================================
    (defun c:ver_name ( / pro vlt vno strCaption)
      (setq pro (getvar "PRODUCT")
            vlt (substr (getvar "_VERNUM") 1 1)
            vno (substr (getvar "_VERNUM") 2)
            strCaption (vla-get-Caption (vlax-get-acad-object)); Thanks Matt
            newlen (vl-string-search " - [" strCaption)
            strCaption (substr strCaption 1 newlen)
      )
      (princ "\nvno = ")(princ vno)
      (princ "\nstrCaption = ")(princ strCaption)
      (princ "\n")(princ "\n")
      (cond
        ((= vlt "R")(princ(strcat pro " 13" vno)))
        ((= vlt "P")(princ(strcat pro " 14" vno)))
        ((= vlt "T")(princ(strcat pro " 2000" vno)))
        ((= vlt "U")(princ(strcat pro " 2000i" vno)))
        ((= vlt "K")(princ(strcat pro " 2002" vno)))
        ((= vlt "V")(princ(strcat strCaption " 2004" vno)))
        ((= vlt "N")(princ(strcat strCaption " 2005" vno)))
        ((= vlt "Z")(princ(strcat strCaption " 2006" vno)))
        ((= vlt "A")(princ(strcat strCaption " 2007" vno)))
        ((= vlt "B")(princ(strcat strCaption " 2008" vno)))
        ((= vlt "C")(princ(strcat strCaption " 2009" vno)))
        ((= vlt "D")(princ(strcat strCaption " 2010" vno)))
        ((= vlt "E")(princ(strcat strCaption " 2011" vno)))
        ((= vlt "F")(princ(strcat strCaption " 2012" vno)))
        ((= vlt "G")(princ(strcat strCaption " 2013" vno)))
        ((= vlt "I")(princ(strcat strCaption " 2014" vno)))
        ((= vlt "J")(princ(strcat strCaption " 2015" vno)))
        ((= vlt "M")(princ(strcat strCaption " 2016" vno)))
        (T(princ(strcat strCaption vno)))
      )
      (princ)
    )
    There are code snippets to make code work with different versions usually by checking system variables as visual lisp and commands have changed over the years.

  5. #5
    All AUGI, all the time
    Join Date
    2003-07
    Posts
    555
    Login to Give a bone
    0

    Default Re: autocad version

    And this for CIV3d apologise for not having authors name.

    Code:
    ; vercheck.lsp  version check for *aecc objects
    
    
    (defun ah:vercheck ( / vrsn appstr)
    (vl-load-com)
    
    (setq acApp (vlax-get-acad-object))
      (setq	C3D (strcat "HKEY_LOCAL_MACHINE\\"
    		    (if	vlax-user-product-key
    		      (vlax-user-product-key)
    		      (vlax-product-key)
    		    )
    	    )
    	C3D (vl-registry-read C3D "Release")
    	C3D (substr
    	      C3D
    	      1
    	      (vl-string-search "." C3D (+ (vl-string-search "." C3D) 1))
    	    )
      )
    (setq *AeccDoc*(vla-getinterfaceobject
    			(vlax-get-acad-object)
    			(strcat "AeccXUiLand.AeccApplication." C3D)
    			)
    )
    (princ)
    )
    Code:
    ;vercheck.lsp  version check for *aecc objects
    
    
    (defun ah:vercheck ( / vrsn appstr)
    (vl-load-com)
    
    (if ((lambda (vrsn)
            (cond
             ((vl-string-search "R17.2" vrsn) (setq appstr "6.0")) ;09
             ((vl-string-search "R18.0" vrsn) (setq appstr "7.0")) ;2010
             ((vl-string-search "R18.1" vrsn) (setq appstr "8.0")) ;2011
             ((vl-string-search "R18.2" vrsn) (setq appstr "9.0")) ;2012 
             ((vl-string-search "R19.0" vrsn) (setq appstr "10.0")) ;2013 
             ((vl-string-search "R19.1" vrsn)(setq appstr "10.3"));;2014
             ((vl-string-search "R20.0" vrsn)(setq appstr "10.4"));;2015
             ((vl-string-search "R20.1" vrsn)(setq appstr "10.5"));;2016     
             ((vl-string-search "R21.0" vrsn)(setq appstr "11.0"));;2017  
             ((vl-string-search "R22.0" vrsn)(setq appstr "12.0"));;2018   
             ((vl-string-search "R23.0" vrsn)(setq appstr "13.0"));;2019
             ((vl-string-search "R23.1" vrsn)(setq appstr "13.2"));;2020
             ((alert "This version of C3D not supported!"))
            )
           )
           (vlax-product-key)
          )                         ; end if condition progn is true
          (progn
            (cond (*AeccDoc*)
              ((setq *AeccDoc*
                (vlax-get
                  (cond (*AeccApp*)
                    ((setq *AeccApp*
                      (vla-getinterfaceobject
                         (cond (*Acad*)
                         ((setq *Acad* (vlax-get-acad-object)))
                         )
                         (strcat "AeccXUiLand.AeccApplication." appstr)
                      )
                     )
                    )
                  )
                  'ActiveDocument
                )
               )
              )
            ) ; end main cond
          ) ; end progn
    ) ; end if vsrn
    )

  6. #6
    Administrator rkmcswain's Avatar
    Join Date
    2004-09
    Location
    Earth
    Posts
    9,803
    Login to Give a bone
    0

    Default Re: autocad version

    R.K. McSwain | CAD Panacea |

Similar Threads

  1. version 1 vs. version 2
    By s.albunio in forum Impression - General
    Replies: 1
    Last Post: 2009-03-04, 05:11 PM
  2. problem opening 32 bit version with 64 bit version
    By Doug in forum Revit Architecture - General
    Replies: 1
    Last Post: 2009-01-09, 02:09 PM
  3. Standard fitting from previous version to latest version
    By ashah.200984 in forum AMEP General
    Replies: 1
    Last Post: 2008-12-18, 04:25 PM
  4. Replies: 6
    Last Post: 2007-03-02, 02:00 AM
  5. AutoCAD 2007 DWG version to 2000 DWG version - File size increases
    By darin.marsden in forum AutoCAD General
    Replies: 2
    Last Post: 2006-05-17, 07:29 AM

Posting Permissions

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