乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
查看: 47|回复: 0

[编程交流] Mleader with predifined, auto

[复制链接]

3

主题

5

帖子

2

银币

初来乍到

Rank: 1

铜币
15
发表于 2022-7-6 10:22:03 | 显示全部楼层 |阅读模式
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!
 
 
 
  1. ;;; 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 );;; 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)
  1. (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)                  )           )         )       )   ) ))
  1. (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
回复

使用道具 举报

发表回复

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-3-6 21:18 , Processed in 0.508988 second(s), 54 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表