王航 发表于 2015-4-16 08:14
高手,您在吗,烦请帮帮忙,谢谢您!
千万不要叫我高手 , 我只是随便玩玩
这是你想要的吗?- (defun c:TT()
- (VL-LOAD-COM)
- (setq AcadObject (vlax-get-acad-object)
- AcadDocument (vla-get-ActiveDocument Acadobject)
- mSpace (vla-get-ModelSpace Acaddocument)
- )
- ;;输入栽钉的数量
- (setq prefix1 (vla-GetString
- (vla-get-Utility AcadDocument)
- :vlax-false
- "请输入栽钉的数量:"
- )
- )
- (setq prefix (strcat prefix1 "-M"))
- ;;输入栽钉的长度
- (setq suffix1 (vla-GetString
- (vla-get-Utility AcadDocument)
- :vlax-false
- "请输入栽钉长度:"
- )
- )
- (setq suffix (strcat "×" suffix1 "\\X栽钉"))
- ;;选择一个标注
- (setq dimObj1 (car (entsel)))
- (setq dimObj (vlax-ename->vla-object dimObj1))
- ;;添加前缀
- (vla-put-TextPrefix dimObj prefix)
- ;;添加后缀
- (vla-put-TextSuffix dimObj suffix)
- (princ)
- )
|