马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
 - (defun c:XDTB_CrvBrk ( / div e pt pts sel)
- (defun _break-pnt ()
- (if (setq
- e (car (xdrx_entsel
- "\n选择要断开的曲线<退出>:"
- '((0 . "LINE,ARC,CIRCLE,ELLIPSE,SPLINE,*POLYLINE"))
- )
- )
- )
- (progn (while (setq pt (getpoint "\n拾取断开点<结束>:"))
- (setq pts (cons pt pts))
- )
- (if pts
- (xdrx_curve_getsplitcurves e pts)
- )
- )
- )
- (princ)
- )
- (defun _break-divide ()
- (if (and (setq
- e (car (xdrx_entsel
- "\n选择要断开的曲线<退出>:"
- '((0 . "LINE,ARC,CIRCLE,ELLIPSE,SPLINE,*POLYLINE"))
- )
- )
- )
- (setq div (getint "\n输入等分数<退出>:"))
- )
- (progn (xdrx_curve_getsplitcurves
- e
- (setq pts (xdrx_getsamplept e div))
- )
- )
- )
- (princ)
- )
- (defun _break-fit ()
- (if (setq e (car (xdrx_entsel "\n选择要断开的SPLINE<退出>:"
- '((0 . "SPLINE"))
- )
- )
- )
- (progn
- (if (setq pts (xdrx_getpropertyvalue e "fitpoints"))
- (xdrx_curve_getsplitcurves e pts)
- (progn (xdrx_prompt "\nSPLINE 没有拟合点. 断开失败."))
- )
- )
- )
- (princ)
- )
- (xdrx_begin)
- (if (not #xd_var_global_break_mode)
- (setq #xd_var_global_break_mode "D")
- )
- (xdrx_initget "A S D")
- (if (setq sel (getkword
- (xdrx_prompt "\n操作方式[选点(A)/等分(S)/拟合点(D)<"
- #xd_var_global_break_mode
- ">:"
- t
- )
- )
- )
- (setq #xd_var_global_break_mode sel)
- )
- (cond ((= #xd_var_global_break_mode "A") (_break-pnt))
- ((= #xd_var_global_break_mode "S") (_break-divide))
- ((= #xd_var_global_break_mode "D") (_break-fit))
- )
- (if pts
- (xdrx_prompt "\n如你所愿.")
- )
- (xdrx_end)
- (princ)
- )
|