Jump to content
wimal

code to find current cad version

Recommended Posts

wimal

Is there a code to find out current cad version or identification code ?

Share this post


Link to post
Share on other sites
ReMark

I'm pretty sure that question has been asked and answered here (possibly this year too). Try a search.

Share this post


Link to post
Share on other sites
GP_

(getvar 'acadver)

(atoi (substr (ver) 13))

Share this post


Link to post
Share on other sites
BlackBox

Depends on what you're attempting to identify; I've also used:

 

(vl-load-com)

(if vlax-user-product-key                                               ; If 2013+
 (vlax-user-product-key)                                               ; Use new function
 (vlax-product-key)                                                    ; Use legacy function
)

Share this post


Link to post
Share on other sites
BlackBox

... And another one (read-only for LISP, write-enabled for .NET API):

 

(vl-load-com)

(vla-get-caption (vlax-get-acad-object))

Share this post


Link to post
Share on other sites
BIGAL

Some more examples

 

;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")) ;10
        ((vl-string-search "R18.1" vrsn) (setq appstr "8.0")) ;11
        ((vl-string-search "R18.2" vrsn) (setq appstr "9.0")) ;12 ?
        ((vl-string-search "R19.0" vrsn) (setq appstr "10.0")) ;13 
        ((vl-string-search "R19.1" vrsn)(setq appstr "11.0"));;2014
        ((vl-string-search "R20.0" vrsn)(setq appstr "12.0"));;2015
        ((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
)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×