Author Topic: Dimzin value  (Read 11109 times)

0 Members and 1 Guest are viewing this topic.

GDF

  • Water Moccasin
  • Posts: 2081
Dimzin value
« on: February 25, 2006, 04:02:05 PM »
All of my dimstyles have dimzin set to 3 for zero suppression. Every now and then I will start up AutoCAD and open up to a drawing that has the dimstyle with this setting and I will get the leading zero. I have fixed this by adding (setvar "dimzin" 3) in my startup.

So, what am I missing here? Has anyone experienced this problem before? I think it's just me, but why?

If I do the following:
(rtos (/ 12 (getvar "dimscale")) 4 6) I would get the leading zero before I added the setvar to my startup.

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

GDF

  • Water Moccasin
  • Posts: 2081
Re: Dimzin value
« Reply #1 on: February 25, 2006, 04:10:47 PM »
Da, I was some how getting a dimension override with a dimzin value of 1

Go figure. The dimstyle was not overrriden by me intentially.

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

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Dimzin value
« Reply #2 on: February 25, 2006, 05:08:52 PM »
Gary, fair chance it's some less well behaved old code.

I still have some old stuff that is horrid.

kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

dan19936

  • Guest
Re: Dimzin value
« Reply #3 on: February 28, 2006, 04:55:09 PM »
Gary, fair chance it's some less well behaved old code.

I still have some old stuff that is horrid.



to solve those mysteries, I set a reactor flag to alert when a sysvar changes. I've found object enablers changed dimscale & other variables for drawings with AEC dictionaries. Also I've got a debug echo option in my core utilities (such as changing/saving sysvars) and when in doubt I turn on the reactor flag & debug to find out what was running at the time

Dan

GDF

  • Water Moccasin
  • Posts: 2081
Re: Dimzin value
« Reply #4 on: February 28, 2006, 06:58:32 PM »
One of these days I will track it down.

Thanks
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: Dimzin value
« Reply #5 on: March 01, 2006, 10:08:05 AM »
dan
Those are some cool tools you got there. 8-)
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.

dan19936

  • Guest
Re: Dimzin value
« Reply #6 on: March 01, 2006, 06:52:58 PM »
dan
Those are some cool tools you got there. 8-)

Hope I included credit correctly, I'm just good at collecting...
propably some sub-functions missing, I know GETDWGVAR is needed from here www.caddzone.com/dwgvar.lsp

Dan

Code: [Select]
;|;=====================================================================
vlr-manager, vlr-family, vlr-object, vlr-object-p, vlr-syntax
Written by: Eric Schneider, Reno, NV
cadking@nospam.sbcglobal.net of course, remove "nospam"
10-11-01
With special thanks to:
R. Robert Bell
;;;=====================================================================
Anyone is welcome to use modify this program or hack it to bits as long
as Eric Schneider, or any other names aforementioned, are not held
responsible for anything whatsoever and shall not be the subject of
vulgar utterances. Just leave the credits in it. Deal? Cool!
|;;=====================================================================
 
