本帖最后由 ucuc2003 于 2015-7-11 15:11 编辑
- ;;;;;改变填充基点及角度 by ucuc2003 2012年5月11日
- (defun C:TT5 (/ os htcjd o_DIMZIN ss i s1)
- (setvar "cmdecho" 0)
- (setq os (getvar "osmode"))
- (setq htcjd (getvar "hpang"))
- (setq o_DIMZIN (getvar "DIMZIN"))
- (princ "改变填充图案的新基点及角度")
- (defun *Error* (msg);出错处理
- (if (and msg (not (wcmatch (strcase msg) "*BREAK*,*CANCEL*,*QUIT*,*EXIT*,")))
- (setvar "osmode" os))
- );defun *Error*
- (setvar "DIMZIN" 8)
- (setvar "osmode" 7167)
- (if (= tcjj_old_ang nil) (setq tcjj_old_ang 0))
- (princ (strcat "\n指定填充图案的角度值<" (angtos tcjj_old_ang 0 6) ">: "))
- (setq tcjj_hatch_ang (getangle))
- (if tcjj_hatch_ang (setq tcjj_old_ang tcjj_hatch_ang)(setq tcjj_hatch_ang tcjj_old_ang))
- (setvar "DIMZIN" o_DIMZIN)
- (setq pt (getpoint "\n指定填充图案的新基点 <当前原点>:"))
- (if (not pt)(setq pt '(0. 0. 0.)))
- (setvar "osmode" os)
- (while
- (princ "\n请选择填充图案:")
- ;(command "_.undo" "_begin")
- (if (setq ss (ssget '((0 . "hatch"))) i -1)
- (while (setq s1 (ssname ss (setq i (1+ i))))
- (command "hatchedit" s1 "p" "" "" (angtos tcjj_hatch_ang 0 6))
- (setvar "hpang" htcjd)
- (command "-hatchedit" s1 "o" "s" pt "n")
- );while
- )if
- ;(command "undo" "e")
- );while
- (princ)
- );over defun
以前做的一个和这个类似,这个效率有点慢
|