只适合提供的特定文件:- (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)
- (setvar "dimdec" 0)
- (setvar "DIMEXO" 10)
- (Setvar "DIMTXT" (* sc 300))
- (setq s1 (entsel "\n选择数值 : ")
- pt1 (getpoint "\n构件左下角点 : ")
- pt2 (getcorner pt1 "\n构件右上角点 : ")
- num (atof (dxf 1 (entget (car s1))))
- s3 (ssget "X"
- '((0 . "LINE") (62 . 3))
- )
- ss1 (ssget "x")
- )
- (setvar "osmode" 0)
- (command "select" ss1 "r" s3 "")
- (setq ss2 (ssget "P"))
- (command "erase" ss2 "")
- (mkla "构件" 4)
- (command "rectang" pt1 pt2)
- (setq ss (ssget "x")
- sc (/ num (- (car pt2) (car pt1)))
- )
- (command "-block" "test" pt1 ss "")
- (command "-insert" "test" pt1 "" "" "")
- (setq s1 (entlast))
- (SUB_UPD s1 41 sc)
- (command "explode" "l" "")
- (COMMAND "-PURGE" "b" "test" "" "y")
- (mkla "标注" 3)
- (command "dim1"
- "hor"
- pt1
- (polar pt1 0 num)
- (polar pt1 (* pi 1.5) 30)
- ""
- )
- (CMDLA1)
- )
|