autolisp教程 高分悬赏,请高手用AutoLISP改写一个坐标提取小程序 50
(defunc:tqzb()(setqff(open(getfiled"文件保存为""d:/""txt"1)"w"))(setqents"")(setqi1)(while...
(defun c:tqzb() (setq ff (open (getfiled "文件保存为" "d:/" "txt" 1) "w")) (setq ents "") (setq i 1) (while (setq pt (getpoint "\n 点击输出坐标的点:")) (setq s (strcat (itoa i ) " " (rtos (nth 1 pt) 2 4) " " (rtos (nth 0 pt) 2 4) " " (rtos (nth 2 pt) 2 4))) (write-line s ff) (princ "\n") (princ (strcat "\n 已输出的文字为'" s "'")) (setq ents "") (setq i (+ 1 i)) ))(prompt "\n 提醒 提取坐标到文本程序已加载,键入 tqZB 启动本程序");;;程序结束将输出的点号和坐标中间加上逗号------(点号,X,Y)这种格式的
展开
2个回答
展开全部
(defun c:tqzb(/ tarFile PointList pt i ff s )
(setq tarFile (getfiled "文件保存为" "d:/" "txt" 1))
(setq PointList '())
(while (setq pt (getpoint "\n 点击输出坐标的点:"))
(setq PointList (append PointList (list pt)))
)
(setq i 0)
(setq ff (open tarFile "w"))
(repeat (length PointList)
(setq pt (nth i PointList))
(setq s (strcat (itoa (1+ i)) ", " (rtos (nth 1 pt) 2 4) ", " (rtos (nth 0 pt) 2 4) ", " (rtos (nth 2 pt) 2 4)))
(write-line s ff)
(setq i (+ 1 i))
)
(close ff)
(startapp "Notepad.exe" tarFile)
(princ)
)
(prompt "\n 提醒 提取坐标到文本程序已加载,键入 tqZB 启动本程序")
(setq tarFile (getfiled "文件保存为" "d:/" "txt" 1))
(setq PointList '())
(while (setq pt (getpoint "\n 点击输出坐标的点:"))
(setq PointList (append PointList (list pt)))
)
(setq i 0)
(setq ff (open tarFile "w"))
(repeat (length PointList)
(setq pt (nth i PointList))
(setq s (strcat (itoa (1+ i)) ", " (rtos (nth 1 pt) 2 4) ", " (rtos (nth 0 pt) 2 4) ", " (rtos (nth 2 pt) 2 4)))
(write-line s ff)
(setq i (+ 1 i))
)
(close ff)
(startapp "Notepad.exe" tarFile)
(princ)
)
(prompt "\n 提醒 提取坐标到文本程序已加载,键入 tqZB 启动本程序")
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
AiPPT
2024-09-19 广告
2024-09-19 广告
随着AI技术的飞速发展,如今市面上涌现了许多实用易操作的AI生成工具1、简介:AiPPT: 这款AI工具智能理解用户输入的主题,提供“AI智能生成”和“导入本地大纲”的选项,生成的PPT内容丰富多样,可自由编辑和添加元素,图表类型包括柱状图...
点击进入详情页
本回答由AiPPT提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询