找回密码
 立即注册

QQ登录

只需一步,快速开始

扫一扫,访问微社区

查看: 1175|回复: 3

[LISP程序]:请教一个问题,急等回复!!!

[复制链接]
发表于 2005-12-26 14:33:57 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

×
我用lisp读取点坐标时,位数一多程序就用科学计数法计数,把我想要的精确位数都搞没了,请问有没有一个不用移动图纸就能解决的办法啊!!!原代吗如下
(defun c:dzb ()
  (setq nu (getstring "\n输入点号前缀:"))
  (setq n (getint "\n输入起点号序数:"))
  (setq f (open "f:\\Rush\\dzb.txt" "a"))
  (while
    (setq p0 (getpoint "\n指定点:"))
    (setq x0  (car p0))
    (setq y0 (nth 1 p0))
    (princ nu f)
    (princ n f)
    (princ "," f)
    (princ y0 f)
    (princ "," f)
    (princ x0 f)
    (princ "\n" f)
    (setq n(+ n 1))
  )
  (close f)
)
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
发表于 2005-12-26 14:43:13 | 显示全部楼层
(rtos (car pt) 2 4))
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

已领礼包: 8157个

财富等级: 富甲天下

发表于 2005-12-26 14:43:40 | 显示全部楼层
RtoS Function

Converts a number into a string

(rtos number [mode [precision]])

The rtos function returns a string that is the representation of number according to the settings of mode, precision, and the system variables UNITMODE, DIMZIN, LUNITS, and LUPREC.

Arguments

number

A number.

mode

An integer specifying the linear units mode. The mode corresponds to the values allowed for the LUNITS AutoCAD system variable. The mode can be one of the following numbers:

1  Scientific

2  Decimal

3  Engineering (feet and decimal inches)

4  Architectural (feet and fractional inches)

5  Fractional

precision

An integer specifying the precision.

The mode and precision arguments correspond to the system variables LUNITS and LUPREC. If you omit the arguments, rtos uses the current settings of LUNITS and LUPREC.

Return Values

A string. The UNITMODE system variable affects the returned string when engineering, architectural, or fractional units are selected (mode values 3, 4, or 5).

Examples

Set variable x:

Command: (setq x 17.5)

17.5

Convert the value of x to a string in scientific format, with a precision of 4:

Command: (setq fmtval (rtos x 1 4))

"1.7500E+01"

Convert the value of x to a string in decimal format, with 2 decimal places:

Command: (setq fmtval (rtos x 2 2))

"17.50"
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

 楼主| 发表于 2005-12-26 14:54:12 | 显示全部楼层
谢谢各位!!!果然有效果!!!
论坛插件加载方法
发帖求助前要善用【论坛搜索】功能,那里可能会有你要找的答案;
如果你在论坛求助问题,并且已经从坛友或者管理的回复中解决了问题,请把帖子标题加上【已解决】;
如何回报帮助你解决问题的坛友,一个好办法就是给对方加【D豆】,加分不会扣除自己的积分,做一个热心并受欢迎的人!
回复 支持 反对

使用道具 举报

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

本版积分规则

QQ|申请友链|Archiver|手机版|小黑屋|辽公网安备|晓东CAD家园 ( 辽ICP备15016793号 )

GMT+8, 2025-9-28 23:46 , Processed in 0.347392 second(s), 37 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

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