xyp1964
发表于 2012-11-27 07:43:12
本帖最后由 xyp1964 于 2017-11-20 21:54 编辑
(defun xyp-Dxf (mode ename) (xyp-get-Dxf mode ename))
328302216
发表于 2012-11-28 14:22:03
支持院长 支持源码 支持有图有真相
200853006
发表于 2012-12-2 23:38:44
顶 顶看着都很爽。。。
xyp1964
发表于 2012-12-2 23:44:48
本帖最后由 xyp1964 于 2017-11-20 21:54 编辑
;; 自定义函数下载: http://bbs.mjtd.com/thread-95673-1-1.html
;; 动态网格
(defun c:tt (/ ss s0)
(princ "\n9键-水平加密/0键-水平变稀/-键-垂直加密/=键-垂直变稀")
(setq p0 (getpoint "\n基点<退出>: ")
dx (if dx
dx
100
)
dy (if dy
dy
100
)
s0 (entlast)
ss nil
mode t
)
(while mode
(setq mot(grread t 15 0)
code (car mot)
)
(cond ((or
(= code 3)
(= code 25)
)
(setq mode nil)
)
((= (cadr mot) 57)
(setq dx (- dx 10)
dx (if (< dx 0)
10
dx
)
)
)
((= (cadr mot) 48)
(setq dx (+ dx 10))
)
((= (cadr mot) 45)
(setq dy (- dy 10)
dy (if (< dy 0)
10
dy
)
)
)
((= (cadr mot) 61)
(setq dy (+ dy 10))
)
((= code 5)
(if ss
(xyp-erase ss)
)
(setq p1 (cadr mot)
p1 (xyp-Grvecs-Osnap p1)
s1 (xyp-rectang p0 p1)
pt1 (xyp-9pt s1 1)
pt3 (xyp-9pt s1 3)
pt9 (xyp-9pt s1 9)
pt5 (xyp-9pt s1 5)
dist-x (distance pt1 pt3)
dist-y (distance pt3 pt9)
hor (+ (fix (/ dist-x dx)) 1)
nn (+ (fix (/ dist-y dy)) 1)
s2 (xyp-line pt1 (xyp-Pt2Y pt1 dist-y))
s3 (xyp-line pt1 (xyp-Pt2X pt1 dist-x))
rr (* dist-y 0.2)
)
(if (> rr 0)
(progn
(setq s4 (xyp-circle pt5 (* dist-y 0.2))
s5 (xyp-Text 5 pt5 "动态网格")
)
(xyp-SubUpd s4 62 1)
(xyp-SubUpd s5 62 6)
(xyp-SubUpd s5 40 (* dist-y 0.3))
)
)
(xyp-ArrayRH s2 hor dx)
(xyp-ArrayRV s3 nn dy)
(setq ss (xyp-SSelEntnext s0))
)
)
)
(princ)
)
ucuc2003
发表于 2012-12-2 23:58:34
院长老师您好,加个好友吧
yx5277
发表于 2012-12-2 23:59:15
顶 顶不错不错。。
mp3_2004
发表于 2012-12-3 00:24:18
院长辛苦了!
/:)123
发表于 2012-12-3 09:53:15
看来院长真大大的牛人
teykmcqh
发表于 2012-12-3 10:47:44
又学习啦,再顶一下
xyp1964
发表于 2012-12-5 19:35:30
本帖最后由 xyp1964 于 2017-11-20 21:55 编辑
;; xyp-ScaleEntity 缩放实体或选择集 (xyp-ScaleEntity ename point sc)
(defun xyp-ScaleEntity (s0 pt sc / i s1)
(cond ((= (type s0) 'ENAME)
(vla-scaleentity
(xyp-e2o s0)
(vlax-3D-point (trans pt 1 0))
sc
)
)
((= (type s0) 'PICKSET)
(setq i -1)
(while (setq s1 (ssname s0 (setq i (1+ i))))
(xyp-ScaleEntity s1 pt sc)
)
)
((= (type s0) 'LIST) (foreach s1 s0 (xyp-ScaleEntity s1 pt sc)))
)
s0
)