收币有风险,下载需谨慎,勿喷
本附件含4个函数
make-block创建块定义
make-attdef创建属性定义
make-insert创建普通块(insert)
make-attinsert创建属性块(insert)
以下为示例
- ;;;插入普通块1234
- (defun c:tt1 (/ n enl)
- (if (null (tblsearch "BLOCK" "1234"))
- (progn (repeat (setq n 5)
- (setq enl
- (cons
- (entmakex (list '(0 . "line")
- (list 10 (setq n (1- n)) 0)
- (list 11 n 4)
- )
- )
- enl
- )
- )
- )
- (make-block "1234" '(0 0 0) enl)
- )
- )
- (make-insert "1234" (getpoint) 500 500 500 0)
- )
- ;;;插入属性块12345
- (defun c:tt2 (/ n enl)
- (if (null (tblsearch "BLOCK" "12345"))
- (progn (setq enl (list (entmakex '((0 . "line") (10 -1 -1) (11 1 -1)))
- (make-attdef
- '(0 0) '(0 0) "A" "A" "A" 1
- 1 0 "STANDARD" 1 2
- 0
- )
- )
- )
- (make-block "12345" '(0 0 0) enl)
- )
- )
- (make-attinsert
- "12345"
- (getpoint)
- 500
- 500
- 500
- 0
- (list (cons "A" "10"))
- )
- )
|