明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1434|回复: 5

[源码] 请教一些lisp程序编写中的问题

[复制链接]
发表于 2011-7-16 19:53:18 | 显示全部楼层 |阅读模式
(defun C:gps_txt_zlkb ( / buchang1 e0 ent ent_tmp i loop no point pt ss ss1 txt txt_num txt_num_ws txt_str txt2 txt2_num);!!!文字增量拷贝
  (gps->error-init  (list  '("cmdecho" 0 )    nil  ));end init
  (if (null $buchang) (setq $buchang 1))
  (setq $buchang (ureal 1 "" "\n增减值(正为增,负为减)" $buchang) buchang1 $buchang)   
  (setq ss (ssget ":L"))
  (if ss (progn   
  (setq e0 (gps->entlast))  
  (setq pt (getpoint "指定基点:"))   
  (command "copy" ss "" pt pause)   
  (setq loop T)
  (while loop      
   
    (foreach ent (gps->ss-2lst (gps->entlastent e0))
      (setq txt (gps->txt-getvalue ent))
      (if txt
                (progn
                (setq txt_num (gps->get_str_num txt))  ;数字
  例如:“ (setq txt (gps->txt-getvalue ent))”中gps后边的->是什么意思?
发表于 2011-7-16 20:28:54 | 显示全部楼层
本帖最后由 Andyhon 于 2011-7-16 21:45 编辑

(setq txt (gps->txt-getvalue ent))

gps->txt-getvalue 是一个函数
这个函数的命名最好是有着 '顾名思义' 的识别作用

txt-getvalue 解读成 得到文字内容
gps-> 应是个人专用前导符 用以区隔其他的人所写的函式
发表于 2011-7-16 20:29:35 | 显示全部楼层
gps->txt-getvalue 是一个自定义函数
 楼主| 发表于 2011-7-16 20:46:56 | 显示全部楼层
多谢楼上2位!
发表于 2011-7-16 21:36:41 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
发表于 2011-7-16 21:37:26 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2025-6-10 04:23 , Processed in 0.998714 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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