;;;给块赋属性,如何将bb的值赋给(vxsetatts obj val)中的val,执行以下程序,系统提示 "Error 此类型的 LISP 值不能强制转换成 VARIANT: BB" (defun c:sz() (setq aa (vlax-ename->vla-object (car (entsel)))) (setq bb (getstring "\n新流水号为:")) (setq c (vxsetatts aa '(("WATERNUM" . bb) ("OBJNAME" . "市政市容管理局")))) ) (defun VxSetAtts (Obj Lst / AttVal) (mapcar '(lambda (Att) (if (setq AttVal (cdr (assoc (vla-get-TagString Att) Lst))) (vla-put-TextString Att AttVal) ) ) (vlax-invoke Obj "GetAttributes") ) (vla-update Obj) (princ) ) 请老师帮忙解决!zqy@ntup.com |