明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 2313|回复: 2

[函数] 关于ASSOC函数的关键字问题

  [复制链接]
发表于 2011-4-11 12:14:25 | 显示全部楼层 |阅读模式
各位大侠,请大家看一下这个程序:

;属性按选择顺序加1。明经 ZZXXQQ 2009.10.2,2010.6.29
(defun c:add1 ()
(if (setq n (getint "\nInput Start Number 输入起始号 :"))
  (progn
  (while (and (setq s1 (entsel "\nSelect Block with Attrib 选择带属性图块 :"))
         (setq ent (entget(setq en (car s1))))
          (= (cdr(assoc 0 ent)) "INSERT")
          (= (cdr(assoc 66 ent)) 1))
   (setq ent1 ent)
   (while (= (cdr(assoc 0 (setq ent1 (entget(entnext(cdr(assoc -1   ent1))))))) "ATTRIB")
    (if (= (cdr(assoc 2 ent1)) "地块编号") (progn
  (setq ttx (cdr(assoc 1 ent1))
           ttx (substr ttx 1 (- (strlen ttx) 2)))
     (setq txtn (strcat ttx (if (< n 10) "0" "") (itoa n)))
     (setq ent1 (subst(cons 1 txtn) (assoc 1 ent1) ent1))
     (entmod ent1)
     (entmod ent)
    ))
   )
   (setq n (1+ n))
  )
))
(princ)
)
这个程序里很多asso函数后面加了 0, 66 , -1,  2等关键字,我不太理解这些关键字的含义,求教各位,谢谢了
发表于 2011-4-11 12:23:19 | 显示全部楼层
参考下帮助里的dxf组码就知道了
 楼主| 发表于 2011-4-11 12:29:46 | 显示全部楼层
回复 snddd2000 的帖子

恩,谢谢啦
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2025-5-16 18:37 , Processed in 0.150393 second(s), 25 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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