- 积分
- 7470
- 明经币
- 个
- 注册时间
- 2010-8-7
- 在线时间
- 小时
- 威望
-
- 金钱
- 个
- 贡献
-
- 激情
-
|
楼主 |
发表于 2020-9-22 20:52:09
|
显示全部楼层
(defun c:tt ();/ ltsold ss en dxf celtsold celtsnew)
(setvar "CMDECHO" 0)
(setq ltsold (getvar "ltscale"));获取当前全局比例因子
; (setq ss (ssget "X" '((0 . "ARC,CIRCLE,ELLIPSE,LINE,*POLYLINE"))));选择所有的线
(while (setq ss (ssget ":s"))
(repeat (setq n (sslength ss))
(setq en (ssname ss (setq n (1- n))))
(setq dxf (entget en))
(if (assoc 48 dxf)
(setq celtsold (cdr(assoc 48 dxf)));获取当前线段的比例因子,因为现在要将图纸的全局比例因子改成1000,所以现在线型的celtscale要变成(1000/lsold )*celtsold
(setq celtsold 1)
)
(setq celtsnew (/ (* ltsold celtsold) 1))
(if (assoc 6 dxf)
(if (/= (cdr(assoc 6 dxf)) "Continuous")
(command "chprop" en "" "s" celtsnew "")
)
(if (/= (cdr(assoc 6 (tblsearch "LAYER" (cdr(assoc 8 dxf))))) "Continuous")
(command "chprop" en "" "s" celtsnew "")
)
)
)
)
(setvar "ltscale" 1)
(setvar "CMDECHO" 1)
(princ (strcat "\n---已经将所选对象全部比例因子即lts从" (rtos (* ltsold celtsold) 2) "改为1"))
(princ)
)
这个程序你直接在别人的图纸里面运行,让后把运行后别人图纸内的东西拷贝到你的图纸里面,就可以了 |
|