lisp file help, add text to di
I want to take some existing code I found over on another site and change it to add user input.I have added a getstring line but I don't know how to get the program to evaluate that later when needed.So I have a setq ndimtext line, and later I need it to use that setq string in the setq NewDimValue line.Hopefully that makes sense.; original code from Mike Perry, AUGI NG(defun c:DimAddText (/ DimObject ndimtext NewDimValue) (setq ndimtext (getstring "Enter text to add to dim: "))(princ "\nSelect Dimension to add \(REF.\) to: ") (setq DimObject (ssget '((0 . "DIMENSION")))) (if (not (eq DimObject nil))(progn(setq NewDimValue "\\X\( ndimtext \)")(command "._DimEdit" "_N" NewDimValue DimObject "")) ) (princ)) Perhaps:
; original code from Mike Perry, AUGI NG(defun c:DimAddText(/ DimObject ndimtext NewDimValue) (vl-load-com) (setq ndimtext (getstring t "\nEnter text to add to dim: ")) (princ "\nSelect Dimension to add \(REF.\) to: ") (if (setq DimObject (ssget '((0 . "DIMENSION")))) (foreach Obj(mapcar 'vlax-ename->vla-object (vl-remove-if 'listp (mapcar 'cadr (ssnamex DimObject)))) (vla-put-TextOverride Obj (strcat "\\X" ndimtext))) (princ "\n No Dimensions Selected ")) (princ)) LeeMac,
Thanks, that works great.
rkent No probs rkent - if you need anything about the code explained, just ask
页:
[1]