明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1888|回复: 4

多义线标注

[复制链接]
发表于 2011-12-22 16:42 | 显示全部楼层 |阅读模式
经常用到多义线标号,请高手帮忙写个代码

本帖子中包含更多资源

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

x
"觉得好,就打赏"
还没有人打赏,支持一下
发表于 2011-12-22 19:43 | 显示全部楼层
  1. (defun c:tt (/ H SS N EN NN ANG MP)
  2.   (setq h (getreal "\n字高<10.0>"))
  3.   (if (null h)
  4.     (setq h 10)
  5.   ) ;_ if
  6.   (setq ss (ssget '((0 . "*polyline"))))
  7.   (if ss
  8.     (repeat (setq n (sslength ss))
  9.       (setq en (ssname ss (setq n (1- n))))
  10.       (setq nn 0)
  11.       (repeat (fix (vlax-curve-getendparam en))
  12.         (setq ang
  13.                (angle
  14.                  (setq mp (vlax-curve-getPointAtParam en (+ nn 0.5)))
  15.                  (mapcar '+ mp (vlax-curve-getFirstDeriv en (+ nn 0.5)))
  16.                ) ;_ angle
  17.         ) ;_ setq
  18.         (entmake (list (cons 0 "text")
  19.                        (cons 10 mp)
  20.                        (cons 40 h)
  21.                        (cons 1 (itoa (setq nn (1+ nn))))
  22.                        (cons 50 ang)
  23.                  ) ;_ list
  24.         ) ;_ entmake

  25.       ) ;_ repeat
  26.     ) ;_ repeat
  27.   ) ;_ if
  28.   (princ)
  29. )

点评

可以实现直线吗?  发表于 2011-12-22 19:51

评分

参与人数 2明经币 +2 金钱 +50 收起 理由
hhh454 + 1 + 50 非常感谢
【KAIXIN】 + 1 很给力!

查看全部评分

 楼主| 发表于 2011-12-22 20:17 | 显示全部楼层
Gu_xl 发表于 2011-12-22 19:43

谢谢帮助,写好的字是根据线旋转了,能不能改成全是正的


本帖子中包含更多资源

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

x
 楼主| 发表于 2011-12-22 20:31 | 显示全部楼层
知道了,删除了一些代码,可以实现,谢谢
  1. (defun c:tt (/ H SS N EN NN ANG MP)
  2.   (setq h (getreal "\n字高<10.0>"))
  3.   (if (null h)
  4.     (setq h 10)
  5.   ) ;_ if
  6.   (setq ss (ssget '((0 . "*polyline"))))
  7.   (if ss
  8.     (repeat (setq n (sslength ss))
  9.       (setq en (ssname ss (setq n (1- n))))
  10.       (setq nn 0)
  11.       (repeat (fix (vlax-curve-getendparam en))            
  12.                  (setq mp (vlax-curve-getPointAtParam en (+ nn 0.5)))
  13.                  (mapcar '+ mp (vlax-curve-getFirstDeriv en (+ nn 0.5)))
  14.         (entmake (list (cons 0 "text")
  15.                        (cons 10 mp)
  16.                        (cons 40 h)
  17.                        (cons 1 (itoa (setq nn (1+ nn))))
  18.                  ) ;_ list
  19.         ) ;_ entmake

  20.       ) ;_ repeat
  21.     ) ;_ repeat
  22.   ) ;_ if
  23.   (princ)
  24. )
 楼主| 发表于 2011-12-22 20:31 | 显示全部楼层
Gu_xl 发表于 2011-12-22 19:43

已经实现了,删除了一些代码,谢谢了
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-3-29 20:04 , Processed in 0.249216 second(s), 31 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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