now when I'm trying to load it I have
error: extra right paren on input
I think I know where is a problem as I was trying to do some changes to original code- please see below in red
- (defun c:a2f (/ *error* Stringify ENT OBJ PT TMP TOBJ TYP UFLAG) ;; Lee Mac ~ 13.01.10 (vl-load-com) (defun *error* (msg) (and uFlag (vla-EndUndoMark *doc*)) (or (wcmatch (strcase msg) "*BREAK,*CANCEL*,*EXIT*") (princ (strcat "\n** Error: " msg " **"))) (princ)) (defun Stringify (x / typ) (cond ( (eq 'REAL (setq typ (type x))) (rtos x)) ( (eq 'INT typ) (itoa x)) ( (eq 'STR typ) x) (t (vl-princ-to-string x)))) (setq *doc* (cond (*doc*) ((vla-get-ActiveDocument (vlax-get-acad-object)))) *spc* (cond (*spc*) ((if (zerop (vla-get-activespace *doc*)) (if (eq (vla-get-mspace *doc*) :vlax-true) (vla-get-modelspace *doc*) (vla-get-paperspace *doc*)) (vla-get-modelspace *doc*))))) (setq *a2f_Uni 2)[b][color=Red])[/color][/b] (or *a2f_Pre (setq *a2f_Pre 0)) (or *a2f_Con (setq *a2f_Con 1.)) (or *a2f_Hgt (setq *a2f_Hgt (getvar 'TEXTSIZE))) (setq *a2f_Rot 0.)[b][color=Red])[/color][/b] (or *a2f_Suf (setq *a2f_Suf "m2")) (mapcar (function set) '(*a2f_Pre *a2f_Con *a2f_Hgt *a2f_Suf) (mapcar (function (lambda (ini foo msg x) (and ini (initget ini)) (cond ((and (setq tmp ((eval foo) (strcat "\n" msg " : "))) (/= "" tmp)) tmp) (x)))) (list 4 6 6 nil) '(GetInt GetReal GetDist GetString) '("Specify Precision" "Specify Conversion Factor" "Specify Text Height" "Specify Suffix") (list *a2f_Pre *a2f_Con *a2f_Hgt *a2f_Suf))) (while (progn (setq ent (car (entsel "\n>> Pick Hatch [And don't you dare pick anything else] >>"))) (cond ( (eq 'ENAME (type ent)) (if (and (eq "AcDbHatch" (vla-get-ObjectName (setq obj (vlax-ename->vla-object ent)))) (vlax-property-available-p obj 'Area)) (if (setq pt (getpoint "\nPick Point for Field: ")) (progn (setq uFlag (not (vla-StartUndoMark *doc*))) (setq tObj (vla-AddMText *spc* (vlax-3D-point pt) 0.0 (strcat "%%"))) (mapcar (function (lambda (property value) (vlax-put-property tObj property value))) '(Height Rotation Layer Color) (list *a2f_Hgt *a2f_Rot (vlax-get-property obj 'Layer) (vlax-get-property obj 'Color))) (setq uFlag (vla-EndUndoMark *doc*)) t) ;; repeat ) (princ "\n** Invalid Object Selected **")))))) (princ))
when I removed it- is working great
thanks for all your help |