合并插件问题
本帖最后由 tfanghui 于 2022-8-27 08:54 编辑来个大神指点一下,合并插件问题
附件两个
1个是查询视口比例,
1个是查询面积并显示文字,
把这两个程序合并成一个程序,使插程序件功能变成,查询1:10 视口比例显示SC=1:10, 查询1:20 视口比例显示SC=1:20 ,
tfanghui 发表于 2022-8-27 08:59
大神出马一个顶俩,视口可以显示比例了,但是有点美中不足,
1.每个视口显示的文字不一样 ...
(defun c:tt5 (/ en i p1 p2 ss)
(VL-LOAD-COM)
(prompt "选择视口:")
(setqss (ssget ":S" '((0 . "viewport"))))
(setq i -1)
(while (setq en (ssname ss (setq i (1+ i))))
(setq p1 (car (enbox en)) p2 (cadr (enbox en)))
(command "text" "j" "mc" "non" (mapcar'*(mapcar'+ p1 p2)'(0.5 0.5 0.5)) 2.5 0 (strcat "SC=1:" (rtos (/ (cdr(assoc 45 (entget en)))(cdr(assoc 41 (entget en)))) 2 0)))
);while
(princ)
)
(defun enbox (ename / ll ur)
(vla-getboundingbox (vlax-ename->vla-object ename) 'll 'ur)
(mapcar 'vlax-safearray->list (list ll ur))
) (defun c:tt5 (/ en p1 p2)
(VL-LOAD-COM)
(prompt "选择视口:")
(setqen (ssname (ssget ":S" '((0 . "viewport"))) 0) p1 (car (enbox en)) p2 (cadr (enbox en)))
(command "text" "j" "mc" "non" (mapcar'*(mapcar'+ p1 p2)'(0.5 0.5 0.5)) (* 0.2 (- (cadr p2) (cadr p1))) 0 (strcat "SC=1:" (rtos (/ (cdr(assoc 45 (entget en)))(cdr(assoc 41 (entget en)))) 2 0)))
(princ)
)
(defun enbox (ename / ll ur)
(vla-getboundingbox (vlax-ename->vla-object ename) 'll 'ur)
(mapcar 'vlax-safearray->list (list ll ur))
) 本帖最后由 tfanghui 于 2022-8-27 21:33 编辑
start4444 发表于 2022-8-27 01:08
(defun c:tt5 (/ en p1 p2)
(VL-LOAD-COM)
(prompt "选择视口:")
大神出马一个顶俩,视口可以显示比例了,但是有点美中不足,
1.每个视口显示的文字不一样大,要是能固定文字为2.5就更好,
2.可以框选,但是只能显示最后一个视口有比例, start4444 发表于 2022-8-27 18:36
(defun c:tt5 (/ en i p1 p2 ss)
(VL-LOAD-COM)
(prompt "选择视口:")
厉害了,我的哥,这是我要的效果。 start4444 发表于 2022-8-27 18:36
(defun c:tt5 (/ en i p1 p2 ss)
(VL-LOAD-COM)
(prompt "选择视口:")
老大,还有个问题请教一下,加了下面,想把文字放在一个不打印图层,但是跟其它的程序可能有冲突,不知道要怎么处理了, (command "layer" "m" "bili" "c" "3" "" "")
(command ".layer" "p" "n" "bili" "")
页:
[1]