现有自动图框源码,怎么修改,实现标注大小也随图框大小一起调整?
现有自动图框源码,添加什么语句,能实现标注大小也随图框大小一起调整?目前图框随鼠标框选可以缩放,但是标注大小不能随图框一起变化,怎么破?
源码如下:
(defun c:tk()
(setq mylayer (getvar "clayer"))
(setq layname1 (substr mylayer 1 2))
(setq layname2 (strcat layname1 "fromat"))
(if(setq ed1 (tblsearch "LAYER" layname2))
(progn
(setq ed2 (cdr (assoc 70 ed1)))
(cond
((= ed2 0)(command "layer" "on" layname2 ""))
((= ed2 1)(command "layer" "t" layname2 "on" layname2 ""))
((= ed2 4)(command "layer" "u" layname2 "on" layname2 ""))
((= ed2 5)(progn (command "layer" "t"str3 "u" layname2 "on" layname2 "")))
)
)
(setq layname2 "fromat")
)
(command "layer" "s" layname2 "")
(setq pt1 (getpoint "请选择图形左上角:\n"))
(setq pt2 (getcorner pt1 "请选择图形右下角:\n"))
(setq disx (abs (- (car pt1) (car pt2))))
(setq disy (abs (- (cadr pt1) (cadr pt2))))
(setq acx(/ disx 780.00))
(setq acy(/ disy 500.00))
(if (> acy acx)
(setq acx acy)
)
(setq acx (*(fix (+ (* acx 10) 0.9999)) 0.1))
(setq acc (rtos acx 2 1))
(setq pt0 (list (/ (+ (car pt1 ) (car pt2) (* (- 0 8) acx)) 2.00)
(/ (+ (cadr pt1) (cadr pt2) (* (- 0 23.6) acx)) 2.00)))
(setq os (getvar "osmode"))
(setvar "osmode" 0)
(command "insert""tk.dwg" pt0 "x" acx "" "" "" "" "" "" "" "" "" "" ""
acc"" "" """" )
(setvar "osmode" os)
) (defun c:tk ()
(setq mylayer (getvar "clayer"))
(setq layname1 (substr mylayer 1 2))
(setq layname2 (strcat layname1 "fromat"))
(if(setq ed1 (tblsearch "LAYER" layname2)) (progn
(setq ed2 (cdr (assoc 70 ed1)))
(cond
((= ed2 0)(command "layer" "on" layname2 ""))
((= ed2 1)(command "layer" "t" layname2 "on" layname2 ""))
((= ed2 4)(command "layer" "u" layname2 "on" layname2 ""))
((= ed2 5)(command "layer" "t" layname2 "u" layname2 "on" layname2 ""))
)
)
(setq layname2 "fromat")
)
(command "layer" "s" layname2 "")
(setq pt1 (getpoint "请选择图形左上角:\n"))
(setq pt2 (getcorner pt1 "请选择图形右下角:\n"))
(setq disx (abs (- (car pt1) (car pt2))))
(setq disy (abs (- (cadr pt1) (cadr pt2))))
(setq acx (/ disx 780))
(setq acy (/ disy 500))
(if (> acy acx) (setq acx acy))
(setq acx (* (fix (+ (* acx 10) 0.9999)) 0.1))
(setq acc (rtos acx 2 1))
(setq pt0 (list (/ (+ (car pt1) (car pt2) (* -8 acx)) 2)
(/ (+ (cadr pt1) (cadr pt2) (* -23.6 acx)) 2)))
(setq os (getvar "osmode"))
(setvar "osmode" 0)
(command "-insert" "tk.dwg" pt0 "x" acx "" "" "" "" "" "" "" "" "" "" ""
acc "" "" """" )
(setvar "DIMSCALE" acx)
(command "-DIMSTYLE" "S" (getvar "DIMSTYLE") "Y")
(setvar "osmode" os)
(princ)
)
后面加1句
(setvar 'dimscale (cdr (assoc 41 (entget (entlast))))) 都用不了啊 不是很懂这个功能放大图框不是标注本来就放大么 彩卷鱼的可以实现!版主的还没琢磨出来,多谢二位了!! 昨天还见到很多跟贴,今早却不见了,为什么?此现象已经不是第一次了。 以前只管使用,现在设计,没外挂真难啊 插入点如何选取 求插入图框源码可以自由拉伸的,不带有图层的。
http://bbs.mjtd.com/forum.php?mod=viewthread&tid=173254&fromuid=7316254
请高手们看下。急需要
页:
[1]