在CAD中用LISP实现原位放大数值

 时间:2026-02-16 20:32:10

1、(defun c:fff(/ num)

  (princ"主要功能为原位数值放大")

  (setvar "cmdecho" 0)

  (if(= nil xsz) (c:szcs))

  (princ"\n当前放大系数为:")(princ xsz)

  (princ"\n如需重新设置请退出执行 szcs")

  (setq newlayer(tblsearch "layer" "WT"))

  (if(= newlayer nil) (command "layer" "n" "WT" "c" "2" "WT" ""))

  (setq nse(ssget))

  (setq nse_len(sslength nse))

  (setq nn 0)

  (repeat nse_len

    (setq nse_sub(ssname nse nn))

    (setq nse_data(entget nse_sub))

    (setq old_num_list(assoc 1 nse_data))

    (setq old_layer_list(assoc 8 nse_data));

    (setq num(cdr (assoc 1 nse_data)))

    (setq layer(cdr (assoc 8 nse_data)))

    (setq cal_old_num(atof num))

    (setq cal_new_num(* xsz cal_old_num))

    (setq new_num_list(cons 1 (rtos cal_new_num 2 1)))

    (setq new_lay_list(cons 8 "WT"))

    (setq nse_data(subst new_num_list old_num_list nse_data))

    (setq nse_data(subst new_lay_list old_layer_list nse_data))

    (entmod nse_data)

    (setq nn (+ nn 1))

    (setq new_word(entlast))

    )

  (prin1)

  )

(defun c:szcs()

  (setq xsz (getreal"放大系数"))

  )

2、执行_vlide命令,打开LISP编辑器,将第一步代码复制粘贴到编辑器中

3、点击加载命令

在CAD中用LISP实现原位放大数值

4、执行fff命令,如需重新设置放大系数执行SZCS

  • 肉松豌豆米糊
  • Excel中VBA data array sort数据表排列组合重构
  • excel中如何设置凹凸表格形式
  • 在scratch中绘制蓝色双扇形的方法
  • Excel怎样绘制齿轮
  • 热门搜索
    ms是什么意思 如何修改pdf文件 在校奖惩情况怎么写 身份证丢失如何补办 阿黛尔的生活 下载 光明家具怎么样 pm是什么意思 如何提高员工积极性 如何做最好的自己 苹果6通话时怎么录音