是的,您可以将x比例(assoc 41)或y比例(assoc 42)修改为-1(或当前因子的-1倍)。
唯一一件事:flipX将根据插入点翻转它。如果插入点位于门挡的左中部,则它将保持不变。。。
- (defun flip_ (ent x y / sc)
- (if x (progn
- ;; read the current scale, then multiply be x ( = -1)
- (setq sc (cdr (assoc 41 (entget ent))))
- (setq x (* x sc))
- (entmod (subst
- (cons 41 x) ;; 256 sets the color to ByLayer
- (assoc 41 (entget ent)) ;; the current color
- (entget ent)
- ))
- )
- )
- (if y (progn
- ;; read the current scale, then multiply be y ( = -1)
- (setq sc (cdr (assoc 42 (entget ent))))
- (setq y (* y sc))
- (entmod (subst
- (cons 42 y) ;; 256 sets the color to ByLayer
- (assoc 42 (entget ent)) ;; the current color
- (entget ent)
- ))
- )
- )
- )
- (defun c:flipx ( / ent)
- (setq ent (car (entsel "\nSelect door: ")))
- (flip_ ent -1 nil)
- )
- (defun c:flipy ( / ent)
- (setq ent (car (entsel "\nSelect door: ")))
- (flip_ ent nil -1)
- )
|