明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1637|回复: 0

(求助)可否把下面的源码每句都注释下

[复制链接]
发表于 2011-9-11 00:56:20 | 显示全部楼层 |阅读模式
(求助)可否把下面的源码每句都注释下,刚接触LISP,不是很明白。
原帖位置http://bbs.mjtd.com/thread-89159-1-1.htm版主GU-XL编写的源码
(DEFUN C:TT (/ PT FILENAME path scale)
  (defun getname (pt scale / X Y XKM A XM YKM YM dimzin)
    (setq dimzin (getvar 'dimzin))
    (setvar 'dimzin 0)
    (setq x (car pt)
          y (cadr pt)
          xkm (rtos (setq a (fix (* 0.001 y))) 2 0)
          xm (substr (rtos (* 0.001 (* (fix (/ (- y (* a 1000)) (* scale 0.5))) (* scale 0.5))) 2 2) 2)
          ykm (rtos (setq a (fix (* 0.001 x))) 2 0)
          ym (substr (rtos (* 0.001 (* (fix (/ (- x (* a 1000)) (* scale 0.5))) (* scale 0.5))) 2 2) 2)
          )
    (setvar 'dimzin dimzin)
    (strcat xkm  xm "-" ykm  ym)
    )
  (setq scale (getint "\n 图形比例尺<1:500>"))
  (if (null scale) (setq scale 500))
  (setq path (getvar 'DWGPREFIX))
(while
  (setq pt (getpoint "\n选取点位置:"))
;;;得到文件名
  (setq filename (strcat (getname pt scale) ".dwg"))
;;;插入块
  (if (setq filename (findfile (strcat path filename)))
    (command "insert" filename '(0 0 0) 1 1 0)
  )
)
)
您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2025-9-24 09:09 , Processed in 0.155475 second(s), 26 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表