本帖最后由 wowan1314 于 2013-7-23 19:45 编辑
试试。 - (defun c:t11 (/ enbox ss a en p12)
- (defun enbox (ename / ll ur)
- (vla-getboundingbox (vlax-ename->vla-object ename) 'll 'ur)
- (mapcar 'vlax-safearray->list (list ll ur))
- )
- (setq ss (ssget) a -1)
- (if ss
- (while
- (setq en
- (ssname ss
- (setq a
- (1+ a)
- )
- )
- )
- (setq p12 (enbox en))
- (command "rectang" (car p12)(cadr p12))
- )
- )
- )
|