本帖最后由 wkq004 于 2017-12-25 18:13 编辑
只加了框选
- (defun C:tt (/ mspace ss n obj pts)
- (VL-LOAD-COM)
- (setq mSpace (vla-get-ModelSpace (vla-get-ActiveDocument (vlax-get-acad-object))))
- (princ "\n选择集内的三维线转成多段线:")
- (if (setq ss (ssget '((0 . "POLYLINE"))))
- (repeat (setq n (sslength ss))
- (setq obj (vlax-ename->vla-object (ssname ss (setq n (1- n)))))
- (setq pts (vlax-variant-value (vla-get-coordinates obj)))
- (vla-AddPolyline mSpace pts)
- )
- )
- (princ)
- )
|