- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I have this lisp that I've created but was wondering if someone could look it over and give me some feedback.
I would like to move away from using (command "") in side of it but I'm am just now picking up AutoLisp and I figure your feedback would help me learn ActiveX.
Basically what this lisp does is checks the drawing for color based pen set or style based, and then creates a layer with all of its properties. Once created it creates a linear dimension. After all is done it reverts back to previous layers and settings.
It also has an error handler in there that I think is cumbersome.
Not to mention that I can't seem to be able to suppress the "undo" "m" part of it.
So if anyone is willing to give me feedback or help me convert anything to ActiveX, I would really appreciate your time.
Thanks!
(defun C:CODLinear (/ CurCMDEcho curNOMUTT CurLay CurPSM)
(command "undo" "m")
(setq CurCMDEcho (getvar "CMDECHO"))
(setq CurNOMUTT (getvar "NOMUTT"))
(setq CurPSM (getvar "PSTYLEMODE"))
(setvar "CMDECHO" 0)
(setvar "NOMUTT" 1)
(command "undo" "m")
(defun *error* ( msg )
(setvar "CMDECHO" 0)
(if (not (member msg '("Function cancelled" "quit / exit abort")))
(princ (strcat "\nError: " msg))
)
(progn
(command-s "undo" "b")
(setvar "CMDECHO" CurCMDEcho)
(setvar "NOMUTT" CurNOMUTT)
)
(princ)
)
(progn
(if (= CurPSM 1)
(progn
(setq CurLay (getvar "clayer"))
(command)
(command "-LAYER" "M" "P-DIM-COD CENTER" "C" "2" "" "")
)
(progn
(setq CurLay (getvar "clayer"))
(command)
(command "-LAYER" "M" "P-DIM-COD CENTER" "C" "2" "" "PS" "2 - Very Thin" "" "")
)
)
(setvar "CMDECHO" 1)
(command "_dimlinear" (while (= 1 (getvar "cmdactive")) (command pause)))
(setvar "CMDECHO" 0)
(setvar "clayer" CurLay)
)
(setvar "CMDECHO" CurCMDEcho)
(setvar "NOMUTT" CurNOMUTT)
(princ)
)
Applications Expert - Infrastructure Solutions Division
IMAGINiT Technologies
Solved! Go to Solution.