如何通过变量传递给块赋属性(本论坛中的“VxSetAtts 设置块中属性”函数)
<p>;;;给块赋属性,如何将bb的值赋给(vxsetatts obj val)中的val,执行以下程序,系统提示 "Error 此类型的 LISP 值不能强制转换成 VARIANT: BB"<br/>(defun c:sz()<br/> (setq aa (vlax-ename->vla-object (car (entsel))))<br/> (setq bb (getstring "\n新流水号为:"))<br/> (setq c (vxsetatts aa '(("WATERNUM" . bb) ("OBJNAME" . "市政市容管理局"))))<br/>)<br/>(defun VxSetAtts (Obj Lst / AttVal)<br/> (mapcar<br/> '(lambda (Att)<br/> (if (setq AttVal (cdr (assoc (vla-get-TagString Att) Lst)))<br/>(vla-put-TextString Att AttVal)<br/> )<br/> )<br/> (vlax-invoke Obj "GetAttributes")<br/> )<br/> (vla-update Obj)<br/> (princ)<br/>)<br/>请老师帮忙解决!<a href="mailto:zqy@ntup.com">zqy@ntup.com</a></p>
页:
[1]