TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: GDF on March 03, 2020, 02:17:29 PM
-
As BrisCAD becomes more popular, how can we control the difference in our lisp routines; SETVAR, SETENV, etc?
For example:
(cond
((= "BRICSCAD" (strcase (getvar 'product)))(DO THIS))
((= "AUTOCAD" (strcase (getvar 'product)))(DO THAT))
)
-
I haven't updated this in a very long time but hee is the begining of my set variables routine.
(defun ACADset_vars (/ var)
;;======================================================
(princ "\nBEGINNING OF SYSTEM VARIABLE SETTING ******\n")
;;======================================================
(setq CADversion (getvar 'acadver)
Brics (wcmatch (getvar 'acadver) "*BricsCAD*" ))
(COND
( (and (not Brics) (>= (substr (getvar 'acadver) 1 4) "16.2"))
(setvar 'fullplotpath 0) ; Corrects the file name in PDFcreator
)
( Brics (PRINT (getvar 'acadver)))
(princ "\n <<Ignored AutoCAD 2006 Variable List>>")
)
(princ)
; (and Brics (setvar 'SHORTCUTMENU 2))
;; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
;; ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
(if Brics
(progn
(setvar 'SHOWFULLPATHINTITLE 0)
)
)
(if (or Brics (>= (substr (getvar 'acadver) 1 4) "16.1"))
-
Alan, this is what I currently use:
(defun C:ARCHSetVars()
(cond ((= "AUTOCAD" (strcase (getvar 'product)))
(ARCH:LOAD (strcat ARCH#SUPF "ARCH_SetVarsAutoCAD.lsp"))
)
((= "BRICSCAD" (strcase (getvar 'product)))
(ARCH:LOAD (strcat ARCH#SUPF "ARCH_SetVarsBricsCAD.lsp"))
)
)
(princ))