;;;constructs and unloads reactors and ensures that reactors will not be loaded more than once
;;;syntax: (VLR-MANAGER 'reactor mode)
;;;usage: (VLR-MANAGER '(VLR-Command-Reactor nil '((:VLR-commandWillStart . TEST))) 1)
;;;arguments:
;;;c - quoted typical reactor construction syntax
;;;m - mode, integer 0-3, additive values of 1 and 2 (bits 0 and 1)
;;;m = 0 tests for the presence of a matching reactor
;;;m = 1 removes all matching reactor constructs
;;;m = 2 constructs "reactor"
;;;m = 3 does both of the above to prevent double loading the same reactor
;;;variables:
;;;l = list of matching reactor objects
;;;v = value to return
;;;return value: the VLR object if a reactor was created, T if reactor was removed, else nil
(defun vlr-manager (c m / l v)
  (setq l (vlr-object c))
  (if (and (= m 0) l)(setq v 'T))
  (if (= (logand m 1) 1)
    (progn
      (mapcar 'vlr-remove l)
      (if (and l (not (vlr-object c)))
        (setq v 'T)
      )
    )
  )
  (if (= (logand m 2) 2)
    (eval c)
    v
  )
)

;;;retrieves the VLR object(s) matching the quoted reactor construct
;;;regardless of vlr-data
;;;usage: (VLR-OBJECT '(VLR-Command-Reactor nil '((:VLR-commandWillStart . TEST))))
;;;arg: r = a quoted reactor construct
;;;returns a list of all matching VLR objects
(defun vlr-object (r)
  (vl-remove-if-not
    (function
      (lambda (x)
        (equal (reverse (vlr-reactions x))(eval (last r)))
      )
    )
    (cdar (vlr-reactors (read (strcat ":" (vl-symbol-name (car r))))))
  )
)

;;;tests if object is a VLR object
;;;usage: (VLR-OBJECT-P reactorObject)
;;;arg: r = symbol bound to a reactor object
;;;returns T if it is VLR object, else nil
(defun vlr-object-p (r)
  (wcmatch (vl-symbol-name (type r)) "VLR-*-Reactor")
)

;;;checks reactor family of a VLR object
;;;usage: (VLR-FAMILY reactorObject)
;;;arg: r = symbol bound to a reactor object
;;;returns family of VLR object
(defun vlr-family (r)
  (if (vlr-object-p r)
    (vlr-type (vlr-object r))
  )
)

;;;usage: (VLR-SYNTAX reactorObject)
;;;arg: r = symbol bound to a reactor object
;;;returns original reactor construction syntax from a reactor object
(defun vlr-syntax (r)
  (list
    (type r)
    (vlr-data r)
    (read (strcat "'" (vl-princ-to-string (reverse (vlr-reactions r)))))
  )
)


;;;constructs and unloads reactors and ensures that reactors will not be loaded more than once
;;;syntax: (VLR-MANAGER 'reactor mode)
;;;usage: (VLR-MANAGER '(VLR-Command-Reactor nil '((:VLR-commandWillStart . TEST))) 1)
;;;arguments:
;;;c - quoted typical reactor construction syntax
;;;m - mode, intiger 0-3, additive values of 1 and 2 (bits 0 and 1)
;;;m = 0 tests for the presence of a matching reactor
;;;m = 1 removes all matching reactor constructs
;;;m = 2 constructs "reactor" unless it already exists
;;;m = 3 does both of the above to prevent double loading the same reactor
;;;variables:
;;;l = list of matching reactor objects
;;;v = value to return
;;;return value: the VLR object if a reactor was created, T if reactor was removed, else nil


;;;============================================================================
;;; Reactor function that monitors functions and sysvars
;;;============================================================================
(defun c:xyzReactors ()
  (if xyzdebug (princ "\nRunning c:xyzReactors"))
  (vlr-manager
    '(vlr-sysvar-reactor
      nil
      '((:vlr-SysvarWillChange . XYZ_Reactor_SysarWillChange)
        (:vlr-SysvarChanged    . XYZ_Reactor_SysvarChanged)
       )
     )
    3
  )                                                                           ; construct reactor to call
  (vlr-manager
    '(vlr-Command-Reactor
      nil
      '((:vlr-CommandWillStart . XYZ_Reactor_CommandWillStart)
        (:vlr-CommandEnded     . XYZ_Reactor_CommandEnded)
       )
     )
    3
  )                                                                           ; construct reactor to call
  (princ)
) ;_ defun

;;;============================================================================
;;; Callback function
;;;============================================================================
(defun XYZ_Reactor_CommandWillStart (call callback / var)
  (setq var (strcase (car callback)))
  (if xyzdebug (princ (strcat "\nXYZ Command WillStart Reactor running: " var "\n")))
  (cond ((= (getenv "XYZ\\ReactorFlag") "0")
          (if xyzdebug (princ "\nNo reactors are to run"))
        )
        ((= var "CLOSE")
          (if xyz_dwglog (xyz_dwglog "Drawing_Close"))
        )
        ((= var "QSAVE")
          (if xyz_dwglog (xyz_dwglog "Qsave"))
        )
        ((wcmatch var "*AUTO*")
          (alert "autosave reactor")
        )
;;;        ((= var "LAYOUT_CONTROL")
;;;          (if xyzdebug (princ "\nLayout_control reactor is running"))
;;;        )
;;;        ((= var "PAGESETUP")
;;;   (if xyzdebug (princ "\nPagesetup reactor is running"))
;;;          (if (= "" (XYZ_GetActiveLayoutStyleSheet)) ;if no default style sheet
;;;     (XYZ_ConfigLayout) ;do XYZ standard configuration
;;;   )
;;;        )
;;;        ((= var "PLOT")
;;;   (if xyzdebug (princ (strcat "\nPlot reactor is running: "var )))
;;;        )
         (T (if xyzdebug (princ (strcat "\nXYZ_Reactor_CommandWillStart: " var))))
  ) ;_ cond
) ;_ defun

