乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
查看: 129|回复: 1

[编程交流] 翻转(不旋转)门

[复制链接]

19

主题

109

帖子

96

银币

初露锋芒

Rank: 3Rank: 3Rank: 3

铜币
89
发表于 2022-7-18 18:26:42 | 显示全部楼层 |阅读模式
嗨,我们有翻转(x,y轴)正常块(非动态块)的例程吗???在基本autolisp中尝试过,但似乎有太多的排列。。。。
如所附样本所示。它是一个简单的门框,1x1,按门洞宽度(750/900/100/1200…等)放大。插入点位于角落,便于连接到墙角。
在将来翻转它(就像在sketchup中一样)有点痛苦,因为它必须镜像,然后放置到位。。。。。
回复

使用道具 举报

15

主题

315

帖子

361

银币

初来乍到

Rank: 1

铜币
25
发表于 2022-7-18 19:52:10 | 显示全部楼层
是的,您可以将x比例(assoc 41)或y比例(assoc 42)修改为-1(或当前因子的-1倍)。
 
唯一一件事:flipX将根据插入点翻转它。如果插入点位于门挡的左中部,则它将保持不变。。。
 
  1. (defun flip_ (ent x y / sc)
  2.         (if x (progn
  3.                 ;; read the current scale, then multiply be x ( = -1)
  4.                 (setq sc (cdr (assoc 41 (entget ent))))
  5.                 (setq x (* x sc))
  6.                 (entmod (subst
  7.                                 (cons 41 x)                          ;; 256 sets the color to ByLayer
  8.                                 (assoc 41 (entget ent))        ;; the current color
  9.                                 (entget ent)
  10.                 ))
  11.                 )
  12.         )
  13.         (if y (progn
  14.                 ;; read the current scale, then multiply be y ( = -1)
  15.                 (setq sc (cdr (assoc 42 (entget ent))))
  16.                 (setq y (* y sc))
  17.                 (entmod (subst
  18.                                 (cons 42 y)                          ;; 256 sets the color to ByLayer
  19.                                 (assoc 42 (entget ent))        ;; the current color
  20.                                 (entget ent)
  21.                 ))
  22.                 )
  23.         )
  24. )
  25. (defun c:flipx ( / ent)
  26.         (setq ent (car (entsel "\nSelect door: ")))
  27.         (flip_ ent -1 nil)
  28. )
  29. (defun c:flipy ( / ent)
  30.         (setq ent (car (entsel "\nSelect door: ")))
  31.         (flip_ ent nil -1)
  32. )
回复

使用道具 举报

发表回复

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-5-24 22:07 , Processed in 0.338802 second(s), 56 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表