Jump to content

code to find current cad version


wimal

Recommended Posts

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
)

Link to comment
Share on other sites

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
)

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...