(defun c:test()
(setq e (entsel))
(setq p (cadr e))
(setq lenCH (car (apply 'mapcar (cons '- (reverse (textbox (entget(car(nentsel p)))))))))
(setq lenw (rtos lenCH));转换文字长度串值
(setq dx_actdyn (vlax-ename->vla-object e))
(LM:setdynpropvalue dx_actdyn "距离1" lenw);
;设置选择的动态属性块 ”距离1“ 长度为文字长度
(princ)
)
改为这样,然后执行就是这样:选择对象: ; 错误: 参数类型错误: stringp (1903.83 977.293 0.0) lisp我是半瓶水,黄大侠的代码放进去出现错误。我还是没明白啊,求救!!! (if (setq ent (car (nentsel "\n请选择文本:")))
(setq zf (cdr (assoc 1 (entget ent))); 提取文本得字符
len (strlen zf);文本字符串的长度
)
) kozmosovia 发表于 2016-4-26 13:55 static/image/common/back.gif
(if (setq ent (car (nentsel "\n请选择文本:")))
(setq zf (cdr (assoc 1 (entget ent))); 提取文本得字符 ...
我是想将两次选择改为一次选择
页:
1
[2]