- (load "xyp_lib");加载通用函数
- ;|
- 如果已经下载xyp_lib并放到搜索路径下可以不再下载!
- 利用以下任何一种方式即可加载和运行通用函数内的所有子程序:
- 1.在acad.lsp中增加(load"xyp_lib")
- 2.在每个程序内增加(load"xyp_lib")
- 3.在command下,输入(load"xyp_lib")
- 4.在菜单.mnl中增加(load"xyp_lib")
- 通用函数下载地址:
- http://bbs.mjtd.com/forum.php?mod=viewthread&tid=37554
- |;;;;参考延伸或修剪
- (defun c:test ()
- (cmdla0)
- (mkla "参考线" 1)
- (setq tx1 (UKWORD 1 "1 2" "\n1-延伸/2-修剪" tx1))
- (if (setq pt1 (getpoint "\n参考线起点<退出> : "))
- (progn
- (command "pline" pt1)
- (while (setq pt2 (getpoint pt1 "\n参考线下一点<退出> : "))
- (command pt2)
- (setq pt1 pt2)
- )
- (command)
- (setq s1 (entlast))
- (cond ((= tx1 "1") (command "extend" s1 ""))
- ((= tx1 "2") (command "trim" s1 ""))
- )
- (while (setq s2 (entsel))
- (command s2)
- )
- (command)
- (command "erase" s1 "")
- )
- )
- (cmdla1)
- )
|