明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 3915|回复: 6

求贱人工具箱中的一个程序 高手帮忙 谢谢!!!

[复制链接]
发表于 2011-10-30 11:07:57 | 显示全部楼层 |阅读模式
想要一个单独的程序,输入JK就能出现这个对话框,设置好后可以框选单行文本

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

x
发表于 2011-11-1 15:28:52 | 显示全部楼层

简单的文字加外框程序

本帖最后由 cushi 于 2011-11-1 15:29 编辑

简单的文字加外框程序,自已补充哦。
(defun c:j (/ b1 c1 d1 e1)
(setq d1 (getreal "请输入空隔距离:"))
(princ b1)
(while (setq c1 (entsel "\n请选择对象:"))
  (setq e1 (entget (car c1)))
  (if (= (cdr (assoc 0 e1)) "TEXT") (progn
    (setq b1 (textbox e1))
    (command "rectang"
     (mapcar '- (cdr (assoc 10 e1)) (car b1) (list d1 d1))
     (mapcar '+ (cdr (assoc 10 e1)) (cadr b1) (list d1 d1))
    )
   ))
)
)

点评

不用测试就知道,如果文字不是水平放置,而是有旋转角度,画出的边框可不对哦。  发表于 2011-11-2 00:01
发表于 2012-5-16 00:01:35 | 显示全部楼层
这个功能我可以弄,需要的话,加我的QQ群:93525062
发表于 2012-5-20 19:11:31 | 显示全部楼层
有需要请加QQ269483126
发表于 2012-6-22 12:58:07 | 显示全部楼层
ooooooooooooooooooooooooooo
发表于 2012-6-23 14:10:42 | 显示全部楼层
  1. ;;-----------------------=={ Box Text }==---------------------;;
  2. ;;                                                            ;;
  3. ;;  Frames Text or MText objects with an LWPolyline, with     ;;
  4. ;;  optional offset. Works in all UCS/Views.                  ;;
  5. ;;------------------------------------------------------------;;
  6. ;;  Author: Lee Mac, Copyright � 2010 - www.lee-mac.com       ;;
  7. ;;------------------------------------------------------------;;

  8. (defun c:BT nil (c:BoxText))

  9. (defun c:BoxText nil
  10.   ;; � Lee Mac 2010

  11.   (
  12.     (lambda ( ss off i / e )
  13.       (if ss
  14.         (while (setq e (ssname ss (setq i (1+ i))))
  15.           (entmakex
  16.             (append
  17.               (list
  18.                 (cons 0 "LWPOLYLINE")
  19.                 (cons 100 "AcDbEntity")
  20.                 (cons 100 "AcDbPolyline")
  21.                 (assoc 8 (entget e))
  22.                 (cons 90 4)
  23.                 (cons 70 1)
  24.                 (cons 38 (caddr (cdr (assoc 10 (entget e)))))
  25.                 (assoc 210 (entget e))
  26.               )
  27.               (mapcar '(lambda ( x ) (cons 10 x)) (LM:GetTextBox e off))
  28.             )
  29.           )
  30.         )
  31.       )
  32.     )
  33.     (ssget '((0 . "TEXT,MTEXT")))
  34.     (setq *o*
  35.       (cond
  36.         (
  37.           (getdist
  38.             (strcat "\nSpecify Offset <"
  39.               (rtos
  40.                 (setq *o*
  41.                   (cond ( *o* ) ( (* 0.5 (getvar 'TEXTSIZE)) ))
  42.                 )
  43.               )
  44.               "> : "
  45.             )
  46.           )
  47.         )
  48.         ( *o* )
  49.       )
  50.     )
  51.     -1
  52.   )

  53.   (princ)
  54. )

  55. ;;---------------------=={ Get Text Box }==-------------------;;
  56. ;;                                                            ;;
  57. ;;  Returns a point list describing a rectangle framing the   ;;
  58. ;;  specified text or mtext entity with optional offset       ;;
  59. ;;------------------------------------------------------------;;
  60. ;;  Author: Lee Mac, Copyright &#65533; 2010 - www.lee-mac.com       ;;
  61. ;;------------------------------------------------------------;;
  62. ;;  Arguments:                                                ;;
  63. ;;  ent - Text or MText ename                                 ;;
  64. ;;  off - offset (may be zero)                                ;;
  65. ;;------------------------------------------------------------;;
  66. ;;  Returns:  List of Points (in OCS) describing text frame   ;;
  67. ;;------------------------------------------------------------;;

  68. (defun LM:GetTextBox ( ent off / dx lst base rotn norm w h matrix )
  69.   ;; &#65533; Lee Mac 2010

  70.   (setq dx (lambda ( x l ) (cdr (assoc x l))))

  71.   (if
  72.     (setq lst
  73.       (cond
  74.         (
  75.           (eq "TEXT" (dx 0 (setq l (entget ent))))

  76.           (setq base (dx 10 l) rotn (dx 50 l))

  77.           (
  78.             (lambda ( data )
  79.               (mapcar
  80.                 (function
  81.                   (lambda ( funcs )
  82.                     (mapcar
  83.                       (function
  84.                         (lambda ( func )
  85.                           ((eval (car func)) ((eval (cdr func)) data) off)
  86.                         )
  87.                       )
  88.                       funcs
  89.                     )
  90.                   )
  91.                 )
  92.                 (list
  93.                   (list (cons '- 'caar ) (cons '- 'cadar ))
  94.                   (list (cons '+ 'caadr) (cons '- 'cadar ))
  95.                   (list (cons '+ 'caadr) (cons '+ 'cadadr))
  96.                   (list (cons '- 'caar ) (cons '+ 'cadadr))
  97.                 )
  98.               )
  99.             )
  100.             (textbox l)
  101.           )
  102.         )
  103.         (
  104.           (eq "MTEXT" (dx 0 l))

  105.           (setq norm (dx 210 l) base (trans (dx 10 l) 0 norm)
  106.          
  107.                 rotn (angle '(0. 0. 0.) (trans (dx 11 l) 0 norm))

  108.                 w (dx 42 l) h (dx 43 l)
  109.           )
  110.           (
  111.             (lambda ( org )
  112.               (mapcar
  113.                 (function
  114.                   (lambda ( o ) (mapcar '+ org o))
  115.                 )
  116.                 (list
  117.                   (list (-   off) (-   off))
  118.                   (list (+ w off) (-   off))
  119.                   (list (+ w off) (+ h off))
  120.                   (list (-   off) (+ h off))
  121.                 )
  122.               )
  123.             )
  124.             (
  125.               (lambda ( j )
  126.                 (list
  127.                   (cond
  128.                     (
  129.                       (member j '(2 5 8)) (/ w -2.)
  130.                     )
  131.                     (
  132.                       (member j '(3 6 9)) (- w)
  133.                     )
  134.                     ( 0. )
  135.                   )
  136.                   (cond
  137.                     (
  138.                       (member j '(1 2 3)) (- h)
  139.                     )
  140.                     (
  141.                       (member j '(4 5 6)) (/ h -2.)
  142.                     )
  143.                     ( 0. )
  144.                   )
  145.                 )
  146.              )
  147.              (dx 71 l)
  148.            )
  149.          )
  150.        )
  151.      )
  152.    )
  153.     (progn
  154.       (setq matrix
  155.          (list
  156.            (list (cos rotn) (sin (- rotn)) 0.)
  157.            (list (sin rotn) (cos    rotn)  0.)
  158.            (list     0.           0.       1.)
  159.          )
  160.       )

  161.       (mapcar
  162.         (function
  163.           (lambda ( point )
  164.             (mapcar '+
  165.               (mapcar
  166.                 (function
  167.                   (lambda ( r ) (apply '+ (mapcar '* r point)))
  168.                 )
  169.                 matrix
  170.               )
  171.               (reverse (cdr (reverse base)))
  172.             )
  173.           )
  174.         )
  175.         lst
  176.       )
  177.     )
  178.   )
  179. )

发表于 2012-7-7 11:12:16 | 显示全部楼层
不错哦。、贱人好像现在有破解版的。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2025-7-22 02:01 , Processed in 0.177204 second(s), 31 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表