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
(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.