;;;============================================================================
;;; Callback function
;;;============================================================================
(defun XYZ_Reactor_CommandEnded (call callback / var)
  (setq var (strcase (car callback)))
  (if xyzdebug (princ (strcat "\nXYZ Command Ended Reactor running: " var "\n")))
  (cond ((= (getenv "XYZ\\ReactorFlag") "0")
          (if xyzdebug (princ "\nNo reactors are to run"))
        )
         (T (if xyzdebug (princ (strcat "\nXYZ_Reactor_CommandEnded: " var))))
  ) ;_ cond
) ;_ defun

;;;============================================================================
;;; Callback function two 'Leaving a space records
;;; dimscale, ltscale, and psltscale and attaches it
;;; as xdata to the layout
;;;============================================================================
(defun XYZ_Reactor_SysarWillChange (call success / var)
  (setq var (strcase (car success)))
  (cond ((= (getenv "XYZ\\ReactorFlag") "0")
          (if xyzdebug (princ "\nNo reactors are to run"))
        )
        ((= var "TILEMODE")
          (if xyzdebug (princ "\nChanging Tilemode"))
          ;; Save drawing scale of space in drawing
          ;; should have separate setting per layout defaulting to pspace default if none
          (setdwgvar (strcat "XYZ_DwgScale_"
                             (if (= 0 (getvar "tilemode"))
                               "Paper"
                               "Model"
                             )
                     ) ;_strcat
                     (if (= 0 (getvar "tilemode"))
                       1.0 ;use 1.0 for default paperspace (for now)
                       (getvar "dimscale")
                     ) ;_if
          )
        )
        ((= var "CVPORT")
          (if xyzdebug (princ (strcat "\nChanging CVPORT = " (itoa (getvar "cvport")))))
        )
  ) ;_ cond
) ;_ defun

;;;============================================================================
;;; Callback function two 'Entering a space reads xdata from
;;; the layout sets the dimscale, ltscale, and psltscale
;;;
;;; Also checks cvport system variable (not completed)
;;; for entering and leaving viewports
;;;============================================================================
(defun XYZ_Reactor_SysvarChanged (call success / t1 var)
  (setq var (strcase (car success)))
  (cond ((= (getenv "XYZ\\ReactorFlag") "0")
          (if xyzdebug (princ "\nNo reactors are to run"))
        )
        ((= var "DIMSCALE")
  (if xyzdebug (alert (strcat "\nDimscale changed to " (otos (getvar "dimscale")))))
)
        ((= var "TEXTSTYLE")
  (if xyzdebug (alert (strcat "\nTextstyle changed to " (getvar "textstyle"))))
)
        ((= var "LTSCALE")
  (if xyzdebug (alert (strcat "\nLTscale changed to " (otos (getvar "ltscale")))))
)
        ((= var "TILEMODE")
          (if xyzdebug (princ "\nChanging Tilemode"))
          ;; check to see if there is a saved drawing scale,
          (setq t1 (GETDWGVAR (strcat "XYZ_DwgScale_"
                                      (if (= 0 (getvar "tilemode"))
                                        "Paper"
                                        "Model"
                                      )
                              ) ;_strcat
                   ) ;_getdwgvar
          ) ;_setq
          (if (and t1 ;if there is a saved  scale
                   (or (/= t1 (getvar "ltscale")) ; and it doesn't match current
                       (/= t1 (getvar "dimscale"))
                   ) ;_or
              ) ;_and
            (progn ;change it
              (setvar "ltscale"  t1)
      (setvar "dimscale" t1)
              (princ (strcat "(LTSCALE & DIMSCALE set to "
                     (rtos (getvar "ltscale") 2) ") ")
              ) ;princ
    ) ;_progn
    (if xyzdebug (princ "\n  No dimscale change"))
          ) ;_if
        )
        ((= var "CVPORT")
          (if xyzdebug (princ (strcat "\nChanging CVPORT = " (itoa (getvar "cvport")))))
        )
        ((= var "PICKSTYLE")
          (if xyzdebug (princ (strcat "\nChanging PICKSTYLE = " (itoa (getvar "pickstyle")))))
        )
  ) ;_ cond
) ;_ defun


