谢谢飞兄,:)我也作点贡献,通用函数吧~~;;; ax:ssget
;;; 返回ActiveX形式的选择集-
- ;;; ax:ssget
- ;;; 返回ActiveX形式的选择集(vl-load-com)(defun ax:ssget (FilterTypeList FilterDataList / sets ss ft fd)
- (setq sets (vla-get-SelectionSets
- (vla-get-activedocument (vlax-get-acad-object))
- )
- )
- (if (vl-catch-all-error-p
- (vl-catch-all-apply
- (function (lambda ()
- (setq ss (vla-item sets "ax_ssget"))
- (vla-clear ss)
- )
- )
- nil
- )
- )
- (setq ss (vla-add sets "ax_ssget"))
- )
- (if (and FilterTypeList FilterDataList)
- (progn
- (setq ft (vlax-make-safearray
- vlax-vbInteger
- (cons 0 (1- (length FilterTypeList)))
- )
- )
- (vlax-safearray-fill ft FilterTypeList)
- (setq fd (vlax-make-safearray
- vlax-vbVariant
- (cons 0 (1- (length FilterDataList)))
- )
- )
- (vlax-safearray-fill fd FilterdataList)
- (vla-selectOnScreen ss ft fd)
- )
- (vla-selectOnScreen ss)
- )
- ss
- );;;(defun c:test1 (/ item)
- ;;; (vlax-for item (ax:ssget nil nil)
- ;;; (vla-delete item)
- ;;; )
- ;;;)
- ;;;
- ;;;(defun c:test2 (/ item)
- ;;; (vlax-for item (ax:ssget '(0) '("circle"))
- ;;; (vla-delete item)
- ;;; )
- ;;;)
- ;;;
- ;;;(defun c:test3 (/ item)
- ;;; (vlax-for item (ax:ssget '(0) '("circle,*line"))
- ;;; (vla-delete item)
- ;;; )
- ;;;)
- ;;;
- ;;;(defun c:test4 (/ item)
- ;;; (vlax-for item (ax:ssget '(0 8) '("circle,*line" "layer1"))
- ;;; (vla-delete item)
- ;;; )
- ;;;)
|