将此添加到顶部
- ;;;http://www.cadtutor.net/forum/showthread.php?35506-How-to-get-Region-coordinates/page2
- ;;;adopted as sub-function
- (defun LM:reg (reg / RetObj)
- (setq Reg (vlax-ename->vla-object reg))
- (if (vlax-method-applicable-p reg 'explode)
- (progn
- (setq RetObj (vlax-safearray->list (vlax-variant-value (vla-explode Reg))))
- (repeat (length RetObj)
- (if (eq "AcDbRegion" (vla-get-ObjectName (car RetObj)))
- (setq RetObj (append RetObj (vlax-safearray->list (vlax-variant-value (vla-explode (car RetObj))))))
- (setq RetObj (append RetObj (list (car RetObj))))
- ) ;_ end of if
- (setq RetObj (cdr RetObj))
- ) ;_ end of repeat
- )
- )
- retobj
- ) ;_ end of defun
- ;; Flatten List - Lee Mac
- ;; Transforms a nested list into a non-nested list
- ;; http://www.lee-mac.com/flatten.html
- (defun LM:flatten ( l )
- (if (atom l)
- (list l)
- (append (LM:flatten (car l)) (if (cdr l) (LM:flatten (cdr l))))
- )
- )
由于其三维实体,每个位置将有2个圆(上下),z值不同
ie:2 x 2=4个圆形 |