LE

  • Guest
Re: Dimzin value
« Reply #7 on: March 01, 2006, 06:59:21 PM »
Gary;

Look into "System Variable Control " on my downloads section at my site.... it might help you.

GDF

  • Water Moccasin
  • Posts: 2081
Re: Dimzin value
« Reply #8 on: March 02, 2006, 09:46:40 AM »
Thanks Dan I will look into it.

Wow Luis, now that is sweet. Can your routine be set up to check for a list of sysname to control?
(setq sysname "osmode") <- modiffy to a list?

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

LE

  • Guest
Re: Dimzin value
« Reply #9 on: March 02, 2006, 12:19:27 PM »
Wow Luis, now that is sweet. Can your routine be set up to check for a list of sysname to control?
(setq sysname "osmode") <- modiffy to a list?

Hi Gary;

Test the following code, it will use a list now, it is somehow similar of what we can do using the *error* mechanism, but here, we simple need to define a list at loading time into our drawing of what system variables we want to keep their original values and forgot inside our lisp routines to have an error handler, to reset their values... I think it works.

Hope that will help, have fun.

Code: [Select]
;; free routine by www.geometricad.com

(vl-load-com)

;; current document
(if (not this_dwg)
  (setq this_dwg
(vla-get-activedocument
   (vlax-get-acad-object))))

;; setup the list of system variable names to control
(setq control_sysvar_lst (list "cmdecho" "osmode"))

;; save the current values inside a list
(if (not current_sysvar_values_lst)
  (foreach
sysname
control_sysvar_lst
    (setq current_sysvar_values_lst
   (cons (cons sysname (vla-getvariable this_dwg sysname))
current_sysvar_values_lst))))

;; callback for the lispended event
(defun lispended  (reactor params)
  ;; go over the list of dot-pair's and
  ;; set the value to our controled sysvar's
  (foreach
dotpair
current_sysvar_values_lst
    (vla-setvariable this_dwg (car dotpair) (cdr dotpair))))

;; callback for the lispcancelled event
(defun lispcancelled  (reactor params)
  ;; go over the list of dot-pair's and
  ;; set the value to our controled sysvar's
  (foreach
dotpair
current_sysvar_values_lst
    (vla-setvariable this_dwg (car dotpair) (cdr dotpair))))

;; make the reactor once
(if (not sysvar_val_ctrl_reactor)
  (setq sysvar_val_ctrl_reactor
(vlr-lisp-reactor
   "sysvar value control"
   '((:vlr-lispended . lispended)
     (:vlr-lispcancelled . lispcancelled)))))

;; run some tests
(defun C:TEST1 (/ pt)
  (setvar "osmode" 32)
  (setvar "cmdecho" 0)
  (if (setq pt (getpoint "\nSelect intersection: "))
    (command "_.point" pt))
  (princ))

(defun C:TEST2 (/ pt)
  (setvar "osmode" 1)
  (setvar "cmdecho" 0)
  (if (setq pt (getpoint "\nSelect endpoint: "))
    (command "_.point" pt))
  (princ))

(princ)
« Last Edit: March 02, 2006, 01:39:34 PM by LE »

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Dimzin value
« Reply #10 on: March 02, 2006, 01:18:24 PM »
Hi Luis,

In your test examples, should you be setting the Global variable  current_sysvar_values_lst ?

You seem to be setting it at the loading of your <library> file only.
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

LE

  • Guest
Re: Dimzin value
« Reply #11 on: March 02, 2006, 01:21:19 PM »
Hi Kerry;

Per drawing session.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Dimzin value
« Reply #12 on: March 02, 2006, 01:23:17 PM »
so what happens if I use a lisp to change any of those values. when my lisp is finished,your reactor will change them back. Yes ?
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

LE

  • Guest
Re: Dimzin value
« Reply #13 on: March 02, 2006, 01:24:40 PM »
as far on my tests here yes... is not happening?

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Dimzin value
« Reply #14 on: March 02, 2006, 01:26:12 PM »
If I change the value in MY lisp, it's because I want it changed !  I wouldn't like YOUR reactor taking over.
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Jeff_M

  • King Gator
  • Posts: 4099
  • C3D user & customizer
