明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1608|回复: 3

上千张图批量该块的大小

[复制链接]
发表于 2013-8-18 08:15 | 显示全部楼层 |阅读模式
本帖最后由 dj0737 于 2013-8-20 14:32 编辑

(defun c:gbsc()
(setvar "cmdecho" 0)
(setq <xor (CONS -4 "<XOR")
        xor> (CONS -4 "XOR>") )
(setq <and (cons -4 "<and")
        and> (cons -4 "and>") )
(setq <or (cons -4 "<OR")
        or> (cons -4 "OR>") )
(initget (+ 2 4) "De All")
(setq kword (getkword "D 单个图块 / A <全部图块> :" ))(PRINT)
(cond ((or (= kword "All")(= kword nil))
    (setq enst (ssget "x" (list (cons 0 "insert"))))
    (setq p 0)
    (if enst
     (progn
     (setq scale_b (getreal "输入图块比例尺:"))(PRINT)
        (while (< p (sslength enst))
     (setq enst_block (ssname enst p))
     (setq block_table (entget enst_block))
     (setq block_table (subst (cons 41 scale_b) (assoc 41 block_table) block_table))
     (setq block_table (subst (cons 42 scale_b) (assoc 42 block_table) block_table))
     (setq block_table (subst (cons 43 scale_b) (assoc 43 block_table) block_table))   
     (entmod block_table)
     (setq p (1+ p))
        )
    );progn
  );if
(if (not enst) (alert "没有选中任何物体 !"))
  )
  ((= kword "De")
    (setq bname (getstring "输入块名:"))(PRINT)
    (setq enst (ssget "x" (list <and (cons 0 "insert")(cons 2 bname)and>)))
    (setq p 0)
    (if enst
     (progn
        (setq scale_b (getreal "输入图块比例尺:"))(PRINT)
        (while (< p (sslength enst))
     (setq enst_block (ssname enst p))
     (setq block_table (entget enst_block))
     (setq block_table (subst (cons 41 scale_b) (assoc 41 block_table) block_table))
     (setq block_table (subst (cons 42 scale_b) (assoc 42 block_table) block_table))
     (setq block_table (subst (cons 43 scale_b) (assoc 43 block_table) block_table))   
     (entmod block_table)
     (setq p (1+ p))
        )
    );progn
  );if
(if (not enst) (alert "没有选中任何物体 !"))
)
);cond

(PRINC)
);DEFUN
我需要将上千张图纸中的图块“拐点”的x、y的比例改为12,我有批量运行LISP的程序,请高手帮我改改这个程序,目标是程序不要提示输入块名 ,也不要提示输入比例值,运行程序,输入gbsc命令,就能将图块“拐点”的x、y的比例改为12。谢谢!  帮我修改者留下邮箱,我赠送批量运行LISP的VB程序。
LISP我不会,再次感谢!
发表于 2013-8-18 11:22 | 显示全部楼层
本帖最后由 zyhandw 于 2013-8-18 11:24 编辑

不知你是不会还是图省事,这么简单的工作还是自己动手做做的好
发表于 2020-8-31 15:24 | 显示全部楼层
批量运行lisp的发我一份,有偿
发表于 2022-5-6 11:45 | 显示全部楼层
批量运行LISP可以参照这个范例自己改造下就可以
http://bbs.mjtd.com/plugin.php?i ... xMjIwNjZ8MjcyNzk%3D

评分

参与人数 1明经币 +1 收起 理由
muwind + 1 你正好有 我正好需要,这就对了

查看全部评分

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

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-4-28 09:52 , Processed in 0.876709 second(s), 30 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表