马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
- (defun c:xdtb_cp2donut (/ cen ss v x)
- (xdrx-begin)
- (xd::var:getdouble "#xd-var-global-radius1" 0.0)
- (if (setq
- v (getreal
- (xdrx-prompt "\n输入内径<" #xd-var-global-radius1 ">:" t)
- )
- )
- (xd::var:setdouble "#xd-var-global-radius1" (abs v))
- )
- (xd::var:getdouble "#xd-var-global-radius2" 1.0)
- (if (setq v (getreal (xdrx-prompt
- "\n输入外径(0取圆直径)<"
- #xd-var-global-radius2
- ">:"
- t
- )
- )
- )
- (xd::var:setdouble "#xd-var-global-radius2" (abs v))
- )
- (if (setq ss (xdrx-ssget
- "\n选择要生成圆环的圆或者点实体<退出>:"
- '((0 . "circle,point"))
- )
- )
- (progn
- (mapcar
- '(lambda (x)
- (if
- (or (and (xdrx-object-iskindof x "point")
- (not (equal #xd-var-global-radius2 0.0 1e-4))
- (> #xd-var-global-radius2 #xd-var-global-radius1)
- (setq cen (xdrx-getpropertyvalue x "Position"))
- )
- (and (xdrx-object-iskindof x "circle")
- (setq #xd-var-global-radius2
- (if
- (equal #xd-var-global-radius2
- 0.0
- 1e-4
- )
- (xdrx-getpropertyvalue
- x
- "Diameter"
- )
- #xd-var-global-radius2
- )
- )
- (> #xd-var-global-radius2 #xd-var-global-radius1)
- (setq cen (xdrx-getpropertyvalue x "center"))
- )
- )
- (progn (xdrx-donut-make
- cen
- #xd-var-global-radius1
- #xd-var-global-radius2
- )
- (xdrx-entity-delete x)
- )
- )
- )
- (xdrx-pickset->ents ss)
- )
- )
- )
- (xdrx-end)
- (princ)
- )
|