Re: Dimzin value
« Reply #15 on: March 02, 2006, 01:28:43 PM »
ACKKKK! Luis, what the devil is that hideous thing in you Avatar?!? I haven't seen one of them critters in nearly 20 years! :lol:

LE

  • Guest
Re: Dimzin value
« Reply #16 on: March 02, 2006, 01:30:48 PM »
I normally use it when I want to keep certain system value... on one by one basis...

I am offering now to Gary the possibility of having a list...

For other lisps that are required to control their own values... I would probably use the name of the lisp command as filter... but I did not went in this update all the way.

 :-)

Thanks.

LE

  • Guest
Re: Dimzin value
« Reply #17 on: March 02, 2006, 01:33:01 PM »
ACKKKK! Luis, what the devil is that hideous thing in you Avatar?!? I haven't seen one of them critters in nearly 20 years! :lol:

I know... I know... we still here do some stuff by hand-drafting.... stone age, mostly Chuck... [my boss]    :kewl:

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Dimzin value
« Reply #18 on: March 02, 2006, 01:34:44 PM »
Luis, I understand ..

but what happens if 10 software developers use the same method, each with their own values and reactors ?
Who wins the race to be last reactor fired ?
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

LE

  • Guest
Re: Dimzin value
« Reply #19 on: March 02, 2006, 01:41:12 PM »
Kerry;

The idea of that code is directly to in-house routines, when you simple do not want to care about certain error handler control... simple an alternative.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Dimzin value
« Reply #20 on: March 02, 2006, 01:58:35 PM »
Kerry;

The idea of that code is directly to in-house routines, when you simple do not want to care about certain error handler control... simple an alternative.

I understand Luis, I will be quiet.
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

LE

  • Guest
Re: Dimzin value
« Reply #21 on: March 02, 2006, 02:07:04 PM »
:-D

Here is what I would try to implement... in order to let other routines to work... not a state of the art solution, but for playing purposes and fun... it is OK.

Code: [Select]
;; free routine by www.geometricad.com

(vl-load-com)

;; current document
(if (not this_dwg)
  (setq this_dwg
(vla-get-activedocument
   (vlax-get-acad-object))))

;; setup the list of system variable names to control
(setq control_sysvar_lst (list "cmdecho" "osmode"))

;; save the current values inside a list
(if (not current_sysvar_values_lst)
  (foreach
sysname
control_sysvar_lst
    (setq current_sysvar_values_lst
   (cons (cons sysname (vla-getvariable this_dwg sysname))
current_sysvar_values_lst))))

;; set up a list of lisps we do not want to control
(setq lst_of_lisps (list "(C:TEST2)" "(C:SUPERCMD)"))

;; callback for the lispended event
(defun lispended  (reactor params)
  ;; go over the list of dot-pair's and
  ;; set the value to our controled sysvar's
  (if flag
    (foreach
   dotpair
  current_sysvar_values_lst
      (vla-setvariable this_dwg (car dotpair) (cdr dotpair)))))

;; callback for the lispcancelled event
(defun lispcancelled  (reactor params)
  ;; go over the list of dot-pair's and
  ;; set the value to our controled sysvar's
  (if flag
    (foreach
   dotpair
  current_sysvar_values_lst
      (vla-setvariable this_dwg (car dotpair) (cdr dotpair)))))

(defun lispwillstart  (reactor params)
  (setq flag (if (member (car params) lst_of_lisps)
       nil
       t)))

;; make the reactor once
(if (not sysvar_val_ctrl_reactor)
  (setq sysvar_val_ctrl_reactor
(vlr-lisp-reactor
   "sysvar value control"
   '((:vlr-lispwillstart . lispwillstart)
     (:vlr-lispended . lispended)
     (:vlr-lispcancelled . lispcancelled)))))

;; run some tests
(defun C:TEST1 (/ pt)
  (setvar "osmode" 32)
  (setvar "cmdecho" 0)
  (if (setq pt (getpoint "\nSelect intersection: "))
    (command "_.point" pt))
  (princ))

(defun C:TEST2 (/ pt)
  (setvar "osmode" 1)
  (setvar "cmdecho" 0)
  (if (setq pt (getpoint "\nSelect endpoint: "))
    (command "_.point" pt))
  (princ))

