明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 3101|回复: 2

[原创]改线高程乘/除常数

[复制链接]
发表于 2008-7-25 21:13:00 | 显示全部楼层 |阅读模式

这是我作业中遇到的不知大家有用否

(defun c:gbg(/ ss a name elev)
  (command "undo" "be")
  (setq ss(ssget (list
                   '(-4 . "<OR")
                    (cons 0 "lwpolyline")
                    (cons 0 "polyline")
                   '(-4 . "OR>")
                    )))
  (setq a 0)
  (repeat (sslength ss)
    (setq name(ssname ss a))
    (setq vlaobject-name (vlax-ename->vla-object name))
    (setq elev (vla-get-Elevation vlaobject-name))
    (vla-put-Elevation vlaobject-name (* elev 5));;乘常数
    (vlax-release-object vlaobject-name)
    (setq a(1+ a))
)
(command "undo" "e")
)
;;除常数
(defun c:qbg(/ ss a name elev)
  (command "undo" "be")
  (setq ss(ssget (list
                   '(-4 . "<OR")
                    (cons 0 "lwpolyline")
                    (cons 0 "polyline")
                   '(-4 . "OR>")
                    )))
  (setq a 0)
  (repeat (sslength ss)
    (setq name(ssname ss a))
    (setq vlaobject-name (vlax-ename->vla-object name))
    (setq elev (vla-get-Elevation vlaobject-name))
    (vla-put-Elevation vlaobject-name (/ elev 5));;除常数
    (vlax-release-object vlaobject-name)
    (setq a(1+ a))
)
(command "undo" "e")
)

发表于 2010-1-29 02:31:00 | 显示全部楼层
谢谢楼主!很好啊!
发表于 2012-12-3 01:55:21 | 显示全部楼层
是源码顶一下.
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-11-23 11:45 , Processed in 0.176550 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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