yxl88168
发表于 2011-3-31 22:02:12
期待源码的公布
zhengchuan
发表于 2011-4-30 03:01:04
期待源码的公布
198526
发表于 2011-4-30 17:02:04
期待!!!!
ZZXXQQ
发表于 2011-4-30 19:55:51
;统一尺寸标注 明经 ZZXXQQ 2010.6.1~2010.8.2
(defun c:tt ()
(setvar "CMDECHO" 0)
(while (setq ss1 (entsel "\n选择物体1 :"))
(setq en1 (car ss1) p1 (osnap (cadr ss1) "NEAR"))
(redraw en1 3)
(setq ent1 (entget en1)
enn1 (cdr(assoc 0 ent1)))
(cond
((= enn1 "LINE")
(if (setq ss2 (entsel "\n选择物体2 :")) (progn
(setq en2 (car ss2) p2 (osnap (cadr ss2) "NEAR"))
(redraw en2 3)
(setq ent2 (entget en2)
enn2 (cdr(assoc 0 ent2)))
(if (= enn2 "LINE")
(if (/= (cdr(assoc 5 ent1)) (cdr(assoc 5 ent2))) (progn
(setq pl1 (cdr(assoc 10 ent1))
pl2 (cdr(assoc 11 ent1))
pl3 (cdr(assoc 10 ent2))
pl4 (cdr(assoc 11 ent2)))
(if (inters pl1 pl2 pl3 pl4 nil)
(command ".DIMANGULAR" ss1 ss2 PAUSE)
(if (setq ss3 (entsel "\n选择物体3 :")) (progn
(setq en3 (car ss3) ent3 (entget en3))
(if (= (cdr(assoc 5 ent3)) (cdr(assoc 5 ent1))) (progn
(setq pp12 (inters pl3 pl4 p1 (polar p1 (+ (/ pi 2) (angle pl1 pl2)) 10) nil)
PP12 (polar pp12 (angle p1 pp12) (distance p1 pp12)))
(command ".DIMALIGNED" pp12 "per" p1 PAUSE)
)
(command ".DIMALIGNED" p1 "per" p2 PAUSE)
)
)
(command ".DIMALIGNED" p1 "per" p2 PAUSE)
)
)
))
)
)
(command ".DIMALIGNED" "" p1 PAUSE)
)
)
((or (= enn1 "CIRCLE") (= enn1 "ARC"))
(if (setq ss2 (entsel "\n选择物体2 :")) (progn
(setq en2 (car ss2) p2 (osnap (cadr ss2) "NEAR"))
(redraw en2 3)
(setq ent2 (entget en2)
enn2 (cdr(assoc 0 ent2)))
(cond
((= enn2 "LINE")
(setq pl3 (cdr(assoc 10 ent2))
pl4 (cdr(assoc 11 ent2))
pc1 (cdr(assoc 10 ent1))
ptt (inters pl3 pl4 pc1 (polar pc1 (+ (/ pi 2) (angle pl3 pl4)) 10) nil))
(if (setq ss3 (entsel "\n选择物体3 :")) (progn
(setq en3 (car ss3) ent3 (entget en3))
(if (= (cdr(assoc 5 ent3)) (cdr(assoc 5 ent1))) (progn
(setq pp12 (polar ptt (angle pc1 ptt) (distance pc1 ptt)))
(command ".DIMALIGNED" pc1 pp12 PAUSE)
))
)
(command ".DIMALIGNED" pc1 ptt PAUSE)
)
)
((or (= enn2 "CIRCLE") (= enn2 "ARC"))
(if (/= (cdr(assoc 5 ent1)) (cdr(assoc 5 ent2))) (progn
(setq pc1 (cdr(assoc 10 ent1)) r1 (cdr(assoc 40 ent1)))
(setq pc2 (cdr(assoc 10 ent2)) r2 (cdr(assoc 40 ent2)))
(initget "Yes No" 0)
(if (= (getkword "\n是否切点标注?Yes <No> :") "Yes") (progn
(initget "Yes No" 0)
(if (= (getkword "\n是否水平标注?Yes <No> :") "Yes")
(setq p11 (polar pc1 0 r1) p12 (polar pc1 pi r1)
p21 (polar pc2 0 r2) p22 (polar pc2 pi r2)
pa (if (< (- (car p11) (car pc1)) (- (car pc1) (car p12))) p11 p12)
pb (if (< (- (car p21) (car pc2)) (- (car pc2) (car p22))) p21 p22))
(setq p11 (polar pc1 (/ pi 2) r1) p12 (polar pc1 (/ pi -2) r1)
p21 (polar pc2 (/ pi 2) r2) p22 (polar pc2 (/ pi -2) r2)
pa (if (< (- (cadr p11) (cadr pc1)) (- (cadr pc1) (cadr p12))) p11 p12)
pb (if (< (- (cadr p21) (cadr pc2)) (- (cadr pc2) (cadr p22))) p21 p22))
)
(command ".DIMLINEAR" pa pb PAUSE)
) (progn
(initget "Yes No" 0)
(if (= (getkword "\n是否对齐标注圆心距离?Yes <No> :") "Yes")
(command ".DIMALIGNED" pc1 pc2 PAUSE)
(command ".DIMLINEAR" pc1 pc2 PAUSE)
)
))
)
(command ".DIMDIAMETER" ss1 PAUSE)
)
)
)
) (if (= enn1 "ARC") (progn
(initget "Angle Length Radius" 0)
(setq cho (getkword "\n选择弧标注方式 A角度,L弧长,<R半径> :"))
(cond
((= cho "Angle") (command ".DIMANGULAR" ss1 PAUSE))
((= cho "Length")
(command "lengthen" en1 "")
(setq len (strcat "\{\\Fgdt.shx|c0;^\}\\P" (rtos (getvar "perimeter") 2 2)))
(command ".DIMANGULAR" ss1 "T" len PAUSE)
)
(T (command ".DIMRADIUS" p1 PAUSE))
)
)
(command ".DIMRADIUS" p1 PAUSE)
)
)
)
(T (alert "选择错误!!"))
)
(if en1 (progn (redraw en1 4) (setq en1 nil)))
(if en2 (progn (redraw en2 4) (setq en2 nil)))
)
(setvar "CMDECHO" 1)
(princ)
)
啵浪鼓
发表于 2011-4-30 21:59:32
终于公布源码了,漂亮!
yoyoho
发表于 2011-4-30 22:23:09
感谢Z版公布源码程序,收藏了!
zark
发表于 2011-4-30 23:33:23
ZZXXQQ好样的,几个版主都很不错。
669423907
发表于 2011-6-2 22:37:24
非常感谢明经!非常感谢各位大师们!非常感谢 ZZXXQQ!
如果把 “ 圆,圆弧智能标注 明经 ZZXXQQ 2011.5.28 ”也加进去,那就更好啦!
sqqr
发表于 2011-6-2 23:04:11
难能可贵啊
jfxia
发表于 2011-6-4 12:32:38
好好学习,版主是我的老师
页:
1
2
3
4
[5]
6
7
8
9
10
11
12
13
14