马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
- ;|
- 三点圆弧拖动实现函数
- 参数:
- info ---- 提示字符串
- pj ---- 起点
- p2 ---- 弧上第二点
- keyWord --- 关键字字符串
- Cursor --- 光标样式
- 0 - kCrosshair
- 1 - kCrosshair
- 2 - kRubberBand
- 3 - kNoSpecialCursor
- 4 - kEntitySelect
- 5 - kParallelogram
- 6 - kInvisible
- 其他值- kPkfirstOrGrips
- |;
- (defun XD::Drag:Arc1 (info pj p2 keyWord cursor / dynpt e mat0 pts ret)
- (defun EdgeCallBack (dynPt / pts)
- (setq arcinfo (xdrx_geom_3p2arc pj p2 dynpt))
- (if (not e)
- (setq e (apply
- 'xdrx_arc_make
- (cdr arcinfo)
- )
- )
- (progn
- (xdrx_modent 10 (cadr arcinfo) 40 (nth 2 arcinfo) 50 (nth 3 arcinfo) 51 (nth 4 arcinfo))
- )
- )
- e
- )
- (setq pj (trans pj 1 0))
- (initget 1)
- (setq ret (xdrx_drag_jig "EdgeCallBack" info keyWord (+ 1 2 4 8 16 128 512 65536) Cursor pj))
- (cond
- ((= ret -4)
- (entdel (entlast))
- )
- (t
- (if (= (type ret) 'STR)
- (progn
-
- (entdel (entlast))
- )
- )
- )
- )
- (gc)
- ret
- )
测试示例代码:
- (defun c:test-drag-arc1()
- (if (and (setq p1 (getpoint "\n起点:"))
- (setq p2 (getpoint "\n第二点:"))
- )
- (progn
- (XD::Drag:Arc1 "\n终点[退出-Q]:" p1 p2 "Q" 0)
- )
- )
- (princ)
- )
|