Message 1 of 5
Lisp adjustments
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I found this fine lsp that allows me to annotate elevation and insert a point at random pick points.
I have been using it for a couple of weeks now and I noticed a couple of things that I would like to modify.
First, how can I make this routine ask me, at the beginning, for the text height I want to use ?
Second, when I annotate random pick points, a point and an annotation is added for the elevation, but the annotation is only "###" until I exit the command. What is the problem?
Finally, I know there is a way to use a comma as decimal separator (vl-string-subst "," ".") but I don't know where to insert it in the code.
Thank you for taking the time to help me !
(defun C:zlb (/ acsp adoc mtx pt str util) (vl-load-com) (or adoc (setq adoc (vla-get-activedocument (vlax-get-acad-object) ) ) ) (if (and (= (getvar "tilemode") 0) (= (getvar "cvport") 1) ) (setq acsp (vla-get-paperspace adoc)) (setq acsp (vla-get-modelspace adoc)) ) (or util (setq util (vla-get-utility adoc) ) ) (setvar "fieldeval" 31) ;to update field in all cases (setvar "fielddisplay" 0) ;without grey mask (setvar "pdsize" 0.1) ;point size, change by suit (setvar "pdmode" 34) ;point mode, change by suit (while (or (vla-initializeuserinput util 0 " ") (not (vl-catch-all-error-p (setq pt (vl-catch-all-apply (function (lambda () (vla-getpoint util nil "\nSpecify point (Or press Enter to exit) >>" ) ) ) ) ) ) ) ) (if pt (progn (vla-addpoint acsp pt) (setq mtx (vla-addmtext acsp pt 0.0 "###")) ;any string ;; architectural units : ;;; (setq str ;;; (strcat ;;; "%<\\AcObjProp Object(%<\\_ObjId " ;;; (itoa ;;; (vla-get-objectid ;;; mtx ;;; ) ;;; ) ;;; ">%).InsertionPoint \\f \"%lu4%pt4\">%" ;;; ) ;;; ) ;; decimal units : (setq str (strcat "%<\\AcObjProp Object(%<\\_ObjId " (itoa (vla-get-objectid mtx ) ) ">%).InsertionPoint \\f \"%lu2%pt4\">%" ) ) (vla-put-textstring mtx str) (vla-update mtx) ) ) ) (vla-regen adoc acactiveviewport) (vl-catch-all-apply (function (lambda () (vlax-release-object mtx) ) ) ) (princ) ) (prompt "\n") (prompt "\n\t###\tType ZLB to run point labeling\t###\n")