明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1226|回复: 1

高手看看,看看这个程序想改变下。谢谢

[复制链接]
发表于 2010-9-6 19:30:00 | 显示全部楼层 |阅读模式

(DEFUN C:w9()
 (SSGET)(COMMAND "CHANGE" "P" "" "P" "S"  "0.9""")
)

这个程序是输W9改变线性比例为0.9.

我想输W9来成倍增加还有成倍减小线性比例。高手帮忙解决下,谢谢!

发表于 2010-9-7 20:39:00 | 显示全部楼层
有个以前 写的,仅供参考:
(defun c:bx (/ loop en ent sx bl gj )    ;动态改变线形比例
  (setq loop t)
  (setq en (car (entsel "\n请选择:")))
  (setq ent (entget en))
  (setq sx (cdr (assoc 48 ent)))
  (setq
    bl (getreal
     (strcat "\n原来比例为" (rtos sx 2 1) "输入比例<动态修改>:")
       )
  )
  (if (null bl)
    (while loop
           (initget 0 "F S C")
       (setq gj (getkword "\n放大(F),缩小(S),退出(C)"))
       (if (null gj)(setq gj gjj))
      (cond ((= gj "F")
         (command "change" en "" "p" "s" (setq sx (* 2.0 sx)) "")
        )
        ((= gj "S")
         (command "change" en "" "p" "s" (setq sx (* sx 0.5)) "")
        )
        ((= gj "C")
         (setq loop nil)
        )
      )
      (setq gjj gj)
      (princ sx)
    )
    (command "change" en "" "p" "s" bl "")
  )
  (princ)
)
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-10-2 10:27 , Processed in 0.147719 second(s), 26 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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