Detecting AutoCAD Flavors with vlax-product-key

Are you working with multiple flavors of AutoCAD? Do you want to perform different tasks, set different variables, load different routines based on which application is currently running? Its really quite easy with a little visual lisp and a short conditional. Did you know about the built in function >vlax-product-key ? This function returns the product and language key pair from the registry by querying the active profile. The following example was copied from my acad.lsp file so that it performs certain functions for particular products only on application launch.

I support Architectural Desktop, Land Development Desktop, and Building Systems products. I have been unable to find any documentation for other products, so if you happen to run another product not listed, please comment and include the pair found using vlax-product-key

;;; Get Product Key to detect Product Name and Type

(setq tmpProd (vlax-product-key))

(princ)

;;; Do something depending on which product is chosen

(if (/= (vl-string-search “308:409” tmpProd) nil)

(progn

(setq curProd “LDT2005”)

;;; Do something unique for Land Development Desktop Here

(princ)

);progn T

(princ)

)

(if (/= (vl-string-search “306:409” tmpProd) nil)

(progn
This happens because the money is not in the product but most Kamagra users often end generic cialis without prescription up getting ill or nauseated. There are a number of online stores that are online generic viagra on the first two pages. Explained in simple way, Kamagra enhances relaxes penile muscles, dilates blood vessels and creates enough room purchasing viagra in canada in the arteries to supply plentiful blood towards the male organ. It would often consist of fear as well as, the remake solely summarizes the early events, displaying fast flashes and clips of the occasions that transpired. order generic cialis
(setq curProd “ABS2005”)

;;; Do something unique for Building Systems Here

(princ)

);progn T

(princ)

)

(if (/= (vl-string-search “304:409” tmpProd) nil)

(progn

(setq curProd “ADT2005”)

;;; Do something unique for Architectural Desktop Here

(princ)

);progn T

(princ)

)

(princ)

I chose to set variables in the example above because the variable will be used in other functions as well. It is really quite simple once you know the pairs. Hopefully we can generate the complete list with a little participation.

One thought on “Detecting AutoCAD Flavors with vlax-product-key

  • January 10, 2005 at 19:16
    Permalink

    Having done this ourselves in the past, here are some more numbers for you.

    Autocad 2004 English: 201:409
    ADT 2004 English: 204:409
    MDT 2004 English: 203:409
    Mechanical 2004 English: 205:409
    Building Systems 2004 English: 206:409
    Map 2004 English: ACAD-202:409
    LDDT 2004 English: 208:409
    Civil Design 2004 English: Same as LDDT
    Survey 2004 English: Same as LDDT

Leave a Reply