(princ)

GDF

  • Water Moccasin
  • Posts: 2081
Re: Dimzin value
« Reply #22 on: March 02, 2006, 02:24:27 PM »
Luis

Thanks,I will play with it.

This is what I'm current using to restore my settings, by Jurg Menzi. I quess I could add in DIMZIN.
Code: [Select]
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Undo Mark Function ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun ARCH:UBEG  ()
  (setvar "CMDECHO" 0)
  (setq UNDO_BEGIN T)
  (command "UNDO" "BEGIN")
  (setvar "CMDECHO" 1)
  (princ))
(defun ARCH:UEND  ()
  (setvar "CMDECHO" 0)
  (setq UNDO_BEGIN ())
  (command "UNDO" "END")
  (setvar "CMDECHO" 1)
  (princ))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Error Function ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun ARCH:ERROR  (Msg) 
  (setvar "cmdecho" 0)
  (setq ARCH#DIAP '(-1 -1))
  ;;(command "_ucs" "");dont use
  (setvar "cmdecho" 1)
  (if (and Msg (not (eq Msg "quit / exit abort")))
    ;;(princ Msg)
    (princ "\n\n*** ///////// Program  CANCELLED ///////// ***\n"))
  (ARCH:F_R-VAR)
  (princ))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Clean Function ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;Jurg Menzi
;;;MENZI ENGINEERING GmbH, Switzerland
;;;http://www.menziengineering.ch
(defun ARCH:F_CLEAN  (Lst)
  (or Me:Aco (setq Me:Aco (vlax-get-acad-object)))
  (or Me:Acd (setq Me:Acd (vla-get-ActiveDocument Me:Aco)))
  (vla-StartUndoMark Me:Acd)
  (setq Me:Oer  *Error*
        *Error* ARCH:ERROR)
  (mapcar '(lambda (l)
             (if (not (assoc l Me:Var))
               (setq Me:Var (append Me:Var (list (cons l (getvar l)))))))
          Lst)
  (princ))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; F_S-VAR Function ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun ARCH:F_S-VAR  ()
  (ARCH:F_CLEAN
    '("APERTURE" "ATTDIA" "ATTREQ" "BLIPMODE" "CECOLOR" "CLAYER" "CELTYPE" "CMDECHO"
      "DIMSCALE" "DRAGMODE" "EXPERT" "FILEDIA" "FILLETRAD" "GRIDMODE" "HIGHLIGHT" "LUNITS"
      "MENUECHO" "MIRRTEXT" "OFFSETDIST" "ORTHOMODE" "OSMODE" "PICKBOX" "PLINEWID" "REGENMODE"
      "SNAPMODE" "SNAPUNIT" "SNAPBASE" "SNAPANG" "SNAPSTYL" "TEXTEVAL" "TEXTSTYLE")))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; F_R-VAR Function ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;Jurg Menzi
;;;MENZI ENGINEERING GmbH, Switzerland
;;;http://www.menziengineering.ch
(defun ARCH:F_R-VAR  ()
  (if Me:Var
    (mapcar '(lambda (l) (setvar (car l) (cdr l))) Me:Var))
  (setq *Error* Me:Oer
        Me:Oer  nil
        Me:Var  nil)
  (vla-EndUndoMark Me:Acd)
  (princ))

I may go back to hand drafting, this AutCAD stuff makes my head hurt.
Dimzin over and out.

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

LE

  • Guest
Re: Dimzin value
« Reply #23 on: March 02, 2006, 02:39:03 PM »
Luis

Thanks,I will play with it.

This is what I'm current using to restore my settings, by Jurg Menzi. I quess I could add in DIMZIN.
Code: [Select]

Yes, you can use the *error* handler... as normal.... the other enchilada that I posted using reactors.. it is just another approach.... with some cheese, lettuce, onions, red-salsa, and some yellow-hot peppers on the grill, pealed and marinated on lemon juice and salt...  :ugly:

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Dimzin value
« Reply #24 on: March 02, 2006, 05:49:17 PM »
OK, you talked me into it. I'm taking an early supper break. :roll:
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.

LE

  • Guest
Re: Dimzin value
« Reply #25 on: March 02, 2006, 05:51:24 PM »
 :kewl: