使用ENTMAKE“attdef”向块添加属性时出错。
我做错了什么?
- ;makes a block and inserts to drawing
- (defun C:test_blk()
- (setq x 4 y 4)
- (setq ot 0.3 )
- (if (= ct nil) (setq ct 1))
- (setvar "CMDECHO" 0)
- (and
- (not (tblsearch "BLOCK"
- (setq blk_nm (strcat "SP" (rtos ct 2 2)))))
- (entmake (list (cons 0 "BLOCK")
- (cons 2 blk_nm)
- (list 10 0 0 0)
- (cons 70 0)))
-
- (entmake (list (cons 0 "3DFACE")(cons 8 "0")
- (list 10 0 0 0) ;First corner
- (list 11 x 0 0) ;Second corner
- (list 12 x y 0) ;Third corner
- (list 13 0 y 0))) ; Fourth corner
- (entmake (list (cons 0 "TEXT") ;***
- (cons 1 "P10") ;Default value (the string itself)
- (cons 6 "BYLAYER")
- (cons 7 "STANDARD") ;Text style name
- (cons 8 "0")
- (cons 10 (list (+ ot) ot 0.0)) ;First alignment point
- ;(cons 11 (list 0.0 0.0 0.0)) ;***
- (cons 39 0.0)
- (cons 40 1.5) ;Text height
- (cons 41 1.0) ;Relative X scale factor
- (cons 50 0.0) ;Text rotation
- (cons 51 0.0) ;Oblique angle (
- (cons 62 256)
- (cons 210 (list 0.0 0.0 1.0))))
- ;;;(entmake (list (cons 0 "ATTDEF") ;
- ;;; (cons 8 "0")
- ;;; (cons 10 (list ot (+ y ot) 0)) ;Text start point
- ;;; (cons 40 2) ;Text height
- ;;; (cons 1 "55") ;Default value (string)
- ;;; (cons 2 "TAGNAME") ;Attribute tag (string; cannot contain spaces)
- ;;; (cons 70 0)
- ;;; (cons 73 0)
- ;;; (cons 50 0) ;Text rotation (optional; default = 0)
- ;;; (cons 41 1) ;Relative X scale factor
- ;;; (cons 51 0)
- ;;; (cons 7 "STANDARD") ;***
- ;;; (cons 71 0)
- ;;; (cons 72 0)
- ;;; ;(cons 11 (list 0 0 0)) ;Alignment point
- ;;; (cons 210 (list 0 0 1));Extrusion direction.
- ;;; (cons 74 0)
- ;;; (cons 62 256)
- ;;; (cons 39 0)
- ;;; (cons 6 "BYLAYER")))
- (entmake (list (cons 0 "ENDBLK")(cons 8 "0"))))
- (setq blk_rh (entlast))
- (while (eq blk_rh (entlast))
- (command "_.INSERT" blk_nm))
- (setq ct (+ ct 1))
- );defun
|