zhoufupeng 发表于 2008-12-7 16:46:00

[求助] Presscad 图形加工说明问题

请问各位,Presscad 里面的图形不是块,但它们又可以像块一样 附带 属性,以便提取里面的加工说明。<br/>这是怎样做到的?怎么样才可以提取及写入??<br/>

祥子 发表于 2008-12-7 20:59:00

<p>是用了扩展数据</p><p><br/>&nbsp; (entget (car (entsel)) '("*")) 可以取出扩展数据</p><p>;;;给图元附上扩展数据</p><p>;;;用法(jx_set_xdata (car (entsel))&nbsp; "test" (list(cons 1000 "test")))</p><p>(defun jx_set_xdata (en rname xd_list / old all elist)<br/>&nbsp; (setq&nbsp;elist (entget en '("*"))<br/>&nbsp;rname (strcase rname)<br/>&nbsp; )<br/>&nbsp; (regapp rname)<br/>&nbsp; (setq&nbsp;xd_list&nbsp;(cons rname xd_list)<br/>&nbsp;old&nbsp;(assoc -3 elist)<br/>&nbsp; )<br/>&nbsp; (cond<br/>&nbsp;&nbsp;&nbsp; ((and old (assoc rname (cdr old)))<br/>&nbsp;&nbsp;&nbsp;&nbsp; (setq all&nbsp; (cons -3 (subst xd_list (assoc rname (cdr old)) (cdr old)))<br/>&nbsp;&nbsp;&nbsp; elist (subst all (assoc -3 elist) elist)<br/>&nbsp;&nbsp;&nbsp;&nbsp; )<br/>&nbsp;&nbsp;&nbsp;&nbsp; (entmod elist)<br/>&nbsp;&nbsp;&nbsp; )<br/>&nbsp;&nbsp;&nbsp; ((and old (not (member rname (cdr old))))</p><p>&nbsp;&nbsp;&nbsp;&nbsp; (setq all&nbsp; (append old (list xd_list))<br/>&nbsp;&nbsp;&nbsp; elist (subst all (assoc -3 elist) elist)<br/>&nbsp;&nbsp;&nbsp;&nbsp; )<br/>&nbsp;&nbsp;&nbsp;&nbsp; (entmod elist)<br/>&nbsp;&nbsp;&nbsp; )<br/>&nbsp;&nbsp;&nbsp; ((not old)<br/>&nbsp;&nbsp;&nbsp;&nbsp; (setq xd_list (list -3 xd_list)<br/>&nbsp;&nbsp;&nbsp; elist&nbsp;&nbsp; (append elist (list xd_list))<br/>&nbsp;&nbsp;&nbsp;&nbsp; )<br/>&nbsp;&nbsp;&nbsp;&nbsp; (entmod elist)<br/>&nbsp;&nbsp;&nbsp; )<br/>&nbsp; )<br/>)</p>

zhoufupeng 发表于 2008-12-13 20:48:00

非常感谢。确实是这样

2548572928 发表于 2022-2-22 10:10:43

2548572928 发表于 2024-2-29 19:47:35

非常感谢。了解了
页: [1]
查看完整版本: [求助] Presscad 图形加工说明问题