马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有账号?立即注册
×
本帖最后由 Lispboy 于 2013-7-21 13:48 编辑
![](source/plugin/imc_colorcode/images/loading.gif) - ;|
- 阵列拖动实现函数
- 参数:
- info ---- 提示字符串
- ss ---- 选择集
- pj ---- 基点
- nums -- 数量
- keyWord --- 关键字字符串
- Cursor --- 光标样式
- 0 - kCrosshair
- 1 - kCrosshair
- 2 - kRubberBand
- 3 - kNoSpecialCursor
- 4 - kEntitySelect
- 5 - kParallelogram
- 6 - kInvisible
- 其他值- kPkfirstOrGrips
- 返回值:点或者关键字
- |;
- (defun XD::Drag:Array (info ss pj nums keyword cursor / dynpt e entl entll i mat mat0 p1 pts ret ss1 v x)
- (defun FitArrayCallBack (dynPt / pts entl)
- (setq p1 dynPt
- v (mapcar
- '-
- dynPt
- pj
- )
- )
- (foreach x entll
- (entdel x)
- )
- (setq entll nil)
- (setq i 1)
- (repeat (- nums 1)
- (setq mat (xdrx_matrix_setTranslation mat0 (xdrx_vector_product v i)))
- (setq ss1 (xdrx_entity_transformedcopy ss mat))
- (setq i (1+ i))
- (setq entl (XD::SS:ENTS ss1))
- (setq entll (append entl entll))
- )
- ss
- )
- (XD::Begin)
- (setq pj (trans pj 1 0)
- mat0 (xdrx_matrix_identity 3)
- )
- (setvar "lastPoint" pj)
- (initget 1)
- (setq ret (xdrx_drag_jig "FitArrayCallBack" info keyWord (+ 1 2 4 8 16 128 512 65536) Cursor pj))
- (cond
- ((= ret -4)
- )
- (t
- (if (= (type ret) 'STR)
- (progn
- (foreach x entll (entdel x))
- )
- )
- )
- )
- (XD::End)
- (gc)
- ret
- )
|