我同意李使用entmake,好的编程应该是有一个defun,它是一个“entmake”(myline p1 p2)也有其他公共实体圆弧等(mycircle p1 ang1 ang2 rad)
将这些entmake defuns放入启动/自动加载lsp
如果你看更高层次的编程示例。net C##它们始终具有entmake类型的函数。VL?
如
- (defun c:TesT (/ ip p1 p2 p3)
- ;;; Tharwat 04. Jan. 2012 ;;;
- (if (setq ip (getpoint "\nEnter Center Point: "))
- (progn
- (entmake
- (list '(0 . "CIRCLE") (cons 10 (trans ip 0 1)) '(40 . 3.))
- )
- (entmake (list '(0 . "LINE")
- (cons 10 (setq p1 (polar ip 0. 5.0)))
- (cons 11 (polar p1 pi 10.))
- )
- )
- (entmake (list '(0 . "LINE")
- (cons 10 (setq p2 (polar ip (/ pi 2.) 5.0)))
- (cons 11 (polar p2 (+ pi (/ pi 2.)) 10.))
- )
- )
- (setq p3 (polar ip (/ pi 4.) 1.))
- (repeat 2
- (command "_.-hatch" "_p" "Solid" p3 "")
- (setq p3 (polar ip (+ pi (/ pi 4.)) 1.))
- )
- )
- (princ)
- )
- (princ)
- )
|