- (defun c:mreg ()
- (vl-load-com)
- (setq *Obj (vlax-get-acad-object)
- *Doc (vla-get-activeDocument *Obj)
- *MSp (vla-get-Modelspace *Doc)
- )
- (princ "\n选择生成面域的多段线: ")
- (setq plss (ssget))
- (setq pli 0
- dei 0
- plcount (sslength plss)
- objs nil
- )
- (repeat plcount
- (setq ent (ssname plss pli))
- (setq object (vlax-ename->vla-object ent))
- (setq pb (vla-get-closed object))
- (if (= pb :vlax-true)
- (setq objs (cons object objs))
- )
- (setq pli (1+ pli))
- )
- (setq curves (vlax-make-safearray
- vlax-vbobject
- (eval '(cons 0 (1- plcount)))
- )
- )
- (vlax-safearray-fill curves objs)
- (setq regobjs (vla-addregion *Msp curves))
- (repeat plcount
- (setq obj (nth dei objs))
- (vla-delete obj)
- (setq dei (1+ dei))
- )
- (setq regobjs (vlax-safearray->list (vlax-variant-value regobjs)))
- (setq regobjs
- (vl-sort
- regobjs
- '(lambda (s1 s2) (> (vla-get-area s1) (vla-get-area s2)))
- )
- )
- )
求出了面域的集合regobjs,如何求差集?
|