找回密码
 [加入论坛]
查看: 1179|回复: 0

[转帖]一个面积计算程序

[复制链接]
2443725 发表于 2004-9-5 15:29 | 显示全部楼层 |阅读模式
<FONT face=宋体>给大架提供一个面积计算程序
要求1。图纸必须按照比例绘制
2。可计算各种面积,选择目标为封闭区域
3。可进行多次选择,面积自动累加
(DEFUN C:dlmj ( )
(if (= bl nil)(setq bl(getreal "input bl---:")))(setvar "userr1" bl)
(setq pt (getpoint "\n插入点:"))
(setq mmm 0.0)
(while (/= pt nil)
(command "layer" "s" "mj" "")
(command "boundary" pt "")
(command "region" "l" "")
(command "massprop" "l" "" "y" "aa.mpr" "")
; (command "erase" "l" "")
(setq f1 (open "C:\aa.mpr" "r"))
(setq j1 (read-line f1))
(setq j2 (read-line f1))
(setq j3 (read-line f1))
(setq j4 (read-line f1))
(setq j5 (read-line f1))
(close f1)
(setq j4 (substr j4 15 30))
(setq j41 (atof j4))
(setq j41 (* j41 bl) j41 (* j41 bl))
(setq j41 (/ j41 1000.0) j41 (/ j41 1000.0))
(setq mmm (+ mmm j41))
(setq pt (getpoint "\n插入点:"))
)
(setq nnn (rtos mmm 2 2))
(command "layer" "s" "0" "")
(setq pt (getpoint "\n输出点:"))
(command "text" pt "3" "0" nnn "")
)</FONT>
您需要登录后才可以回帖 登录 | [加入论坛]

本版积分规则

手机版|化工技术网- 赠人玫瑰 手有余香 ( 苏ICP备14035884号 )

GMT+8, 2026-12-1 16:17

Powered by Discuz! X5.0

© 2001-2026 Discuz! Team.

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