马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
- ;;制作 Donut
- ;;;画圆环 r1内径r2 外 径
- (defun xd-MkDonut (p0 r1 r2 / P1 P2 R RR ent)
- (setq r (/ (+ r1 r2) 2.0)
- rr (- r2 r1)
- p1 (polar p0 0 (- r))
- p2 (polar p0 0 r)
- )
- (if (setq ent (entmakex (list '(0 . "LWPOLYLINE")
- '(100 . "AcDbEntity")
- '(67 . 0)
- '(100 . "AcDbPolyline")
- '(90 . 2)
- '(70 . 1)
- '(38 . 0.0)
- '(39 . 0.0)
- (cons 10 p1)
- (cons 40 rr)
- (cons 41 rr)
- '(42 . 1.0)
- (cons 10 p2)
- (cons 40 rr)
- (cons 41 rr)
- '(42 . 1.0)
- )
- )
- )
- ent
- )
- )
- (defun xd-addpline (vla-obj pts)
- (vla-addlightweightpolyline
- vla-obj
- (vlax-make-variant
- (vlax-safearray-fill
- (vlax-make-safearray
- vlax-vbdouble
- (cons 0 (1- (* 2 (length pts))))
- )
- (apply 'append
- (mapcar '(lambda (x) (list (car x) (cadr x))) pts)
- )
- )
- )
- )
- )
- ;;;画圆环 r1内径r2 外 径
- (defun xd-adddonut (obj p0 r1 r2 / r w p1 p2 pln)
- (setq r (/ (+ r1 r2) 2.)
- w (abs (- r1 r2))
- p1 (polar p0 0. r)
- p2 (polar p0 pi r)
- )
- (setq pln (xd-addpline obj (list p1 p2)))
- (mapcar '(lambda (x) (vla-setBulge pln (car x) (cdr x)))
- '((0 . 1.0) (1 . 1.0))
- )
- (vla-put-ConstantWidth pln w)
- (vla-put-closed pln :vlax-true)
- pln
- )
|