madcadder
2007-06-17, 07:26 PM
I have this series of code for the beginning of a routine:
(VL-LOAD-COM) ; loads ActiveX support if not already loaded
(SETQ |active-document| (vla-get-activedocument (vlax-get-acad-object)))
;;; Create list of original values for variables
(MAPCAR (FUNCTION
(LAMBDA (|variable-name|)
(SETQ |value| (CONS (CONS |variable-name| (GETVAR |variable-name|))
|value|
)
)
)
)
'("aunits" "attdia" "cecolor" "celtscale" "celtype" "celweight" "clayer" "cmdecho" "cmljust" "cmlscale" "cmlstyle" "dimstyle" "errno" "expert" "filedia" "filletrad" "hpang" "hpbound" "hpdouble" "hpname" "hpscale" "lunits" "luprec" "plinetype" "plinewid" "texteval" "textsize" "textstyle"
)
)
(vla-startundomark |active-document|)
Everything works correctly, or so it appears, but this was my output when retesting years later.
The list doesn't look right with all the dups. That wasn't the intent.
(VL-LOAD-COM) ; loads ActiveX support if not already loaded
(SETQ |active-document| (vla-get-activedocument (vlax-get-acad-object)))
;;; Create list of original values for variables
(MAPCAR (FUNCTION
(LAMBDA (|variable-name|)
(SETQ |value| (CONS (CONS |variable-name| (GETVAR |variable-name|))
|value|
)
)
)
)
'("aunits" "attdia" "cecolor" "celtscale" "celtype" "celweight" "clayer" "cmdecho" "cmljust" "cmlscale" "cmlstyle" "dimstyle" "errno" "expert" "filedia" "filletrad" "hpang" "hpbound" "hpdouble" "hpname" "hpscale" "lunits" "luprec" "plinetype" "plinewid" "texteval" "textsize" "textstyle"
)
)
(vla-startundomark |active-document|)
Everything works correctly, or so it appears, but this was my output when retesting years later.
The list doesn't look right with all the dups. That wasn't the intent.