本帖最后由 作者 于 2004-2-17 21:58:47 编辑
可以这样 (setq bn (cdr (assoc 2 (entget (car (entsel "\n选择标注: "))))))然后 用 (setq blk (tblobjname "block" bn))遍历 blk 找 AcDbMtext 就可以取出字高。一段用来测试的代码- (defun c:test (/ e obj)
- (if (setq e (car (entsel)))
- (progn
- (setq obj (vlax-ename->vla-object e)
- blk (vla-item (vla-get-blocks
- (vla-get-activedocument (vlax-get-acad-object))
- )
- (cdr (assoc 2 (entget e)))
- )
- )
- (vlax-for i blk
- (setq elst (cons (vla-get-objectname i) elst))
- )
- )
- )
- )
标注返回的表("AcDbPoint" "AcDbPoint" "AcDbPoint" "AcDbMText" "AcDbBlockReference"
"AcDbBlockReference" "AcDbLine" "AcDbLine" "AcDbLine")从中也可以看出DIM生成的顺序,Line、Line、Line、两边的斜线、数字、点 |