明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1516|回复: 2

为什么总提示参数太少?

[复制链接]
发表于 2004-5-26 15:58:00 | 显示全部楼层 |阅读模式
我用啊飞的炸开一个块及子块的程序: (defun Explodex(ents / ss i )
(command "_.explode" ents)
(setq ss (ssget "P"))
(setq i 0)
(repeat (sslength ss)
(setq ent (ssname ss i))
(if (= "INSERT" (cdr (assoc 0 (entget ent))))
(explodex ent)
)
(setq i (1+ i))
)
) 改成下面炸开除尺寸线外的块: (defun ExplodexNoDim(ents / ss i Ent1Info Ent1Type)
(setq Ent1Info (entget ents))
(setq Ent1Type (cdr (Assoc 0)))
(if (/= ent1type "DIMENSION")
(Progn
(command "_.explode" ents)
(setq ss (ssget "P"))
(setq i 0)
(repeat (sslength ss)
(setq ent (ssname ss i))
(if (= "INSERT" (cdr (assoc 0 (entget ent))))
(explodex ent)
)
(setq i (1+ i))
)
)
)
)
(defun c:ExplodexAllNoDim( / ss i )
(setq ss (ssget "X"))
(setq i 0)
(repeat (sslength ss)
(setq ent (ssname ss i))
(if (= "INSERT" (cdr (assoc 0 (entget ent))))
(ExplodexNoDim ent) )
(setq i (1+ i))
) ) 运行后为什么总提示参数太少?
发表于 2004-5-26 16:21:00 | 显示全部楼层
(defun EXPLODEX (ENTS / SS I ENT)
(command "_.explode" ENTS)
(setq SS (ssget "P"))
(setq I 0)
(repeat (sslength SS)
(setq ENT (ssname SS I))
(if (= "INSERT" (cdr (assoc 0 (entget ENT))))
(EXPLODEX ENT)
)
(setq I (1+ I))
)
) (defun C:EXPLODEXALLNODIM (/ SS I)
(setq SS (ssget "X"
(list '(0 . "insert") (cons 410 (getvar "ctab")))
)
)
(setq I 0)
(repeat (sslength SS)
(EXPLODEX (ssname SS I))
(setq I (1+ I))
)
)
 楼主| 发表于 2004-5-27 08:46:00 | 显示全部楼层
今天又试了一下,原来是 (setq Ent1Type (cdr (Assoc 0)))
漏了一个参数,应该为 (setq Ent1Type (cdr (Assoc 0 Ent1Info ))) ,还有其实飞版的程序已经排除了尺寸对象,不用我再加判断。唉!!昨天愣是找不到问题。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-11-28 07:41 , Processed in 0.167241 second(s), 26 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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