hug21 发表于 2005-9-11 09:31:00

请高手指点如何读取的属性值

我预先定义好了一个带有"序号"、“图样代号”、“零件名称”等的明细栏,在装配图中插入明细栏根据提示输入各个零件的:"序号"、“图样代号”、“零件名称”。问题是我想输出这些属性值到Access数据库时,输出到数据库中的属性值始终是缺省值,该怎么办请高手指点。

huanghao35 发表于 2005-9-11 13:51:00

<P>好好理解下面斑竹的程序 相信可以解决你的问题</P>
<P>(Defun c:at(/ ename LOOP elist)<BR>&nbsp; (setq ename (entnext (car (entsel))))<BR>&nbsp; (setq LOOP T)<BR>&nbsp; (While (and ename LOOP)<BR>&nbsp;&nbsp;&nbsp; (setq elist (entget ename))<BR>&nbsp;&nbsp;&nbsp; (if (= (cdr (assoc 0 elist)) "ATTRIB")<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (progn<BR>&nbsp;&nbsp; (princ (cdr (assoc 2 elist)))<BR>&nbsp;&nbsp; (princ " ----&gt; ")<BR>&nbsp;&nbsp; (princ (cdr (assoc 1 elist)))<BR>&nbsp;&nbsp; (princ "\n")<BR>&nbsp;&nbsp; )<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (setq LOOP nil)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; )<BR>&nbsp;&nbsp;&nbsp; (setq ename (EntNext ename))<BR>&nbsp;&nbsp;&nbsp; )<BR>&nbsp; (princ)<BR>&nbsp; )</P>
<P>&nbsp;</P>
页: [1]
查看完整版本: 请高手指点如何读取的属性值