Michael83 Posted October 5, 2010 Posted October 5, 2010 So I'm posting this after reading through 14 pages of posts on "leader" and as well as numerous other sites..I've learned and found a few cool things but nothing on what I was hoping for..Basically, our company likes to uses a closed, spline, no limit points, any angle constraints, 6" arrow, on "str-txt" layer, center justification, with middle of multi line text on both sides of text. Any suggestions at all on drawing a single entity leader that posts the predefined mtext or text next to it. Basically, actually precisely an mleader w/ the auto text insertion..We have maybe 15 very frequently used header/beams text blocks we use to drag and drop to a qleader we drew and it just seems like a lisp could make the process so much more productive, less repetative..and less sloppy. If I missed a any valuable post, PLEASE let me know.. On my quest I've come across a few lisps but I think their for an auto configuration of the qleader settings?? (below) though would probably need to call from lisp I also ran across the dynamic intelligent leader which was very cool, and the attached lisp that I loved..by Ken Jolly. It draws a curved leader with pop up box of predefined text..Good way to save tool palette space! Its the closest thing I found to auto text. Thanks again for any help! ;;; qlset.lsp - example initialization of QLEADER settings ;;; Frank Whaley, Autodesk ;;; ;;; Two functions are included in this file: ;;; ;;; (acet-ql-Set) ;;; Returns an association list containing the current QLEADER settings from the ;;; Named Object Dictionary. ;;; ;;; (acet-ql-get <alist>) ;;; Sets the specified values for QLEADER settings from the given association ;;; list. ;;; Returns an association list containing the new values. ;;; ;;; These functions can be used to examine the current QLEADER settings, or to ;;; initialize the setting before using the QLEADER command. ;;; For example, to use splined leaders and framed text: ;;; ;;; (acet-ql-set '((65 . 1)(72 . 1))) ;;; ;;; Both functions use the following group codes to identify QLEADER settings: ;;; ;;; 3: user arrowhead block name (default="") ;;; 40: default text width (default=0.0) ;;; 60: annotation type (default=0) ;;; 0=MText ;;; 1=copy object ;;; 2=Tolerance ;;; 3=block ;;; 4=none ;;; 61: annotation reuse (default=0) ;;; 0=none ;;; 1=reuse next ;;; 62: left attachment point (default=1) ;;; 63: right attachment point (default=3) ;;; 0=Top of top line ;;; 1=Middle of top line ;;; 2=Middle of multiline text ;;; 3=Middle of bottom line ;;; 4=Bottom of bottom line ;;; 64: underline bottom line (default=0) ;;; 65: use splined leader line (default=0) ;;; 66: no limit on points (default=0) ;;; 67: maximum number of points (default=3) ;;; 68: prompt for MText width (word wrap) (default=1) ;;; 69: always left justify (default=0) ;;; 70: allowed angle, first segment (default=0) ;;; 71: allowed angle, second segment (default=0) ;;; 0=Any angle ;;; 1=Horizontal ;;; 2=90deg ;;; 3=45deg ;;; 4=30deg ;;; 5=15deg ;;; 72: frame text (default=0) ;;; 170: active tab (default=0) ;;; 0=Annotation ;;; 1=Leader Line & Arrow ;;; 2=Attachment ;;; 340: object ID for annotation reuse ;;; ;;; |; acad-push-dbmod (defun acet-ql-get (/ xr cod itm reply) (if (setq xr (dictsearch (namedobjdict) "AcadDim")) (progn (foreach cod '(3 40 60 61 62 63 64 65 66 67 68 69 70 71 72 170 340) (if (setq itm (assoc cod xr)) (setq reply (append reply (list itm))))) reply) '((3 . "none") (40 . 0.0) (60 . 0) (61 . 1) (62 . 1) (63 . 3) (64 . 0) (65 . 0) (66 . 0) (67 . 3) (68 . 1) (69 . 0) (70 . 0) (71 . 0) (72 . 0) (170 . 0)))) (defun acet-ql-set (arg / cur prm) ;; fetch current (setq cur (acet-ql-get)) ;; override per argument (while arg (setq prm (car arg) arg (cdr arg) cur (subst prm (assoc (car prm) cur) cur)) ;; handle DIMLDRBLK (if (= 3 (car prm)) (setvar "DIMLDRBLK" (cdr prm)))) ;; put back (dictremove (namedobjdict) "AcadDim") (setq cur (append '((0 . "XRECORD") (100 . "AcDbXrecord") (90 . 990106)) cur)) (dictadd (namedobjdict) "AcadDim" (entmakex cur)) (acet-ql-get)) ;Example Usage (acet-ql-set '((3 . "_Open30") (40 . 0.0) (60 . 4) ; No Annotation (61 . 0) ; No re-use (62 . 1) (63 . 3) (64 . 0) (65 . 0) ; Not splined (66 . 0) (67 . 3) ; Three point Leader (68 . 0) ; No MT width prompt (69 . 0) (70 . 3) ; 45deg restriction (71 . 1) ; Horizontal (72 . 0) (170 . 0))) (princ) (defun test (/) (dictremove (namedobjdict) "ACADDIM") (entmod (append (entget (namedobjdict)) (list (cons 3 "ACADDIM") (cons 350 (entmakex '((0 . "XRECORD") (100 . "AcDbXrecord") (280 . 1) (90 . 990106) (3 . "") (60 . 3) (61 . 0) (62 . 1) (63 . 3) (64 . 0) (65 . 0) (66 . 1) (67 . 3) (68 . 1) (69 . 0) (70 . 3) ;45 (71 . 3) ;45 (72 . 0) (40 . 0.0) (170 . 0) ) ) ) ) ) ) ) (defun c:scaleleader () (setq scale (getreal "Input current scale : ")) (setvar "osmode" 0) ; osnap off (setvar "DIMCLRE" ;Color (setvar "DIMCLRD" ;Color (setvar "DIMCLRT" ;Color (setvar "DIMZIN" 0) ;Trailing (command "STYLE" "2D" "vnsimple" "0" "0.9" "0" "N" "N" "N") (setvar "DIMEXE" (* 0.75 scale)) ;Extension above line (setvar "DIMEXO" (* 0.5 scale)) ;Feature offset (setvar "DIMASZ" (* 1 scale)) ;Arrow size (setvar "DIMBLK" ".") (setvar "DIMBLK2" ".") (setvar "DIMLDRBLK" ".") (setvar "DIMTSZ" 0) ;= 0 Draws arrowheads ;(setvar "DIMTSZ" (* 0.75 scale)) ;= 0 Draws arrowheads ; >0 Draws oblique strokes instead of arrowheads ;(setvar "DIMTSZ" (* 0.5 scale)) ;Tick size 0.7 (setvar "DIMTXT" (* 2.0 scale)) ;Text height 2.5 (setvar "DIMTAD" 1) ;Verical (defauft) (setvar "DIMTIH" 0) ;Horizontal (setvar "DIMTOH" 0) ;Horizontal (setvar "DIMTIX" 1) ;Force text inside (setvar "DIMSOXD" 0) ;Force text inside (setvar "DIMDEC" 2) ; (setvar "DIMSCALE" 0) ; (setvar "DIMGAP" (* 1 scale)) ; ;(setvar "DIMTXSTY" "2D") (setvar "DIMLFAC" 1) (setvar "DIMFIT" 5) ;No Leader (setvar "DIMSE1" 0) ;Suppress (setvar "REGENMODE" 1) (setvar "DIMAUNIT" 1) ;Degrees/minutes/seconds ) CHAN.DCL NOTE.LSP Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.