下面的是一个简单示例,选择你要改动的图块中的文字或hatch,即可自动转换到需要的图层 - (defun c:tt()
- (princ "\n选择图块中的子图元:")
- (setq ent (car (nentsel)))
- (if ent
- (progn
- (setq ent (vlax-ename->vla-object ent))
- (cond ((= "AcDbText" (vla-get-ObjectName ent))
- (command "layer" "m" "Text" "")
- (vla-put-layer ent "Text")
- )
- ((= "AcDbHatch" (vla-get-ObjectName ent))
- (command "layer" "m" "hatch" "")
- (vla-put-layer ent "hatch")
- )
- )
- )
- )
- (command "regen")
- (princ)
- )
|