示例代码:
 - (defun c:tt ()
- (while
- (progn
- (setq en (car (entsel "\n选择图块:")))
- (and en
- (not (= "INSERT" (cdr (assoc 0 (setq el (entget en))))))
- )
- )
- )
- (vlax-for obj
- (vla-item (vla-get-blocks
- (vla-get-ActiveDocument (vlax-get-acad-object))
- )
- (cdr (assoc 2 el))
- )
- (setq color (vla-get-color obj)
- layer (vla-get-layer obj)
- objname (vla-get-objectname obj)
- )
- (princ "\n对象名称 = ")
- (princ objname)
- (princ "\n对象图层 = ")
- (princ layer)
- (princ "\n对象颜色 = ")
- (princ color)
- ;;添加你的操作代码
- ;;...
- )
- (princ)
- )
|