Author Topic: Differentiating Between CAD Programs  (Read 1416 times)

0 Members and 1 Guest are viewing this topic.

GDF

  • Water Moccasin
  • Posts: 2081
Differentiating Between CAD Programs
« 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))
)




Why is there never enough time to do it right, but always enough time to do it over?
BricsCAD 2020x64 Windows 10x64

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Differentiating Between CAD Programs
« Reply #1 on: March 03, 2020, 07:23:21 PM »
I haven't updated this in a very long time but hee is the begining of my set variables routine.
Code: [Select]
(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"))
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

GDF

  • Water Moccasin
  • Posts: 2081
Re: Differentiating Between CAD Programs
« Reply #2 on: March 03, 2020, 10:14:54 PM »
Alan, this is what I currently use:

Code: [Select]
(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))
Why is there never enough time to do it right, but always enough time to do it over?
BricsCAD 2020x64 Windows 10x64