明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 3884|回复: 10

帮忙修改《数字递增复制》

[复制链接]
发表于 2005-5-4 11:59 | 显示全部楼层 |阅读模式
(defun c:99 (/ E ENEW NV P S)
(if (and (setq e (car (entsel "\n选择数字文本: ")))
(setq e (vlax-ename->vla-object e))
(or (= "AcDbText" (vla-get-ObjectName e))
(= "AcDbMText" (vla-get-ObjectName e))
)
)
(progn
(setq s (vla-get-TextString e))
(if (null (setq nv (getreal (strcat "\n输入递增值:" "<1>"))))
(setq nv 1)
)
(princ "\n指定点: ")
(while (setq p (getpoint))
(setq enew (vla-copy e))
(vla-put-textstring enew (setq s (rtos (+ (atof s) nv) 2)))
(vla-put-InsertionPoint enew (vlax-3d-point p))
)
)
(princ "\n选中的不是文本或没有选择到实体.")
)
(princ)
)
"觉得好,就打赏"
还没有人打赏,支持一下
发表于 2005-5-4 13:08 | 显示全部楼层
改什么?怎么改?
 楼主| 发表于 2005-5-4 13:10 | 显示全部楼层
执行出错,昨天还能用,今天罢工了


cad2006
发表于 2005-5-7 09:09 | 显示全部楼层
楼主,很谢谢你的程序。。蛮好的。。。程序在2002中通过。。。没问题。如果不能加载运行了。建议重装CAD,一般问题都能得到很好的解决。。因为lisp的稳定性不是很好。。呵呵。
发表于 2005-5-7 09:14 | 显示全部楼层
谢谢啊。程序写得很好。VLA是lisp的扩展函数吧。。好象很有用啊。
发表于 2005-5-9 15:33 | 显示全部楼层
谢谢                 很好用的程序


哪位大侠再改一下复制是增加 指定基点:
发表于 2007-7-6 17:25 | 显示全部楼层

  1. (terpri)
  2. (setq jd 2)
  3. (prompt "\n当前精度0.00,设置精度,请退出后输入jdsz进行设置")
  4. (DEFUN C:jdsz ()
  5.   (initget 1 "0 1 2 3 4 5 6 7 8 9")
  6.   (setq  jd (getint  "\n 请输入精度位数[整数(0)/1位(1)/2位(2)/3位(3)/4位(4)]:"))
  7.   )
  8. (defun c:nadd (/ E ENEW NV nv1 nv2 P2 p1 S)
  9.   
  10.   (if (and (setq e (car (entsel "\n选择数字文本: ")))
  11.     (setq e (vlax-ename->vla-object e))
  12.     (or (= "AcDbText" (vla-get-ObjectName e))
  13.         (= "AcDbMText" (vla-get-ObjectName e))
  14.         )
  15.     )
  16.     (progn
  17.       (setq s (vla-get-TextString e))
  18.       (setq nv 1)
  19.       (setq p1 (getpoint "\n指定基点:"))
  20.       (while (setq p2 (getpoint P1 "\n下一点 :") )
  21. (setq nv1 (strcat "\n输入递增值<" (itoa nv) ">:"))
  22. (setq nv (if(setq nv2 (getint nv1)) nv2 nv))
  23. (setq enew (vla-copy e))
  24. (vla-put-textstring enew (setq s (rtos (+ (atof s) nv) 2 jd)))
  25. (vla-put-InsertionPoint enew (vlax-3d-point p2))
  26. )
  27.       )
  28.     (princ "\n选中的不是文本或没有选择到实体.")
  29.     )
  30.   (princ)
  31.   )
发表于 2012-4-7 10:44 | 显示全部楼层


http://bbs.mjtd.com/thread-92870-1-1.html

本帖子中包含更多资源

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

x
发表于 2012-4-7 12:06 | 显示全部楼层
楼上挖坟的。
发表于 2012-8-28 11:19 | 显示全部楼层
我也需要这个程序。。。。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-6-17 17:43 , Processed in 0.163113 second(s), 27 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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