Vla方法,秒杀,写了注释,思路就是原位移动更新。
- (defun C:TT()
- (setq lay_obj (Vlax-Ename->Vla-Object(tblobjname "layer" "FTPLAN")))
- (if (= :vlax-true (vlax-get-property lay_obj "Freeze"))
- (progn
- (vla-put-Freeze lay_obj :vlax-false) ;解冻
- (setq ss (ssget "X" '((8 . "FTPLAN")(0 . "INSERT")))) ;SS选择集
- (setq ss_val (vla-get-activeselectionset (vla-get-ActiveDocument (vlax-get-acad-object)))) ;Vla选择集
- ;执行方法
- (setq pt_vla (vlax-make-variant(vlax-safearray-fill (vlax-make-safearray vlax-vbDouble '(0 . 2)) '(0 0 0))))
- (vlax-for item ss_val
- (vla-move item pt_vla pt_vla) ;原位移动,让框子更新显示
- )
- )
- (vla-put-Freeze lay_obj :vlax-true)
- )
- )
|