Hsanon 发表于 2022-7-18 18:26:42

翻转(不旋转)门

嗨,我们有翻转(x,y轴)正常块(非动态块)的例程吗???在基本autolisp中尝试过,但似乎有太多的排列。。。。
如所附样本所示。它是一个简单的门框,1x1,按门洞宽度(750/900/100/1200…等)放大。插入点位于角落,便于连接到墙角。
在将来翻转它(就像在sketchup中一样)有点痛苦,因为它必须镜像,然后放置到位。。。。。

Emmanuel Delay 发表于 2022-7-18 19:52:10

是的,您可以将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)
)
页: [1]
查看完整版本: 翻转(不旋转)门