要提供替代方法,请加载此函数,然后加载并运行以下内容:
- (defun c:findregions ( / f )
- (setq f [color=red]"C:\\RegionResults.txt"[/color]) ;; Output file
- (LM:odbx
- '(lambda ( x / r )
- (vl-catch-all-apply
- '(lambda nil
- (vlax-for l (vla-get-layouts x)
- (vlax-for o (vla-get-block l)
- (if (= "AcDbRegion" (vla-get-objectname o))
- (progn (setq r t) (exit))
- )
- )
- )
- )
- )
- (if r
- (if (setq d (open f "a"))
- (progn (write-line (vla-get-name x) d) (close d))
- (prompt (strcat "\nUnable to open " f))
- )
- )
- )
- nil nil
- )
- (if (setq f (findfile f))
- (startapp "notepad" f)
- (prompt "\nNo regions found in any drawing.")
- )
- (princ)
- )
- (vl-load-com) (princ)
|