明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
楼主: 自贡黄明儒

[源码] 序号标注-----------------源码

    [复制链接]
发表于 2014-3-13 19:17:35 | 显示全部楼层
发表于 2014-3-14 10:47:20 | 显示全部楼层
好东西,收藏了!
发表于 2014-3-14 10:59:06 | 显示全部楼层
不能用啊 !!!!!

点评

加上5楼8楼代码  发表于 2014-3-14 11:11
发表于 2014-3-14 12:46:09 | 显示全部楼层
出现错误: *error* 函数中出错无函数定义: _ENDUNDO
发表于 2014-3-15 17:05:44 | 显示全部楼层
自贡黄明儒 发表于 2014-3-12 15:34
本来想放在二楼的,现在只能放在这儿了!!

谢谢楼主分享
发表于 2014-3-17 13:31:22 | 显示全部楼层
对话框设置后没反应

点评

你确信没反应?  发表于 2014-3-18 10:18
发表于 2014-3-22 17:53:39 | 显示全部楼层
能不能传个完整的东西!!!!!!!!!!!
发表于 2014-3-28 09:32:56 | 显示全部楼层
非常感谢黄大师分享好程序!
提一点小建议:
可以用鼠标点取文字作为序号的字高(默认当前自高)就更完美了!

上传一个Z版的
;球标标注 ZZXXQQ 2011-10 http://bbs.mjtd.com/thread-84161-3-1.html
(defun c:qqqq(/ os oldlayer pt num ppoint angleline texthight LINEL)
(setq la (getvar"clayer"))
(command "layer" "m" "7标注" "c" "3" "" "lw" "0.13" "" "l" "Continuous" "" "")
; (setvar "CMDECHO" 0)
; (setvar "ORTHOMODE" 1)
(setq os (getvar "osmode"))
(setq ort (getvar "ORTHOMODE"))
(setq oldlayer (getvar "CLAYER"))
(command "_.undo" "be")
(setvar "osmode" 6079)
(if (and (setq s1 (entsel "\n选择文本 :"))
(setq ent (entget(car s1)))
(= (cdr(assoc 0 ent)) "TEXT"))
(setq texthight (cdr(assoc 40 ent)))
(setq texthight (getvar 'textsize))
  )
(if (and (setq numx (getint "\n起始序号<1>") numx (if numx numx 1))
  (setq pt (getpoint "\n指定球标位置 :"))) (progn
;  (setvar "ORTHOMODE" 0)
  (setq ppoint (getpoint pt "\n标示构件点 :"))
;  (setvar "ORTHOMODE" 1)
(setq angleline (angle ppoint pt))  
  (setq LINEL (- (distance PPOINT PT) (* 1.0 texthight)))
  (setq num (rtos numx 2 0))
;  (command "LAYER" "M" "文本" "")
  (command "mtext" pt "J" "MC" "H" texthight "w" 8 NUM "")
;  (command "LAYER" "M" "粗实线" "")
  (command "CIRCLE" PT (* 1 texthight))
;  (command "LAYER" "M" "标注" "")
(command "donut" 0 "0.5" ppoint "")
  (command "LINE" (polar PPOINT angleline 0.25) (polar PPOINT angleline LINEL) "")
))
(if pt
(while (setq nextpoint (getpoint pt "\n下一个球标位置 :"))
  (if (< (abs (- (car nextpoint) (car pt))) (abs (- (cadr nextpoint) (cadr pt))))
(setq ptx (list (car pt) (cadr nextpoint)))
(setq ptx (list (car nextpoint) (cadr pt)))
  )
  (if (equal (distance ptx pt) (* 2 texthight) texthight)
(setq ptx (polar pt (angle pt ptx) (* 2 texthight)))
  )
  (setq NUMx (1+ NUMx))
  (setq num (rtos numx 2 0))
;  (setvar "CLAYER" "文本")
  (command "mtext" ptX "J" "MC" "H" texthight "w" 8 NUM "")
;  (setvar "CLAYER" "粗实线")
  (command "CIRCLE" PTX (* 1 texthight))
  (if (not (equal (distance ptx pt) (* 2 texthight) texthight)) (progn
; (setvar "ORTHOMODE" 0)
(setq ppoint (getpoint ptx "\n标示构件点 :"))
; (setvar "ORTHOMODE" 1)
; (setvar "CLAYER" "标注")
(command "donut" 0 "0.5" ppoint "")
(setq angleline (angle ppoint ptX))
(setq LINEL (- (DISTance PPOINT PTX) (* 1.0 texthight)))
(command "LINE" (polar PPOINT angleline 0.25) (polar PPOINT angleline LINEL) "")))
  (setq pt ptx)))
(setvar "clayer"la)
(command "_.undo" "e")
(setvar "ORTHOMODE" ort)
(setvar "osmode" os)
(setvar "CMDECHO" 1)
(princ))
发表于 2014-4-30 08:21:58 | 显示全部楼层
非常感谢黄老师分享好程序!
发表于 2014-5-1 12:06:02 | 显示全部楼层
很好很简单
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-11-6 00:18 , Processed in 0.172207 second(s), 20 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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