xj6019
发表于 2020-11-6 08:30:56
669423907 发表于 2020-11-6 08:24
不会这样的,是一个零件一个图框
看来你一般是避免这种多比例同图框的情况,我能理解的,这种情况如果只在模型空间作图的话,只能一个比例是正常作图,其他比例只能做成块,然后按比例缩放,才能放到一起
cq4920
发表于 2020-11-6 09:23:08
xj6019 发表于 2020-11-6 08:30
看来你一般是避免这种多比例同图框的情况,我能理解的,这种情况如果只在模型空间作图的话,只能一个比例 ...
同图框多比例,对标注影响最大,需要对放大后的标注,二次处理一下 线性值和全局比例!
;;========================================
;; 标注全局比例
;;========================================
(defun c:das ( / ss n Lobj Nb dde *error*)
(defun *error* (s)(princ (strcat "\n程序出错: " s)))
(setvar "CMDECHO" 0)
(princ "\n选择需修改 全局比例 的标注:")
(if (setq ss (ssget '((0 . "DIMENSION"))))
(progn
(setq n 0 Lobj '())
(repeat (sslength ss)
(setq Lobj (cons (vla-get-ScaleFactor (vlax-ename->vla-object (ssname ss n))) Lobj)
n (1+ n))
)
(setq dde (rtos (car Lobj) 2 4))
(if (and (cdr Lobj) (null (apply '= Lobj)))(setq dde "*多种*"))
(setq Nb (getdist (strcat "\n请输入全局比例 <"dde ">:" )))
(or Nb (setq Nb (atof dde)))
(setq n 0)
(if (/= Nb 0)
(repeat (sslength ss)
(vla-put-ScaleFactor (vlax-ename->vla-object (ssname ss n)) Nb)
(setq n (1+ n))
))
))
(setvar "CMDECHO" 1)
(princ)
)
;;========================================
;; 标注单位比例因子
;;========================================
(defun c:daa ( / ss n Lobj Nb dde *error*)
(defun *error* (s)(princ (strcat "\n程序出错: " s)))
(setvar "CMDECHO" 0)
(princ "\n选择需修改 全局比例 的标注:")
(if (setq ss (ssget '((0 . "DIMENSION"))))
(progn
(setq n 0 Lobj '())
(repeat (sslength ss)
(setq Lobj (cons (vla-get-linearscalefactor(vlax-ename->vla-object (ssname ss n))) Lobj)
n (1+ n))
)
(setq dde (rtos (car Lobj) 2 4))
(if (and (cdr Lobj) (null (apply '= Lobj)))(setq dde "*多种*"))
(setq Nb (getdist (strcat "\n请输入线性比例 <"dde ">:" )))
(or Nb (setq Nb (atof dde)))
(setq n 0)
(if (/= Nb 0)
(repeat (sslength ss)
(vla-get-linearscalefactor (vlax-ename->vla-object (ssname ss n)) Nb)
(setq n (1+ n))
))
))
(setvar "CMDECHO" 1)
(princ)
)
有兴趣可以参考这两个程序做一个调整标注的插件
xj6019
发表于 2020-11-6 10:42:24
cq4920 发表于 2020-11-6 09:23
同图框多比例,对标注影响最大,需要对放大后的标注,二次处理一下 线性值和全局比例!
;;=========== ...
谢谢分享得源码。
我个人还是习惯布局里面出图,感觉要省事的多
swb4420
发表于 2021-6-28 15:24:48
没图,没说明,不知道插件啥功能啊
kpl
发表于 2021-7-9 17:17:13
布局太高级了
没有昵称呀
发表于 2022-9-19 09:06:28
学习了,谢谢分享
atone
发表于 2024-2-13 17:29:24
学习啦,收藏备用
jkop
发表于 2024-2-27 08:57:46
路過,收藏!
lxl304712346
发表于 2024-8-25 16:50:30
大佬,(mc:be)这个函数缺失。。。;;说明:视口比例
(defun c:vc ( / newdbdist zfc)
(mc:be)
(setq ss (ssget))
(COMMAND "zoom" "o" ss "")
(setq zfc (strcat "\n请输入视图比例<默认值 " (rtos (getvar "USERR1")) ">: "))
(if (= (setq newdbdist (getreal zfc)) nil)
(setq newdbdist (getvar "USERR1"))
)
(setvar "USERR1" newdbdist)
(command "zoom" "s" (strcat (rtos (/ 1.0 newdbdist) 2 10) "xp"))
(princ)
lijunfa12345
发表于 2024-9-22 16:57:19
学习了,谢谢分享